21 ms·
“Coding is basically just ifs and for loops.”
- emersonrsantos 5y agoThis is funny, but it's like saying "Math is basically pluses and minuses". I see coding as playing with hardware without having to use soldering iron.
- hinkley 5y agoA marathon is just putting one foot in front of the other, after all. What’s the big deal? I mean a two year old can do that, and they can’t even handle logic yet.
- Swizec 5y agoAs a marathon runner, people sometimes ask "How does a person run for 3 hours O.O" and well it's about the same as running for 5 minutes except you don't stop. Simple != easy
- User23 5y agoStrength training is equally simple. Just keep increasing the weight you lift.
- GhettoComputers 5y agoBeing thin is also easy, just don’t eat too much.
- CyberDildonics 5y agoThey said simple, not easy.
- jholman 5y agoBeing pedantic is simple, you just say things that don't contain detectable errors. (I'm agreeing with you about "simple, not easy")
- chewbacha 5y agoMaybe math is just equations and sets.
- humanistbot 5y agoIt is just sets! Set theories like Zermelo–Fraenkel can be the foundations for all of mathematics. https://en.wikipedia.org/wiki/Set_theory https://en.wikipedia.org/wiki/Set_theory
- garmaine 5y agoI think he knows.
- ncmncm 5y agoMath is just writing on a blackboard. Equations and sets optional.
- GhettoComputers 5y agoMath is just addition and subtraction. Coding is just copy and pasting boilerplate code and googling how to make it work.
- tluyben2 5y agoCopilot. FTFY.
- adambyrtek 5y agoMathematics is "just" set theory and everything else, including arithmetic, can be built on top of that.
- whatshisface 5y agoHonestly that's not a great example given that you can't understand ZFC until you already know enough set theory to understand the motivations for ZFC.
- nothis 5y agoWell, it is just counting natural numbers and making up placeholders for whenever a subtraction or division wouldn't work out.
- _v7gu 5y agoYeah we went beyond Presburger a long while ago
- Ozzie_osman 5y agoCoding is basically just ifs and for loops.. But software engineering (or development) is much more than just coding.
- Ekaros 5y agoIsn't software engineering pretty much ifs and loops too? Massively complicated ifs, and looping pretty much samething over and over again.
- 0xdada 5y agocoding is just ifs and for loops, computer science is just types, (to me) software engineering is a mix of those two
- scubbo 5y agoI like "Coding is to Software Engineering, as building a chair is to running a furniture factory". You need to know a fair amount about the former to excel at the latter - but the latter also requires project management, process and product design, collaboration, and communication skills.
- larsrc 5y agoI like the phrasing "software engineering is programming integrated over time." It involves things like rollouts, migrations, deprecations, adapting to new requirements, and designing in so a way as to make all those easier.
- astrange 5y agoThe part that does stuff is just ifs and + signs. But making a computer do stuff isn't hard; that's what they're for. The problem in software engineering is stopping it from doing the wrong things. (Hot take: the way we do this is wrong; we should be adding superpowerful not-doing-stuff features to languages, vs doing-stuff features.)
- kevmo 5y agogit is just a graph, man
- hprotagonist 5y agoit's a chain. of blocks... hmmm.
- GhettoComputers 5y agoGithub is just programmer Wordpress.
- Moodles 5y agoI think it's funny that it's kind of like a blockchain, and as soon as the business people and MBAs realize this, they're going to "evangelize this amazing application of blockchain to all code!" to death.
- kwertyoowiyop 5y agoSo Bitcoin is just Git with extra steps!
- makach 5y agoThing with loops, they are complicated. Like infinity. I remember when someone taught me about multiple infinities. It is wonderful!
- klyrs 5y agoUGH. Back in my day the only language was BASIC and we only had IF and GOTO. Dijkstra has made these children SOFT and I'd piss on his grave if I could be arsed to get out of my rocking chair.
- egypturnash 5y agoWhat version of Basic were you using that lacked FOR? Even the shitty one crammed into my Sinclair ZX80 had FOR.
- klyrs 5y agoOh, I can't say that it didn't. But I was only 7, and more amused by things like 10 PRINT "POOP" 20 GOTO 10 than, what, reading a non-existant manual? My parents weren't programmers, so I learned by stumbling in the dark. But, you've got me curious. I recall using BASICA, GWBASIC and QBASIC -- reading over their respective histories, I'd have gotten my start on BASICA on a hand-me-down 286. I'm not finding good docs on the language, but a familiar program [1] uses FOR loops -- so they were supported. But I distinctly recall hand-rolling a for-equivalent loop with GOTO and IF, counting down to zero. [1] https://web.archive.org/web/20130918210121/http://www.codinghorror.com/blog/files/donkey.bas.txt https://web.archive.org/web/20130918210121/http://www.coding...
- egypturnash 5y agoMore visually pleasing, and several keystrokes shorter, for rapid input on an unattended store demo machine: 10 print "poop ";:run FWIW, the very first version of BASIC in 1964 supported FOR (https://en.wikipedia.org/wiki/Dartmouth_BASIC#First_Edition https://en.wikipedia.org/wiki/Dartmouth_BASIC#First_Edition). I never used DOS machines but https://gunkies.org/wiki/Microsoft_BASIC https://gunkies.org/wiki/Microsoft_BASIC claims that BASICA was based on Microsoft's BASIC, and that definitely had FOR. Young you must have arrived at the concept of a for loop without knowing there was a keyword in the language designed to support that, which is pretty cool!
- smiley1437 5y agoWait till he reads about a Turing machine
- madsbuch 5y agoAll we need are functions!
- Connor_Creegan 5y agoAh, keen observation, young grasshopper! But nota bene: just as man cannot live on bread alone, one's understanding does not arrive merely from the consideration of a collection of atoms.
- hunter321 5y agoI'm one one of a small number of people at my FANNG company that can work on a legacy MM LoC Perl project. Many of them are much smarter than me, but I think my insight which I remember getting around 6 months in is that it's just code, in many places hard to read/follow, but it will ultimately just do a logical set of instructions.
- ArtWomb 5y agoSounds like the Re-birth of the "Expert System". Now with neural networks ;) Learning from Artificial Intelligence’s Previous Awakenings: The History of Expert Systems https://ojs.aaai.org/index.php/aimagazine/article/view/2809 https://ojs.aaai.org/index.php/aimagazine/article/view/2809
- xwdv 5y agoNo, coding is just converting some data into other forms of data.
- hirundo 5y agoI once told a girlfriend that's what I did. It worked, she wasn't impressed with my job at all after that.
- Tade0 5y agoIn the eyes of an 85 year old Italian woman I was a "writer"(or perhaps just "typist" - something could have been lost in translation). Fair enough.
- ljm 5y ago10 years on and I'm still converting relational data into HTML or JSON
- CoastalCoder 5y agoI kinda want to give you a hug and say it's all gonna be okay...
- gameswithgo 5y agoI had a brief time in my career where we used a database that you would query and it just returned the html. It was amazing.
- pstuart 5y agoWe're data plumbers
- djangelic 5y agoRouting shit around the world…
- ncmncm 5y ago
- porknubbins 5y agoAnd really, aren't loops just ifs and jumps under the hood? So coding is just ifs
- qsort 5y agoIndeed. Jump on zero and integer manipulation are sufficient for turing-completeness. For example: https://en.wikipedia.org/wiki/Counter_machine https://en.wikipedia.org/wiki/Counter_machine
- MaulingMonkey 5y agoAll you really need is `mov`. https://github.com/xoreaxeaxeax/movfuscator https://github.com/xoreaxeaxeax/movfuscator https://www.youtube.com/watch?v=R7EEoWg6Ekk https://www.youtube.com/watch?v=R7EEoWg6Ekk
- deleted 5y ago[deleted]
- qsort 5y agoSUBLEQ :) https://en.wikipedia.org/wiki/One-instruction_set_computer https://en.wikipedia.org/wiki/One-instruction_set_computer
- Sharlin 5y agoIt’s a pretty fun and enlightening exercise to sit down and work out how you’d implement all the usual instructions when all you have is Subtract And Branch If Negative.
- tromp 5y agoλx. x S K https://en.wikipedia.org/wiki/Combinatory_logic#One-point_basis https://en.wikipedia.org/wiki/Combinatory_logic#One-point_ba...
- outadoc 5y agoAll you need is `mov` `mov` `mov` is all you need.
- smoldesu 5y agoI wish I could have a son who understands Turing completeness without being explicitly told... I guess that's the power of the Carmack bloodline.
- Gualdrapo 5y agoI really wish it was as simple as that.
- newsbinator 5y agoHumans are basically just ifs and for loops
- GhettoComputers 5y agoWith quantum irrationality and self induced sleep deprivation!
- faeyanpiraat 5y agoAt least 5 ifs
- adolph 5y agoWhys?
- abdulhaq 5y agoThe masses are just loops. The mindful are gets and loops. The ruling class are gets, sets, and loops. The elite are ifs, gets, sets, and loops.
- ncann 5y agoThat first reply is so funny to me because it hits too close to home https://twitter.com/nice_byte/status/1466940940229046273 https://twitter.com/nice_byte/status/1466940940229046273 The more I do this, the more I gravitate towards the simple things.
- bsder 5y agoThe more experience you have, the more you see through the code to what is underneath. "...there's way too much information to decode the Matrix. You get used to it, though. Your brain does the translating. I don't even see the code."
- feoren 5y agoThe 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.
- deleted 5y ago[deleted]
- cs702 5y agoThat image[a] is so funny because it is so true: Anyone who has ever written any software has felt like the unenlighted half-person in the middle of that distribution at least once -- for example, when learning how to code with a different approach in a new language. I have felt like that more than once. Everyone here has, I suspect. -- [a] https://twitter.com/nice_byte/status/1466940940229046273/photo/1 https://twitter.com/nice_byte/status/1466940940229046273/pho...
- reikonomusha 5y agoDespite 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, nested, imperative conditionals with for-loops that are off-by-1.) I have no beef with if+for, but a large part of the reason they're "goto tools", if you will, is because industry is slow to assimilate many state-of-the-art ideas, sometimes by as much as 40 years. Simpler building blocks does not necessarily mean simpler solution. If only! [0] https://en.m.wiktionary.org/wiki/ha_ha_only_serious https://en.m.wiktionary.org/wiki/ha_ha_only_serious
- deleted 5y ago[deleted]
- nomemory 5y agoCoding is just electrons having fun.
- redis_mlc 5y agoThere's no limit to how hard HN will fellate pg and Carmack.
- deleted 5y ago[deleted]
- brightball 5y agoQuite literally how I explain coding to people. It’s basically that, plus resource management.
- waltbosz 5y agoI describe coding as similar to game of chess, in that it requires you to think several moves in advanced. Both involve filling up your mental stack.
- Apocryphon 5y agoIt’s just 0’s and 1’s, baby
- disambiguation 5y agoalso "coding is basically over glorified plumbing". ~ my cynical coworkers
- throwaway984393 5y agoand ops is custodial engineering for software. we mop up what leaks out after the plumbers are done
- kwertyoowiyop 5y agoAnd thank goodness that it IS glorified!
- deleted 5y ago[deleted]
- thom 5y agoAdd in some form of mutability and you’ve got yourself a Turing machine, yes.
- karlshea 5y agoI also like "all web development is basically fancy string concatenation", and as a web dev I feel seen.
- freemint 5y agoand file access
- Forge36 5y agoPretty much. Many frameworks exist to make it safe.
- jspash 5y agoIt's almost like "a series of tubes" that do nothing more than squirt text around.
- kibblesalad 5y ago"U+1F346 is an eggplant" and other oddities from the tubes we build modern society on
- mwcampbell 5y agoIt may optimize down to string concatenation, or better yet streaming output, but you really shouldn't be doing that concatenation directly. https://glyph.twistedmatrix.com/2008/06/data-in-garbage-out.html https://glyph.twistedmatrix.com/2008/06/data-in-garbage-out....
- hnarn 5y agoGeorge 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 spiced up of course, but there's a kernel of truth to it.
- 5y ago
- micromacrofoot 5y agoyou guys have for loops?
- progre 5y agoWe used to have. Now we mostly chain map-functions. But there are those rare instances where we don't operate on iterables and still need to do something many times. I've seen people so weirded out by this that they prefer to generate an iterable to work on a rather than to use a for-loop.
- austinl 5y agoThis 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 5y ago[deleted]
- ww520 5y agoAmateur. We do branchless coding and unroll every loop here.
- GhettoComputers 5y agoComputers are just thinking rocks.
- hprotagonist 5y ago> When we write programs that "learn", it turns out that we do and they don't.
- GhettoComputers 5y agoProgrammers are just linguists that use and make artificial languages, like Esperanto!
- raverbashing 5y agoAnd print. Don't forget print
- marsven_422 5y agoAll programs are by definition a combination of sequence ,selection and itteration.
- mftb 5y agoThis is the most insightful thing I've ever seen on Twitter.
- sharperguy 5y agoAnd c++ is basically just c with classes.
- faizshah 5y agoOne time I told someone I work on web apps and they said “oh that’s just html and css that’s easy.”
- adventured 5y agoIt's nice to learn so much about someone so quickly.
- alsadi 5y agoComputers are just infinite tape marked out into squares... (Turing machine). A pyramid is just a stack of cubic rocks.
- GhettoComputers 5y agoThe earth is just a ball of mud
- Cycl0ps 5y agoIt's a ball bearing covered in dust
- mirekrusin 5y agoIt's just 0s and 1s, really.
- danielodievich 5y agoI 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 "a-ha" 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 "ifs and loops" statement.
- 123pie123 5y agomy professor at uni always said that machine code is just 1's and 0's and if you can count to one you can understand computers (with a smile on his face and shrugging his shoulders)
- eecc 5y agoThere’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.
- bryik 5y agoProbably not the right one, but "The Evolution of a Haskell Programmer"[0] sounds like a similar idea which goes from a Freshman Haskell programmer's simple factorial to the abstract heights of a Post-doc Haskell programmer, then back down to a Tenured professor's simple factorial. 0 - http://www.willamette.edu/~fruehr/haskell/evolution.html http://www.willamette.edu/~fruehr/haskell/evolution.html?
- arketyp 5y agoA Turing machine is basically just ifs in a loop.
- progre 5y agofor-switch, the weird uncle of the turing machine family.
- ravenstine 5y agoIf you want to go even lower than that, coding is basically just saying yes or no in response to a yes or a no. Sure, that's oversimplifying it, but that's the smallest unit of information being changed during computation. But yes, once you learn the basics that are shared between most programming languages and don't get distracted by the nuances, it doesn't take that long to pick up a different language. Being proficient is of course another question, but achieving a basic understanding shouldn't take all that long when you just focus on how to if-else, how to setup loops, and how to assign variables.
- ojr 5y agoyes, at the lowest level its binary code, 0 and 1
- dane-pgp 5y agoI like to think of myself, actually, as not a code writer, but an author. I just use zeros and ones instead of words 'cause words will let you down.
- bonestamp2 5y agoI like that. Someone on my team referred to us as (data) plumbers and I thought that was a pretty fitting analogy too.
- Lwepz 5y agoFree Guy(2021) https://www.imdb.com/title/tt6264654/ https://www.imdb.com/title/tt6264654/
- koheripbal 5y agoAll chemistry is just sharing electrons.
- carbonguy 5y agoWell, it's more complicated than that - you see, occasionally the electrons are not shared, but given up entirely.
- sva_ 5y agoAll life is just cytosine, guanine, adenine, and thymine.
- krapp 5y agoEverything, everywhere is just entropy.
- matheusmoreira 5y agoThose 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.
- sva_ 5y agoUmm.. what are those codons and other proteins made of? ...
- kaba0 5y agoCodon is just a triplet of nucleotides. But proteins are made out of amino acids, they have “nothing” to do with DNA in itself. It just happens that DNA transcoded by a codon table to proteins encode some useful ones that in certain environments can bootstrap the whole process and do some useful work.
- IX-103 5y agoCodons are an (effectively arbitrary) grouping of 3 consecutive nucleic acid bases that ribosomes can translate into a amino acid when building a protein. Technically any combination of 3 consecutive bases could be considered a codon, however biologists usually only group base pairs based on how they are normally read by a ribosome. Note that this means it is possible for a single sequence of nucleic acids to code for multiple proteins, with the only difference being the starting offset. Proteins are made of amino acids not nucleic acids. Nucleic acids are polymers whose elements contain a phosphorus group. Amino acids contain an nitrogen group (an amino group to be specific).
- 5y ago
- karmakaze 5y agoThe way I interpret this is that the 'just ifs and for loops' is like Matrix rain code. In the beginning it looks like gibberish scrolling down the screen. When you master it, it's still gibberish scrolling down the screen, but it's simultaneously something else on another level as well. 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.
- nestorD 5y agoAnd datastructures.
- mandeepj 5y ago“coding is basically just ifs and for loops.” Maybe, he knows only that much, yet
- notacoward 5y agoUntil you get to network programming, then it's "just open a socket"
- makach 5y agohaha, it is! it is a wonderful experience when you make that realization. That's the point with programming. Easy to learn. Difficult to master.
- larsrc 5y agoBuilding a house is just lumber and nails.
- gopher_space 5y agoIt really is. Everything complicated is either an interface or handling some edge case. Sound familiar?
- fennecfoxen 5y agoIfs 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. ;)
- wly_cdgr 5y agoActually coding is just literary translation into a language spoken only by pedantic idiot savants That's why it's pedantic idiot savants who tend to be the best coders
- revskill 5y agoUntil he finds out about Promise.then chain. So, programming is basically just ifs, for loop and then.
- HerrMonnezza 5y agoWell, quite: if you add that code must run sequentially it's the Boehm-Jacopini theorem: https://en.wikipedia.org/wiki/Structured_program_theorem https://en.wikipedia.org/wiki/Structured_program_theorem
- rackjack 5y agoPure functional programming languages take this a step further and say everything is just composition. (From my understanding)
- elviejo 5y ago"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 the right way to punch is the only way so it's only a punch again. So coding it'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.
- okareaman 5y agoI 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.
- DrAwdeOccarim 5y agoReminds me of biological metabolic systems. All loops and branches…
- ellimilial 5y agoWith a lot of fuzziness, some state and temporal stuff.
- DrAwdeOccarim 5y agoYea, the fuzziness comes from protons shuttling about, tunneling around, electrons moving in cycles with phosphates. It's all just vibrating, bumping and bumbling about. I remember how blown my mind was when I first learned that all reactions catalyzed by enzymes would have happened anyway given enough time and the enzymes just tune the systems to work in concert in a time frame conducive to life.
- okareaman 5y ago
- gorgoiler 5y agoAhem, and math in between. Quite a lot of it. Calculating the square root of a number is ifs and loops but wouldn’t be much fun without the math.
- tintor 5y ago"construction is basically just concrete and steel" :)
- otikik 5y agoFor loops are basically ifs and gotos.
- whalesalad 5y agoAnd functional programming is just algebra. Ez Pz.
- JasonFruit 5y agoYeah, it's just branching and iteration. The kid's right.
- CyberRabbi 5y ago“that happened” stories by egotistical parents who need to log off Twitter for their own mental health’s sake now make the top of HN
- mcguire 5y agoAnd assignments.
- webZero 5y agoThats 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 these days. 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. Here are some of the practices they followed * No indexes on tables, not even unique * No DRY, NO KISS * Switching to new shiny framework/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
- deleted 5y ago[deleted]
- hnarn 5y agoI think there's a general lesson to be learned here, which is that you should be wary of any colleague within any branch of IT that honestly claims the things you're working on are "simple". I'll take an insecure colleague that wants to do a good job over a confident colleague that refuses to listen any day. Writing code that works is simple. Writing code that doesn't break is not simple.
- dan-robertson 5y agoIsn’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.
- webZero 5y agoI was brought into to work on a 2 years old project built by junior devs and interns. Companies thought they were saving money and devs thought they were born coders so no to read a book on software architecture/engineering and hence i had to deal with the big pile of ....
- black_13 5y agoAnd ppl nagging you. No clueless ppl nagging you with things like jira and idiots like jeff sutherland.
- shireboy 5y agoIt’s all just strings. Make the right strings happen in the right place and the computer does things.
- irrational 5y agoReminds 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.
- tluyben2 5y agoSomewhere in the 90s a colleague asked about why those pesky types we had to use while we had void *. We fought, I won. (but somehow we still ended up with Javascript 20 years later)
- Sniffnoy 5y agoCoding is basically just ifs and while loops.
- dehrmann 5y agoHis mind will be blown to lean it all runs on protons, neutron, and electrons.
- astrange 5y agoThere's 57 elementary particles in the Standard Model.
- richardmichelli 5y agoI dont understand why theres a trend against functional programming. I started as a mechanical engineer and became a manager. I think I know a bit better than code monkeys.
- bob332 5y agoMoronic nonsense clear to anyone who has ever seen an enterprise spaghetti code joke
- gnuvince 5y agoIn my twenties, I wanted to use all the cool PL techniques: meta-programming, reflection, monads, macros, type-level programming, etc. I'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.
- jollybean 5y agoYes. The 'paradigms' have seriously diminishing marginal returns. Super basic imperative typed language with maybe some kind of nice way of handling nulls and that doesn't use pointers ... is most of what we need. Everything is very expensive optimization.
- throwamon 5y agoSo I hear you want Clojure.
- efnx 5y agoOr, coding is basically just folds and filters.
- ChrisArchitect 5y agoWhile Carmack is law, don't think this was worth a share here, as it was just a cute thing a young kid said? Only slight jokey whatever
- mslot 5y agoGood code explains the problem to the reader and implements the solution as a side effect. You can often express the problem quite well using a combination of if, for, comments, variable names, function names, list/set and map data structures. Sometimes (<10%) you encounter a problem that's interesting enough to define a custom type, and sometimes you make tree data structure out of it (<1%). On very rare occasions (<0.1%), you need a more complex data structure. 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). Coding is basically just writing for humans in a language a computer can execute.
- deleted 5y ago[deleted]
- pyuser583 5y agoThen what the fuck is a monad?!? 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.
- peterburkimsher 5y agoI don't understand monads either. They look like concise programming for mathematicians, which in my opinion, is tending towards set theory notation. https://xkcd.com/2545/ https://xkcd.com/2545/ Personally I prefer more names, more XML tags, more comments, more parables, more hyperlinks, more different ways of expressing the same thing, to make it less ambiguous and easier to communicate and agree what we're all talking about.
- deleted 5y ago[deleted]
- AmpsterMan 5y agoA monad is just a monoid in the category of endofunctors... duh!
- astrange 5y agoIt's not "the" monoid in the category of endofunctors though, just "a" monoid. That also describes Applicative (less powerful) and Arrow (more powerful).
- pyuser583 5y agoA monad is like when your cat poops on the carpet, so you wrap your cat in toilet paper. Then your cat has kittens, and the kittens are born with toilet paper wrapped around them! No here’s a better explanation: A monad is like when you have a clock, but it’s broken and goes too fast. So you rewind it, and the next morning you wake up and it’s 5000 BC. Or here’s a better explanation: A monad is like when Donald Trump won the election, and then stacked the Supreme Court, and now we’re totally fucked! That’s it! That’s exactly what a monad is!
- tonyedgecombe 5y ago
- TheOtherHobbes 5y agoWild stab in the dark here, but for some applications it's possible you may need assignments too.
- H8crilA 5y agoJust 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'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. Also, you can easily see that something is fishy because all such code must terminate (where's the halting problem here?) https://en.m.wikipedia.org/wiki/Primitive_recursive_function https://en.m.wikipedia.org/wiki/Primitive_recursive_function Otherwise I completely agree with the aphorism.
- coliveira 5y agoIn fact it is just ifs and jumps. Loops are a higher level construct.
- ir193 5y agojoke aside. we know a language is Turing-incomplete if it has only ifs and bounded for loops. And if 90% programmers' tasks can be done using a Turing-incomplete language, is there any benifits we can get from this?
- astrange 5y agofor loops aren't bounded though; that's for...in loops. for loops you write your own stopping condition, which was probably a mistake.
- lngnmn2 5y agoLol 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. Almost no one nowadays possess these skills. I we have is node_modules crap and J2EE-like design bullshit. This like saying that poetry is just words and commas. But he is just a kid, I know. ;)
- steele 5y agoOk
- aiisjustanif 5y agoHey I found a post about my username.
- andrew_ 5y agohttp://www.bash.org/?7717 http://www.bash.org/?7717
- foxhop 5y agoIt's not about the code, it's always been about the data over spacetime. You have a data problem, not a code problem.
- Yuioup 5y agoYeah, but a master of coding uses a lot of Mathematics, like his dad does :-)
- chrismcb 5y agoWell it is ifs and loops and assignments. Kind of not useful without the assignments.
- vegai_ 5y agoGastronomy is just fat, sugar and protein.
- devoutsalsa 5y agoAnd alcohol!
- lolive 5y agoAnd types.
- amai 5y agoCoding is basically just zeros and ones.
- kai10k 5y agojust when you think it is, concurrency is a whole new level
- alok-g 5y agoLiving is just moving stuff around based on the stimulus received. :-)
- y3sh 5y agowith input, output, and rw to arbitrary memory.. then I think that just about satisfies turing completeness