you guys have for loops?
This was my first reaction too. Now I work in a (Swift) codebase where I could probably count the number of for loops we have on one hand. Pretty much everything is done through map/reduce/filter, etc. At first, I thought it wasn't as readable, but now that I'm used to the syntax, I think it's much easier to parse what happening. I know what transformation is happening, and I know there shouldn't be any side-effects.
“Coding is basically just ifs and for loops.”
311–320 of 418 posts
Re: “Coding is basically just ifs and for loops.”
#312Earlier quoted context omitted.
Have you seen this? https://news.ycombinator.com/item?id=25788317 Seems like we lose a lot of good technology and progress for random reasons, like the “ram” of society is finite.
Yes, it's a good talk. Think of all the extremely talented internal combustion engine engineers that will be obsolete in 20 - 30 years.
Re: “Coding is basically just ifs and for loops.”
#313Earlier quoted context omitted.
That’s a failure of Java’s language design, not a failure of the functional/declarative paradigm. Your for loop can do all kinds of damage to the list, and you have to read it all to find out what it does. Saner languages make the functional version more expressive.p: return first(users.filter(u => contains(u.name, searchString)) I’m not saying JS is a sane language; it has an anemic standard library without a robust…
JS has Array.some() for "contains"
Re: “Coding is basically just ifs and for loops.”
#314Re: “Coding is basically just ifs and for loops.”
#315Thats why i am seeing DB schemas without indexes lately. End of the day people with this kinda thinking make others to fix the broken code that they left behind. As a senior software engineer i had to spend a lot of time at night fixing code written by junior devs and interns. the code that company and devs (just ifs and loops gang) proud of was a pain in the ass for me so i quit the job entirly and do freelancing th…
Re: “Coding is basically just ifs and for loops.”
#316Re: “Coding is basically just ifs and for loops.”
#317Re: “Coding is basically just ifs and for loops.”
#318Earlier quoted context omitted.
New developers write simple but shortsighted code. It gets the job done, but it will be painful to work with in the future. Intermediate developers, bitten by their past mistakes, decide to future proof their work. But they don’t just look one or two steps ahead, rather they try to look five steps ahead and identity problems that do not and may never exist. Consequently, they over-engineer, over-abstract, and over-co…
Had a boss once who insisted that all if statements should be pushed out to factory classes, and all control logic should be done by constructing a different instance of an interface. It was a pretty rigid system, but at least it did force me to write small focused classes that were easy to test. Debated for a long time whether that methodology was stuck in the second phase or if it was actually the third. Still don'…
Re: “Coding is basically just ifs and for loops.”
#319Earlier quoted context omitted.
Despite being a joke, I know it's the "Ha Ha Only Serious" [0] sort. I can't help but think this is severely biased by the trends of "enterprise software," where you eventually "give up", and clock your 9–5 writing if+for making a fine living, but erroneously pass that off as a mature, Jedi-like way of thinking about programming, like the meme suggests. (And, consequently, you spend no less time debugging hairy, nest…
> you eventually "give up", and clock your 9–5 writing if+for making a fine living, but erroneously pass that off as a mature This comment sure indicates to me where you most likely are on the curve. In all seriousness, I think this is considerably off the mark. After enough experience you realize that expressivity and convenience are antipatterns and don't actually simplify things but are harbingers of complexity, b…
You sound like the kind of person who thinks the ancient Greeks figured out all of math and everything that has happened since then is just fancy abstractions and sugar. Either software engineering can advance as a discipline, or it can't. You seem to be assuming it can't.
> This comment sure indicates to me where you most likely are on the curve
Never mind, you just sound like an asshole.
Re: “Coding is basically just ifs and for loops.”
#320That first reply is so funny to me because it hits too close to home https://twitter.com/nice_byte/status/1466940940229046273 The more I do this, the more I gravitate towards the simple things.