• 4 Posts
  • 13 Comments
Joined 1 month ago
cake
Cake day: August 16th, 2024

help-circle

  • Bro he’ll never die. Chomsky will never die too. I’m serious. If Chomsky ‘stops living in his body’ his ideas for linguistics (not his political shit-flinging) will still be alive. When Knuth dies his programs and his algorithms and his books (especially his books) will still be alive. This is true about every single scientist or scholar. I did not even know Dijkstra was dead! He died when I was 9! But I just found it out, even though I love his works with C.A.R. Hoare, especially “Structured Programming”. I just might write a simple guide on the Hoare triple! So no scientists never die. Ken Thompson won’t die either. Bro will live in shell forever.











  • Oh I’m just a poseur! As it is my understanding, Usenet was for ‘grownup people’ (like Larry Wall, check the interview with him I just posted!) and BBS was for ‘hacker scene kids’. I started using the internet in 2005 when I was 12 (I did use it sparingly before though) and back in 2005 the ‘web-ization of the internet’ was not as pronounced as it is now, but it was strong enough that I had issues understanding where the interned ends, and the web begins! But well, it’s in the name, is it not? :D




  • Just remember that back when Knuth wrote this, there was no such thing as ‘scripting’. So if you don’t necessarily ‘program’ but ‘script’ a lot, that’s the same. With scripting, the cleverness is not in algorithms you use or stuff like that, it’s as you said, clever use of resources. I have a story to tell:

    A few hours ago my brother showed me this guy on Twitter telling people that, he’s asked people to ‘partition an array of numbers and null on null’ (in JS) and he showed his original solution, which was an iterative solution, very non-functional in style, and I kinda don’t like code that is just “too” imperative you know? Then my brother showed me someone’s solution.

    const arr = [21, 242, 1135, null, 1341, null, 2424, 11, 22, 444 ];
    // solution
    arr.join(',').split(',,').map(subarray => subarray.split(','))
    

    Golfing like this is exactly what would make Knuth cry! I wish people understood that golfing is not very readable! But understanding why this happens is what makes you more endearing, to me at least! This happens because of Javascript’s orthogonality, a remnant of Smalltalk-80 being retrofitted into a prototype-based system! Also, this is because ECMA-262 has specified ‘join’ to ignore ‘null’. Because ‘null’ is not a prototype, it’s baked into the grammar! It has no way to respond to ‘join’ so it gets left out! This is because of how Smalltalk-80-based languages are just “always communicating”. “null” is part of grammar, it does not communicate, so it gets left out.

    Now, knowing that, this code looks more beautiful right?