[HN Gopher] Things Unlearned
       ___________________________________________________________________
        
       Things Unlearned
        
       Author : lycopodiopsida
       Score  : 119 points
       Date   : 2021-09-30 16:18 UTC (6 hours ago)
        
 (HTM) web link (scattered-thoughts.net)
 (TXT) w3m dump (scattered-thoughts.net)
        
       | ChrisMarshallNY wrote:
       | _> It 's so easy to think that simple solutions exist. But if you
       | look at the history of ideas that actually worked, they tend to
       | only be simple from a distance. The closer you get, the more you
       | notice that the working idea is surrounding by a huge number of
       | almost identical ideas that don't work._
       | 
       | This brings to mind, two of my favorite H. L. Mencken quotes:
       | 
       |  _" There's always an easy solution to every human problem; Neat,
       | plausible and wrong."_
       | 
       |  _" The fact that I have no remedy for all the sorrows of the
       | world is no reason for my accepting yours. It simply supports the
       | strong probability that yours is a fake."_
       | 
       | He was an acerbic S.O.B.
        
         | jerf wrote:
         | Simple solutions _do_ exist... it 's just, they're simple, so
         | people solve them very quickly and nobody else even has time to
         | start processing them as a "problem".
         | 
         | If people are still arguing about something ten years later,
         | it's because it's not simple. But there's lots of stuff we
         | don't argue about, because it's solved, because it was simple.
        
           | habitue wrote:
           | Simple solutions can be really hard to find sometimes (you
           | know P != NP and all that). The thing you're talking about is
           | solutions that are simple to think of.
        
           | ChrisMarshallNY wrote:
           | That's a very good point!
        
             | jamii wrote:
             | Now I have to figure out how to fit that into the flow of
             | the article somewhere...
        
       | Scarbutt wrote:
       | Thanks for the reality slap and bucket of cold water buddy.
        
       | coyotespike wrote:
       | As a new programmer, I was also seduced by the FP hype, and
       | learned web development in ClojureScript without knowing
       | JavaScript.
       | 
       | This was a really hard way to learn, and once I finally went
       | mainstream I found that the messaging about how bad other
       | languages were was much exaggerated.
       | 
       | In general I think the ecosystem trumps the language quality, and
       | the senior developers who think otherwise generally underestimate
       | the difficulty for a junior developer of working on the bleeding
       | edge. Pragmatism over purity (while keeping enough purity-focus
       | to keep the codebase clean).
       | 
       | I also think JS is absolutely fine as a language and its warts
       | are not that hard to work around.
        
         | rimliu wrote:
         | JS may be fine, but I start do doubt the same can be said about
         | the ecosystem.
        
           | kansface wrote:
           | I really enjoy writing JS/TS - I find that eg arrow functions
           | mixed with React allow for really concise and expressive
           | solutions. You are correct about the ecosystem... maybe not
           | per se, but that supply chain attacks are hopelessly
           | intractable at the moment. How could you possibly go about
           | writing a modern SPA that notionally cares about security
           | when the third party software you must rely on is impossible
           | to verify? I would _love_ if browsers let you run JS in a
           | sand boxed mode wherein you could just pass a bundle of
           | vendored upstream software without the ability to touch the
           | window, network, global state, etc.
        
           | skinkestek wrote:
           | > JS may be fine,
           | 
           | If you compare JS (not TS, TS is fine) and PHP (I have
           | extensive experience in both) you'll find that once you go
           | beyond the syntax on the top you'll find the same flaws in
           | some form or another.
           | 
           | Yes, PHP is uglier, but that is about it.
           | 
           | > but I start do doubt the same can be said about the
           | ecosystem.
           | 
           | JS is a horrible language that works because of the tireless
           | effort of its community that has created an ecosystem so rich
           | that even JS can be programmed efficiently.
           | 
           | The ecosystem might be flawed but it is the only reason why
           | JS is usable at all.
        
         | jerf wrote:
         | I'm really tempted to write a blog post about "fake
         | functional".
         | 
         | The thing is, I really like functional. I really like Haskell.
         | But most of the things that I like about Haskell aren't present
         | when you rip things out of it willy-nilly and drop it into a
         | language not designed for those idioms. The thing I like about
         | functional programming is the fluid composition of all those
         | ideas, and just dropping "map" or "option" doesn't mean you've
         | got the fluid composition. Jamming functional paradigms into
         | languages where they don't compose like they do in Haskell is
         | just fake functional.
         | 
         | I'd much rather work with a language in the space where it
         | _does_ provide fluid composition of its concepts then jam a
         | foreign idiom into it and enter into a constant low-level war,
         | where I 'm likely going to have to roll out the Inner Platform
         | gun to try to wrangle the language into being a bad imitation
         | of another language. And that's a gun I want to be firing as a
         | last resort, not using as my primary weapon.
        
         | jmfldn wrote:
         | FP programmer here and I agree insofar as ecosystem matters a
         | lot and you want to be able to onboard juniors easily and on.
         | To that end a pure FP language is often not the best choice,
         | especially in lowering the learning curve. However it can be
         | great a choice on the right project and with the right team.
         | Overall it makes sense that we have way more JS and Go
         | programmers than Haskell or 'pure FP' Scala. JS is fine as a
         | language but so is F#, they fit different niches and different
         | contexts.
         | 
         | I love the diversity of our industry and I see having all these
         | different paradigms and languages as a massive strength. I
         | welcome them all.
        
           | daltont wrote:
           | Not something on a scale of a project, but "bowling score"
           | exercises are a lot more elegant in functional languages than
           | more procedural ones due to things like pattern matching.
        
           | coyotespike wrote:
           | I completely agree with this balanced take - it's all about
           | context and making the right tradeoffs.
        
       | ssivark wrote:
       | Here's a meta question to the author: Having been around the
       | circuit once, do they at least feel a little more humble about
       | their opinions this time around, or are they just as strong but
       | only in a different direction? :-)
       | 
       | IMHO, while the author has undoubtedly grown wiser, I think
       | there's just as much truth to their earlier opinions as the later
       | ones; the value lies in being able to disambiguate the context in
       | which each is valuable -- not so much in trading one set of
       | opinions for another. That humility, to me, is the bigger
       | takeaway.
        
         | jamii wrote:
         | It did take me a while to write this (~20 hours, I think)
         | because I kept worrying about that exact problem, and I kept
         | catching myself writing generic advice rather than concrete
         | experiences.
         | 
         | I tried as much as possible to only write things where I could
         | think of multiple concrete examples in my own experience.
        
       | zubairq wrote:
       | Hi Jamie, really nice piece of writing. I always enjoy reading
       | about your work. Zubair
        
       | nineplay wrote:
       | > It's ok to think that things have flaws or could be improved.
       | But it's a trap to believe that solutions are trivial and
       | everyone else is just too enfeebled of character to push the
       | miracle button.
       | 
       | I feel this so much. I've worked on products which many people
       | insist could be done just as well by spreadsheets. I've worked in
       | areas which people believe are overcomplicated - which they are -
       | and therefore could be replaced with something simple. It is
       | never that easy.
       | 
       | I see it all the time in other fields and I just shake my head.
       | If you ever find yourself saying "Why don't they just..?" you
       | almost certainly don't understand the problem.
        
         | burnished wrote:
         | I agree with you, but I also kind of hate that "Why don't you
         | just..?" has become so tainted, because it is a great question
         | to ask if you want to learn more about the heart of the matter.
         | What went wrong when the 'obvious' solution was tried is
         | interesting! Or, huh, just spitballing here, I suppose one
         | could rephrase it as "have you considered..?" to ask the same
         | question without the implicit assumption that the task is easy
         | and the person being asked has overlooked something/is an
         | idiot.
        
           | nineplay wrote:
           | The problem specifically is "just".
           | 
           | "Why don't they use containers instead of tarballs?" is a
           | excellent question which can help you understand a system
           | better.
           | 
           | "Why don't they just use containers instead of tarballs?"
           | strongly suggests that containers are obviously superior and
           | there must be some flaw in the system that's keeping the
           | tarballs around.
        
             | burnished wrote:
             | I think you are correct, thank you for pointing that out to
             | me.
        
             | jfrunyon wrote:
             | "Just" suggests that containers appear better for the
             | purpose at hand from the questioner's perspective.
             | 
             | Which is also suggested by the question being asked at all.
        
         | rnoorda wrote:
         | > _I see it all the time in other fields and I just shake my
         | head. If you ever find yourself saying "Why don't they just..?"
         | you almost certainly don't understand the problem._
         | 
         | A political corollary to this that I enjoy came from an old
         | professor of mine- "If your political opinions require large
         | amounts of people to be stupid or evil, you don't understand
         | the issues well enough." (A rough quote, I don't remember exact
         | phrasing.)
        
           | nineplay wrote:
           | I wish that was the banner at the top of every political
           | discussion forum. Maybe with some auto-flagging on posts
           | which can be condensed down to "everyone who disagrees with
           | me is an idiot"
           | 
           | The world would be a better place.
        
       | chubot wrote:
       | Great article, I was nodding my head with almost every point!
       | Although I think you also have to consider that the author has a
       | strong math background, which both improves and warps your view
       | of programming. If you don't know any math, then this post is
       | probably less relevant to you (e.g. learning a bit Haskell or ML
       | is probably a good idea in that case).
       | 
       | ------
       | 
       | As a nitpick about the theory of automata, I would draw a big red
       | line between regular languages and context free grammars.
       | 
       | Regular languages have very useful engineering properties: they
       | have predictable (linear) performance and give you "free"
       | lookahead. (That is, nondeterminism is a math-y idea that many
       | programmers are not comfortable with, but it's useful for
       | engineering.)
       | 
       | They are better than Perl-style regexes for building reliable and
       | understandable systems, which "blow up" on a regular basis.
       | 
       | In contrast, context-free grammars have almost no useful
       | engineering properties by themselves. (There are subsets like
       | LALR(1) that do, but they come with a bunch of tradeoffs.) As the
       | article mentions, learning about recursive descent parsing first
       | is probably more practical.
       | 
       | Also, you're MUCH more likely to encounter a regular expression
       | in real code than a context free grammar. In 15 years of
       | professional programming I probably dealt with regexes on a
       | weekly or monthly basis, but had to write or modify a grammar
       | exactly zero times. It does help to be more familiar with regexes
       | and regular languages.
       | 
       | This post/sketch elaborates on related points:
       | 
       |  _Comments on Eggex and Regular Languages_
       | http://www.oilshell.org/blog/2020/07/eggex-theory.html
        
         | meheleventyone wrote:
         | > Also, you're MUCH more likely to encounter a regular
         | expression in real code than a context free grammar. In 15
         | years of professional programming I probably dealt with regexes
         | on a weekly or monthly basis, but had to write or modify a
         | grammar exactly zero times. It does help to be more familiar
         | with regexes and regular languages.
         | 
         | This massively depends on what you're doing. I've been
         | programming for 30+ years, 16 of them professionally and not
         | gone near regular expressions beyond a general knowledge of
         | their existence and uses. Mind you the same is also true of
         | context free grammars which is something I dimly remember
         | learning about at university.
        
         | jamii wrote:
         | > If you don't know any math ... learning a bit Haskell or ML
         | is probably a good idea
         | 
         | This is very much counter to the point I was making. I didn't
         | find that learning haskell or ml was anything like learning
         | math, especially the kind of math that I've seen people get use
         | out of in day-to-day engineering, and I don't understand why
         | this idea is so persistent.
         | 
         | If you don't know any math, it might be worth learning some of
         | whatever kind of math is applicable in your field. It's
         | probably not haskell.
         | 
         | > It does help to be more familiar with regexes and regular
         | languages.
         | 
         | Regexes are certainly useful, but I don't think that learning a
         | lot about automata theory is a particularly efficient way to
         | get better at using regexes in practice, compared to eg doing a
         | bunch of drills on
         | https://www.executeprogram.com/courses/regexes
        
       | paganel wrote:
       | > Being fluent in the core language of mathematics (basic logic
       | 
       | I have been programming for a living for 15 years, I'm most
       | definitely not as good a programmer as OP is, but the least I can
       | do is double-vouch for that advice. I first heard it a little
       | over 20 years ago, at the end of my first calculus class at uni.
       | 
       | After scaring us, his students, about all the things that we will
       | have to learn during the next semester I remember the professor
       | telling us that we should be really learning what the NOT, OR and
       | AND logical operators really do and stick that piece of
       | information firmly in our heads, because that is really important
       | for our jobs. He also bitched a little about our older colleagues
       | for not remembering that stuff anymore (and causing different
       | computer bugs because of that) and I remember saying to myself:
       | "how stupid can one be in order to un-learn this stuff? It is
       | easy!".
       | 
       | Like I said, 20 years have passed since then and I found out that
       | even though it's easy lots of people seem to forget how basic
       | logic actually works when it comes to programming.
        
       | ithrow wrote:
       | _By way of counter-example, check out this ICFP contest
       | retrospective. Nikita is using clojure, a pretty niche language,
       | but has built up incredible fluency with both the language and
       | the ecosystem so that he can quickly throw out web scrapers and
       | gui editors. Whereas I wouldn 't be able to quickly solve those
       | problems in any language after flitting around from ecosystem to
       | ecosystem for 12 years._
       | 
       | The thing with niche languages like Clojure is that you can
       | leverage existing ecosystems(reducing the risk of getting stuck)
       | unlike other languages that start from scratch. Probably the same
       | for languages like F#, Kotlin and even Zig (using the C
       | ecosystem).
       | 
       | Of course, I found the article great with lots of good advice(ex:
       | I still wouldn't use Clojure if Javascript can get the job done
       | perfectly fine) so don't let this nitpick distract you or look
       | the other way ;)
        
       ___________________________________________________________________
       (page generated 2021-09-30 23:01 UTC)