TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

“Coding is basically just ifs and for loops.”

496 pointsby x43bover 3 years ago

82 comments

elviejoover 3 years ago
&quot;First a punch is just a punch, Then a punch is not only a punch, And finally a punch is just a punch&quot; (heard from Bruce Lee)<p>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 the right way to punch is the only way so it&#x27;s only a punch again.<p>So coding it&#x27;s just ifs and loops... Then is OOP and Functional and Logic... But then once you transcend all those paradigms you understand that is all ifs and loops.
评论 #29445316 未加载
评论 #29444327 未加载
评论 #29444808 未加载
评论 #29445193 未加载
评论 #29444960 未加载
评论 #29445693 未加载
评论 #29444500 未加载
评论 #29446805 未加载
评论 #29444603 未加载
评论 #29444595 未加载
评论 #29444955 未加载
评论 #29444922 未加载
评论 #29449624 未加载
评论 #29445259 未加载
评论 #29524429 未加载
评论 #29446527 未加载
ncannover 3 years ago
That first reply is so funny to me because it hits too close to home<p><a href="https:&#x2F;&#x2F;twitter.com&#x2F;nice_byte&#x2F;status&#x2F;1466940940229046273" rel="nofollow">https:&#x2F;&#x2F;twitter.com&#x2F;nice_byte&#x2F;status&#x2F;1466940940229046273</a><p>The more I do this, the more I gravitate towards the simple things.
评论 #29444024 未加载
评论 #29443140 未加载
评论 #29443307 未加载
评论 #29443358 未加载
评论 #29443556 未加载
评论 #29443112 未加载
评论 #29444896 未加载
评论 #29443279 未加载
评论 #29443649 未加载
评论 #29444761 未加载
评论 #29443194 未加载
评论 #29444173 未加载
评论 #29446185 未加载
评论 #29444410 未加载
评论 #29444104 未加载
评论 #29443074 未加载
karlsheaover 3 years ago
I also like &quot;all web development is basically fancy string concatenation&quot;, and as a web dev I feel seen.
评论 #29445360 未加载
评论 #29443749 未加载
评论 #29446468 未加载
评论 #29443301 未加载
评论 #29444743 未加载
评论 #29443227 未加载
HerrMonnezzaover 3 years ago
Well, quite: if you add that code must run sequentially it&#x27;s the Boehm-Jacopini theorem: <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Structured_program_theorem" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Structured_program_theorem</a>
评论 #29445116 未加载
webZeroover 3 years ago
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.<p>As a senior software engineer i had to spend a lot of time at night fixing code written by junior devs and interns.<p>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 these days.<p>I tried to explain how something was wrong and why but no one would listen all believe they were 10x developers, Life lesson learned, never ever try to correct an idiot.<p>Here are some of the practices they followed * No indexes on tables, not even unique * No DRY, NO KISS * Switching to new shiny framework&#x2F;library every week * no tests * Keeping entire codebase in a single file (4k LOC) * no versioning * Exposing DB credentials to the entire internet and not acting when being warned
评论 #29445326 未加载
评论 #29445649 未加载
评论 #29446127 未加载
评论 #29444727 未加载
评论 #29454831 未加载
porknubbinsover 3 years ago
And really, aren&#x27;t loops just ifs and jumps under the hood? So coding is just ifs
评论 #29442920 未加载
评论 #29443024 未加载
评论 #29443611 未加载
评论 #29445221 未加载
评论 #29447671 未加载
评论 #29442969 未加载
ravenstineover 3 years ago
If you want to go even lower than that, coding is basically just saying <i>yes</i> or <i>no</i> in response to a <i>yes</i> or a <i>no</i>.<p>Sure, that&#x27;s oversimplifying it, but that&#x27;s the smallest unit of information being changed during computation.<p>But yes, once you learn the basics that are shared between most programming languages and don&#x27;t get distracted by the nuances, it doesn&#x27;t take that long to pick up a different language. Being <i>proficient</i> is of course another question, but achieving a basic understanding shouldn&#x27;t take all that long when you just focus on how to if-else, how to setup loops, and how to assign variables.
评论 #29444069 未加载
评论 #29445187 未加载
评论 #29443494 未加载
emersonrsantosover 3 years ago
This is funny, but it&#x27;s like saying &quot;Math is basically pluses and minuses&quot;.<p>I see coding as playing with hardware without having to use soldering iron.
评论 #29443009 未加载
评论 #29443244 未加载
评论 #29445037 未加载
评论 #29447612 未加载
评论 #29443124 未加载
评论 #29443188 未加载
klyrsover 3 years ago
UGH. Back in my day the only language was BASIC and we only had IF and GOTO. Dijkstra has made these children SOFT and I&#x27;d piss on his grave if I could be arsed to get out of my rocking chair.
评论 #29445106 未加载
gnuvinceover 3 years ago
In my twenties, I wanted to use all the cool PL techniques: meta-programming, reflection, monads, macros, type-level programming, etc. I&#x27;m getting older and now I want my programs to be 90–95% functions, arrays, structs, enums, and loops and only parsimoniously throw in more advanced language features.
评论 #29445896 未加载
评论 #29446721 未加载
eeccover 3 years ago
There’s a joke in the fp community I can’t find right now that describes the evolution of programs from imperative side-effectful statements to a for comprehension, with exception catching, that looks nearly identical.
评论 #29443927 未加载
pyuser583over 3 years ago
Then what the fuck is a monad?!?<p>Seriously I still don’t know what a monad is and apparently it’s just a bunch ifs and for loops, so I guess I’m pretty stupid.
评论 #29447920 未加载
评论 #29446537 未加载
评论 #29447150 未加载
评论 #29447880 未加载
评论 #29446479 未加载
wly_cdgrover 3 years ago
Actually coding is just literary translation into a language spoken only by pedantic idiot savants<p>That&#x27;s why it&#x27;s pedantic idiot savants who tend to be the best coders
ChrisArchitectover 3 years ago
While Carmack is law, don&#x27;t think this was worth a share here, as it was just a cute thing a young kid said? Only slight jokey whatever
mslotover 3 years ago
Good code explains the problem to the reader and implements the solution as a side effect.<p>You can often express the problem quite well using a combination of if, for, comments, variable names, function names, list&#x2F;set and map data structures.<p>Sometimes (&lt;10%) you encounter a problem that&#x27;s interesting enough to define a custom type, and sometimes you make tree data structure out of it (&lt;1%). On very rare occasions (&lt;0.1%), you need a more complex data structure.<p>Code that uses thousands of classes is very hard for a reader to approach, but so is a single file with a never-ending ifs and for loops. Always write code for another person. If nothing else that other person might be you in a few months (or much sooner).<p>Coding is basically just writing for humans in a language a computer can execute.
sva_over 3 years ago
All life is just cytosine, guanine, adenine, and thymine.
评论 #29444792 未加载
评论 #29443320 未加载
Ozzie_osmanover 3 years ago
Coding is basically just ifs and for loops.. But software engineering (or development) is much more than just coding.
评论 #29444101 未加载
danielodievichover 3 years ago
I remember explaining recursion to an aspiring programmer to apply to some tree node walking or something, and at some point it clicked! I saw the second it worked in the reflection in her eyes, they got big and lit up and there was this palpable sense of &quot;a-ha&quot; in the room! It was one of the coolest moments of my professional life. But yeah, my kids (one of whom is picking up programming) would be right behind the &quot;ifs and loops&quot; statement.
irrationalover 3 years ago
Reminds me of a coworker who said that they only data structure you need is an array since it can be used to to mimic every other data type.
评论 #29444977 未加载
ArtWombover 3 years ago
Sounds like the Re-birth of the &quot;Expert System&quot;. Now with neural networks ;)<p>Learning from Artificial Intelligence’s Previous Awakenings: The History of Expert Systems<p><a href="https:&#x2F;&#x2F;ojs.aaai.org&#x2F;index.php&#x2F;aimagazine&#x2F;article&#x2F;view&#x2F;2809" rel="nofollow">https:&#x2F;&#x2F;ojs.aaai.org&#x2F;index.php&#x2F;aimagazine&#x2F;article&#x2F;view&#x2F;2809</a>
nomemoryover 3 years ago
Coding is just electrons having fun.
123pie123over 3 years ago
my professor at uni always said that machine code is just 1&#x27;s and 0&#x27;s and if you can count to one you can understand computers<p>(with a smile on his face and shrugging his shoulders)
karmakazeover 3 years ago
The way I interpret this is that the &#x27;just ifs and for loops&#x27; is like Matrix rain code. In the beginning it looks like gibberish scrolling down the screen. When you master it, it&#x27;s still gibberish scrolling down the screen, but it&#x27;s simultaneously something else on another level as well.<p>I often find myself writing simple things with a compact-but-high-level-conceptualization, that when edited by someone else, clearly only saw the rain.
fennecfoxenover 3 years ago
Ifs and for loops are trash. Real programmers just write massive linear algebra operations that they can throw on a cluster of GPUs to get 50,000x parallelism. ;)
smoldesuover 3 years ago
I wish I could have a son who understands Turing completeness without being explicitly told... I guess that&#x27;s the power of the Carmack bloodline.
disambiguationover 3 years ago
also &quot;coding is basically over glorified plumbing&quot;. ~ my cynical coworkers
评论 #29443737 未加载
评论 #29443376 未加载
micromacrofootover 3 years ago
you guys have for loops?
评论 #29443890 未加载
评论 #29443789 未加载
lngnmn2over 3 years ago
Lol no. It is a whole sets of skills, from extracting just right abstracts from the problem domain and defining adequate sets of interfaces, to arrive at just right (clear, concise, mostly-functional) modular implementation.<p>Almost no one nowadays possess these skills. I we have is node_modules crap and J2EE-like design bullshit.<p>This like saying that poetry is just words and commas.<p>But he is just a kid, I know. ;)
gorgoilerover 3 years ago
Ahem, and <i>math</i> in between. Quite a lot of it.<p>Calculating the square root of a number is ifs and loops but wouldn’t be much fun without the math.
hunter321over 3 years ago
I&#x27;m one one of a small number of people at my FANNG company that can work on a legacy MM LoC Perl project.<p>Many of them are much smarter than me, but I think my insight which I remember getting around 6 months in is that it&#x27;s just code, in many places hard to read&#x2F;follow, but it will ultimately just do a logical set of instructions.
larsrcover 3 years ago
Building a house is just lumber and nails.
评论 #29444251 未加载
dehrmannover 3 years ago
His mind will be blown to lean it all runs on protons, neutron, and electrons.
评论 #29447934 未加载
brightballover 3 years ago
Quite literally how I explain coding to people.<p>It’s basically that, plus resource management.
评论 #29443210 未加载
Connor_Creeganover 3 years ago
Ah, keen observation, young grasshopper! But nota bene: just as man cannot live on bread alone, one&#x27;s understanding does not arrive merely from the consideration of a collection of atoms.
JasonFruitover 3 years ago
Yeah, it&#x27;s just branching and iteration. The kid&#x27;s right.
H8crilAover 3 years ago
Just to be clear: a language with only if() conditionals and for() loops with known number of iterations (so for instance all for-each loops) isn&#x27;t actually Turing complete. This is called primitive recursion, and an easy to prove example of what it cannot process is computing the Ackerman function.<p>Also, you can easily see that something is fishy because all such code must terminate (where&#x27;s the halting problem here?)<p><a href="https:&#x2F;&#x2F;en.m.wikipedia.org&#x2F;wiki&#x2F;Primitive_recursive_function" rel="nofollow">https:&#x2F;&#x2F;en.m.wikipedia.org&#x2F;wiki&#x2F;Primitive_recursive_function</a><p>Otherwise I completely agree with the aphorism.
whalesaladover 3 years ago
And functional programming is just algebra. Ez Pz.
makachover 3 years ago
Thing with loops, they are complicated. Like infinity. I remember when someone taught me about multiple infinities. It is wonderful!
arketypover 3 years ago
A Turing machine is basically just ifs in a loop.
评论 #29443800 未加载
foxhopover 3 years ago
It&#x27;s not about the code, it&#x27;s always been about the data over spacetime. You have a data problem, not a code problem.
alsadiover 3 years ago
Computers are just infinite tape marked out into squares... (Turing machine). A pyramid is just a stack of cubic rocks.
评论 #29443327 未加载
andrew_over 3 years ago
<a href="http:&#x2F;&#x2F;www.bash.org&#x2F;?7717" rel="nofollow">http:&#x2F;&#x2F;www.bash.org&#x2F;?7717</a>
smiley1437over 3 years ago
Wait till he reads about a Turing machine
Gualdrapoover 3 years ago
I really wish it was as simple as that.
black_13over 3 years ago
And ppl nagging you. No clueless ppl nagging you with things like jira and idiots like jeff sutherland.
TheOtherHobbesover 3 years ago
Wild stab in the dark here, but for some applications it&#x27;s possible you may need assignments too.
revskillover 3 years ago
Until he finds out about Promise.then chain. So, programming is basically just ifs, for loop and then.
shireboyover 3 years ago
It’s all just strings. Make the right strings happen in the right place and the computer does things.
aiisjustanifover 3 years ago
Hey I found a post about my username.
faizshahover 3 years ago
One time I told someone I work on web apps and they said “oh that’s just html and css that’s easy.”
评论 #29443302 未加载
mirekrusinover 3 years ago
It&#x27;s just 0s and 1s, really.
chrismcbover 3 years ago
Well it is ifs and loops and assignments. Kind of not useful without the assignments.
notacowardover 3 years ago
Until you get to network programming, then it&#x27;s &quot;just open a socket&quot;
ir193over 3 years ago
joke aside. we know a language is Turing-incomplete if it has only ifs and bounded for loops. And if 90% programmers&#x27; tasks can be done using a Turing-incomplete language, is there any benifits we can get from this?
评论 #29447932 未加载
Yuioupover 3 years ago
Yeah, but a master of coding uses a lot of Mathematics, like his dad does :-)
thomover 3 years ago
Add in some form of mutability and you’ve got yourself a Turing machine, yes.
alok-gover 3 years ago
Living is just moving stuff around based on the stimulus received. :-)
madsbuchover 3 years ago
All we need are functions!
coliveiraover 3 years ago
In fact it is just ifs and jumps. Loops are a higher level construct.
xwdvover 3 years ago
No, coding is just converting some data into other forms of data.
评论 #29442870 未加载
评论 #29442898 未加载
评论 #29444160 未加载
评论 #29442918 未加载
tintorover 3 years ago
&quot;construction is basically just concrete and steel&quot; :)
ww520over 3 years ago
Amateur. We do branchless coding and unroll every loop here.
makachover 3 years ago
haha, it is! it is a wonderful experience when you make that realization. That&#x27;s the point with programming. Easy to learn. Difficult to master.
Sniffnoyover 3 years ago
Coding is basically just ifs and <i>while</i> loops.
efnxover 3 years ago
Or, coding is basically just folds and filters.
vegai_over 3 years ago
Gastronomy is just fat, sugar and protein.
评论 #29447738 未加载
y3shover 3 years ago
with input, output, and rw to arbitrary memory.. then I think that just about satisfies turing completeness
sharperguyover 3 years ago
And c++ is basically just c with classes.
amaiover 3 years ago
Coding is basically just zeros and ones.
otikikover 3 years ago
For loops are basically ifs and gotos.
raverbashingover 3 years ago
And print. Don&#x27;t forget print
GhettoComputersover 3 years ago
Computers are just thinking rocks.
评论 #29443204 未加载
Apocryphonover 3 years ago
It’s just 0’s and 1’s, baby
kai10kover 3 years ago
just when you think it is, concurrency is a whole new level
nestorDover 3 years ago
And datastructures.
mcguireover 3 years ago
And assignments.
newsbinatorover 3 years ago
Humans are basically just ifs and for loops
评论 #29443139 未加载
评论 #29443208 未加载
评论 #29443092 未加载
loliveover 3 years ago
And types.
kevmoover 3 years ago
git is just a graph, man
评论 #29443573 未加载
评论 #29443228 未加载
评论 #29443203 未加载
steeleover 3 years ago
Ok
mandeepjover 3 years ago
“coding is basically just ifs and for loops.”<p>Maybe, he knows only that much, yet
mftbover 3 years ago
This is the most insightful thing I&#x27;ve ever seen on Twitter.