‹ BackHN Continuity

Thread

Ten lines of code that changed my world

148 points · 46 comments · dimonomid

  1. dahart · · focus · HN ↗
    The BASIC print+goto loop might have been my first ever program too (in the 80s) but one thing for sure for me: it was definitely not “Hello, World”. I and others filled the screen with any number of silly things, random words, jokes and juvenile phrases, whatever, but for some reason, “Hello, World!” was a C thing, and I remember seeing it for the first time in a C class in high school, and then much more often in college.

    I have memories of ‘poke’ as well. On the Atari 800 you could poke memory to change the keystroke repeat rate and delay before repeat started, so obviously we would turn down the delay to zero and turn up the repeat to max (it was maybe 60 characters per second), so anyone trying to type couldn’t hit the keys quickly enough to avoid repeating. You’d have to power-cycle the machine to fix it, so it was hilarious to 11 year old me.

    Similar to his description of ‘poke’, but different mechanism - using debug.com on an IBM PC jr to edit the Ultimate III save files, and give myself maximum money and lives.

    Good times!

    1. dgacmu · · focus · HN ↗
      Most definitely the juvenile phrases.

      I think my second BASIC program was the "guess a number" one -- that seemed really popular in intro basic programming things in the 80s also since it showed keyboard input and conditionals and was, uh, fun-adjacent.

    2. mcherm · · focus · HN ↗
      The reason that "Hello, World" is a C thing is that C is the source of the tradition around that phrase. In Kernighan and Richie's "The C Programming Language" printing "Hello, World" is the very first exercise.
      1. gabrielsroka · · focus · HN ↗
        It&#x27;s actually a B thing <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=27048024">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=27048024
        1. bojan · · focus · HN ↗
          Interestingly enough, in the linked text, B is referred as a &quot;language&quot;, follow by &quot;the generated code is quite good&quot;, presumably referring to the resulting Assembly code.
        2. NetMageSCW · · focus · HN ↗
          I disagree as that doesn’t introduce using the B environment with a Hello, world program which is the whole point. After K&amp;R it was the canonical first program.
          1. guelo · · focus · HN ↗
            Pulling my copy of K&amp;R from the shelf, it introduces the hello world program with

              The first program to write is the same for all languages:
                Print the words   
                hello, world
            
            Suggesting that this was already an established tradition when the book was written in 1978
    3. andsoitis · · focus · HN ↗
      Concur. Us hackers who got started with BASIC had a more fun and creative ethos.
    4. codazoda · · focus · HN ↗
      I have been building BASIC32, a ROM BASIC like the ones I grew up with.

      The first one runs on an ESP32 that I plan to use as a watch. The software works, I just need to finish the 3D printed case.

      The second runs on an RP2350 connected to my living room TV via an HDMI cord.

      I have so much appreciation for these old machines I grew up with.

          BASIC32
          
          Ready.
    5. yencabulator · · focus · HN ↗
      In C, the classic hello world example gets to demonstrate compilation and defining functions. In BASIC, `10 print &quot;Hello, world&quot;` does neither, so it&#x27;s not a very interesting storytelling step. Hence, the introductory materials for the two end up chunked differently.
    6. chihuahua · · focus · HN ↗
      I started with

        10 FOR I = 1 TO 10
        20 PRINT I, SQRT(I)
        30 NEXT I
      
      and struggled to type this without errors into computers in department stores. I must have read this code somewhere and needed to see it working for myself.
      1. dotancohen · · focus · HN ↗
        I remember discovering ? as a shortcut for PRINT on the C64. That was when software development as a profession really started looking like a good choice to young me.
    7. whartung · · focus · HN ↗
      In high school, my friend and I were demonstrating to Fred the magic powers of our IMSAI 8080 with ye olde:

        10 PRINT &quot;FRED IS A GEEK&quot;
        20 GOTO 10
      
      To wit my friend and I would giggle and taunt.

      Undaunted, Fred took a look around, found the power button, and turned the machine off. Yes, that power button next to the &quot;DO NOT TURN OFF&quot; sign.

      As the monitor and LEDs faded to black, the giggling stopped and my friend and I stood aghast at Fred&#x27;s treachery.

      Fred left, and we were tasked with restarting the machine, getting to the monitor, keying in the hex code of the cassette loader, and reloading BASIC from cassette.

      Got it to work on our second try!

    8. tc43 · · focus · HN ↗
      I was too young to understand why, but learning on the Commodore 64 my &quot;Hello world&quot; was always &quot;Frodo lives&quot;.
    9. animal531 · · focus · HN ↗
      On my Spectrum I came up with: 10 GOTO 20 20 GOTO 10

      It would start the Spectrum&#x27;s &quot;loading screen&quot; border which would then scroll infinitely.

      At some point I also opened it up to see what it looked like on the inside, but I managed to damage the keyboard in the process. Thereafter whenever I wanted to play a game (via joystick) I would have to use a piece of wire to manually select the rows&#x2F;columns of the matching keys to enter the load command.

Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.