4
kiki
30d

Syntax Stevia
noun
Like syntax sugar, but it doesn’t harm you project in the long run

Comments
  • 2
    what'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.
  • 0
  • 1
    Sucralose, aspartame, acesulfame k, xylitol, erythritol, etc. so many names, so little time.
  • 0
    @jestdotty what’s that got to do with
    array.forEach() vs for(indx = 0;….etc

    the forEach is way more readable
  • 1
    @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.
  • 1
    @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.
  • 0
    @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
Add Comment