Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
lorentz15268235dwhat's harmful about syntax sugar? I'd say that an excessive number of syntax "atoms" which can't be described in terms of other syntax is bad, but anything that is essentially identical to some other more verbose or repetitive syntax is at worst useless.
-
BadFox2340235dSucralose, aspartame, acesulfame k, xylitol, erythritol, etc. so many names, so little time.
-
TeachMeCode5175235d@jestdotty what’s that got to do with
array.forEach() vs for(indx = 0;….etc
the forEach is way more readable -
lorentz15268234d@TeachMeCode Those are functionally different; a for loop works with any object that has a length, it supports yielding, early returns, and changing the index to move the iterator, and consequently it has predictable results when editing the array while iterating.
-
lorentz15268234d@TeachMeCode Meanwhile forEach is an interface that can be implemented for non-array structures that don't support random indexing but do support sequential iteration.
-
TeachMeCode5175234d@lorentz yes totally know that, and agree. Should’ve been more explicit and included a scenario where a for loop can be easily replaced by a foreach but I was lazy lol
Syntax Stevia
noun
Like syntax sugar, but it doesn’t harm you project in the long run
random