Live data from Hacker News

“Coding is basically just ifs and for loops.”

twitter.com

311–320 of 418 posts

Re: “Coding is basically just ifs and for loops.”

#311

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.

[deleted]

Re: “Coding is basically just ifs and for loops.”

#312

Earlier 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.

They’re obsolete now, except on YouTube.

Re: “Coding is basically just ifs and for loops.”

#313

Earlier 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"

The caveat there is that you cannot call it without a null check on “u.name” first. contains(null, “whatever”) would just return false instead of throwing a runtime exception. Hence my edit: users.filter() has the same problem.

Re: “Coding is basically just ifs and for loops.”

#315

Thats 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…

Yup, when I encounter these massive abstract code bases, with some tyrant "genius" running the team, I just walk away quietly.

Re: “Coding is basically just ifs and for loops.”

#317

Earlier quoted context omitted.

Q: What's the difference between a novice and an expert? A: The novice thinks twice before doing something stupid.

I don't understand this saying.

"It's common to become very good at doing it badly"

Re: “Coding is basically just ifs and for loops.”

#318
post #139

Earlier 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'…

That just sounds like enterprisey Java to me, which I firmly believe is closer to 2 than 3.

Re: “Coding is basically just ifs and for loops.”

#319

Earlier 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…

> Saying it is all ifs and for-loops is completely true. Everything else, all the abstractions and high level features, are just sugar

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.”

#320
post #14

That 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.

The problem with this is that most software is absolute garbage and most code is an awful, unmaintainable mess. The middle of that curve are all the people who are trying to improve that situation. The right side of the curve are the people who have given up. But maybe that does make them the smarter ones.
Post reply on HN