4 ms·
> `3. Simplicity is king.` Yes, this is true. But for me, people get it the wrong all the time. If you have an object which you have to check yeah don't chec
by lampe3 8y ago
> `3. Simplicity is king.`
Yes, this is true.
But for me, people get it the wrong all the time.
If you have an object which you have to check yeah don't check for everything you could ever imagine. Like I have seen code where the actual check was longer than the code after.
But if you are looping through a big array and I mean big not your little 1000 index array and you think any loop is good enough and suddenly you have a reactive system which was the simplest way to code but the thing is over reactive so your calling your function with a slow loop function all the time just because was simpler to read or to implement your just doing more harm with that rule than actual benefit.
This is also the reason why people use `.map()` in javascript to loop through stuff without ever knowing what map is actually for.
- kilburn 8y agoOh, the irony. (Yeah I know this is not good HN ettiquete, but I just could not resist in this case. Sorry.)
- lampe3 8y ago????
- kilburn 8y agoYou asserted that "simplicity is king" and then proceeded to make a very complicated comment I'm just not sure I can fully understand. Read aloud your 3-4 lines long sentence without any punctuation and you'll undestand my problem. That was the irony :)
- lampe3 8y agoOh yeah now I see it :D
- lloeki 8y agoMay I recommend watching "Simplicity is complicated" talk by Rob Pike: https://www.youtube.com/watch?v=rFejpH_tAHM https://www.youtube.com/watch?v=rFejpH_tAHM https://talks.golang.org/2015/simplicity-is-complicated.slide#1 https://talks.golang.org/2015/simplicity-is-complicated.slid...
- lampe3 8y agoThanks, I will.
- sethammons 8y agoHow is .map() not a slow loop? I'm not a js Dev, but my understanding is it loops over all elements in a list, applying a function and creating a new list. With a loop. That would be as fast as any other loop. What am I missing?
- lampe3 8y agoThe point is that map itself returns an new array. But people use it for just looping through an array without creating a new one