Live data from Hacker News

“Coding is basically just ifs and for loops.”

twitter.com

281–290 of 418 posts

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

#281
post #234

Earlier quoted context omitted.

Those mean nothing without the proteic machinery that translates codons into other proteins though. DNA and RNA without ribosomes is like a language without a compiler.

Umm.. what are those codons and other proteins made of? ...

They are distinct biopolymers. DNA and RNA are polymers of just 5 different types of nucleotides. Proteins are polymers of some 20 radically different aminoacids.

https://en.wikipedia.org/wiki/Proteinogenic_amino_acid

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

#282

Earlier quoted context omitted.

That’s what disappoints me in modern Java. There is practically no ifs. It makes it inaccessible to beginners on the project, and the streams are about twice as slow… just because devs think they are more clever if they pile 7 “.map()” to transform a list. list.stream().filter(Objects::nonNull).map(User::getUsername).filter(Objects::nonNull).filter(name -> name.contains(searchString)).map(name -> “We have found your…

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…

>and you have to read it all to find out what it does.

Which isn't a problem, because as long as its all loops'n branches, the code is easy to understand.

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

#283

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…

Isn’t this just a rant that the senior management/devs failed to set up an environment[1] to stop this sort of thing happening? I don’t really understand how it’s related to the linked tweet or the subtext of it.

[1] either a policy like strict code review or perhaps a cultural change about quality or responsibility or mentorship.

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

#285

"First a punch is just a punch, Then a punch is not only a punch, And finally a punch is just a punch" (heard from Bruce Lee) Basically it means that in the beginning we punch like we can.. then a martial arts student learns the proper and different ways to punch.. so a punch is no longer just a punch... Is a lot of instructions.. Then to sheer practice and repetition the right way to punch becomes second nature.. so…

Perceived complexity peaks at intermediate skill. There's a concept in learning theory that perceived complexity is diamond shaped.

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

#286
post #267

I also like "all web development is basically fancy string concatenation", and as a web dev I feel seen.

George Hotz said something once that most modern developer jobs are depressing because you're not doing any actual programming. I.e. you're not given a problem to solve with code, you're just taping together frameworks and pieces of code that someone else wrote to order. It's a bit like studying to be a chef for five years and then having to put together one of five types of burgers. Like everything Hotz says it's sp…

Making crud apps feels like I'm doing a data entry job

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

#287

Earlier quoted context omitted.

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

Personally I disagree. We should be using state machines and pure functions. If+for loops are just what's easiest to express in the major languages of today. they are no more or less computationally expensive but due to lack of tooling they are often cheaper to write. In languages and libraries that allow FSM and pure functional kernel based designs you can get just as clear logic that is expressible not just to the…

>They are well understood and most people can understand them with little to no additional education past what they learned in their business or engineering bachelors degrees.

Imperative code:

    Take A and B.
    Add C ml of Water.
    Stir for 2 minutes.
    If it thickened, add D grams of flour, else go back to stiring.
This is easily understood by everyone, degree or no. Once someone figures out loops and the difference between statement and expression, they can essentially understand imperative code.

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

#288

Earlier quoted context omitted.

That’s what disappoints me in modern Java. There is practically no ifs. It makes it inaccessible to beginners on the project, and the streams are about twice as slow… just because devs think they are more clever if they pile 7 “.map()” to transform a list. list.stream().filter(Objects::nonNull).map(User::getUsername).filter(Objects::nonNull).filter(name -> name.contains(searchString)).map(name -> “We have found your…

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…

JavaScript's "first()" is https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe... .

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

#289
post #279

Earlier quoted context omitted.

"Before enlightenment: Ifs and loops. After enlightenment: Ifs and loops." :)

heh. "Before enlightenment - chop wood, carry water. After enlightenment - chop wood, carry water."

Before enlightenment coding is logic.

After a first glimpse it’s all about structure and architecture.

After enlightenment, coding is logic again.

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

#290

Earlier quoted context omitted.

I started off writing a lot of 68000 machine code. I was always amazed what you could accomplish with a lot of loops and branches. I never lost that sense that at whatever higher level I was at later on, it was all loops and branches.

Yes, one of my early jobs was writing Z80 code and I have the same sense.

When I eventually learned C it took me awhile to stop optimizing and let the compiler do it
Post reply on HN