Hello World, 1978(artsy.net)
artsy.net
Hello World, 1978
https://www.artsy.net/artwork/brian-kernighan-hello-world
8 comments
I'm glad Brian Kernighan has as much trouble writing braces by hand as us mere mortals do.
The trick to writing braces is this - for a { write a 5 than a 2 below and for a } write a 2 then a 5 below. Practice it a little and you will be writing perfect braces in no time.
Also it is quite amusing how many people love this trick when I tell them after they have spent a decade or more struggling.
Also it is quite amusing how many people love this trick when I tell them after they have spent a decade or more struggling.
For posterity, he could have also made a print of his "Hello, World" program written in B from 1972:
https://code.google.com/p/go/source/browse/src/pkg/debug/mac...
https://code.google.com/p/go/source/browse/src/pkg/debug/mac...
Just curious - does anyone know how much it went for?
Tweet here saying >$7,000: https://twitter.com/zarkadakis/status/582594530135924736
Random reddit comment saying $8,500: https://www.reddit.com/r/programming/comments/2zluh1/brian_k...
Random reddit comment saying $8,500: https://www.reddit.com/r/programming/comments/2zluh1/brian_k...
I would love to know who bought it. I just want to know if i can take a screenshot and use it for a class site. I guess I can argue fair use...I love that it's described as an algorithm, because it is...and most non programmers don't realize that because of their complicated preconceptions.
Not that I'm an expert. I learned C but I don't think we used his book. Or if we did, I wish the instructor would have emphasized the opening statement a lot more:
> "The only way to learn a new programming language is by writing programs in it. The first program to write is the same for all languages:
> Print the words
What a beautiful and complete way to put it. I do hello world out of grudging habit (aka this better f--king work or I'm going to scream)...but I don't think ever appreciated its implications. I imagine it's even harder to do so today as people are more and more removed from basic computing.
I also love his addendum in the wrist statement https://www.artsy.net/article/ruse-laboratories-brian-kernig...
> In hindsight, life is rather more complicated, but this is still a good first step, and "hello world" has taken on a life of its own as the standard first example for programming textboo
Not that I'm an expert. I learned C but I don't think we used his book. Or if we did, I wish the instructor would have emphasized the opening statement a lot more:
> "The only way to learn a new programming language is by writing programs in it. The first program to write is the same for all languages:
> Print the words
hello, world
> This is the basic hurdle; to leap over it you have to be able to create the program text somewhere, compile it successfully, load it, run it, and find out where your output went. With these mechanical details mastered, everything else is comparatively easy."What a beautiful and complete way to put it. I do hello world out of grudging habit (aka this better f--king work or I'm going to scream)...but I don't think ever appreciated its implications. I imagine it's even harder to do so today as people are more and more removed from basic computing.
I also love his addendum in the wrist statement https://www.artsy.net/article/ruse-laboratories-brian-kernig...
> In hindsight, life is rather more complicated, but this is still a good first step, and "hello world" has taken on a life of its own as the standard first example for programming textboo
"Please note: this lot includes a code license"
For a fragment shorter than a tweet. It's a stretch IMO.
For a fragment shorter than a tweet. It's a stretch IMO.
Also: "This lot also includes a commemorative 3D-printed Babylonian styled tablet containing the password to a private Github repository where the buyer may access the full source of the Hello World algorithm and an image of the lot."
It seems that he forgot to include stdio.h.
There were no function prototypes in K&R C, these were added in the ANSI C89 standard.
Even now, prototypes are optional in C (as opposed to C++), so this program is still valid, although it's likely to trigger some compiler warnings.
Even now, prototypes are optional in C (as opposed to C++), so this program is still valid, although it's likely to trigger some compiler warnings.
In 1978 you didn't have to include it; the compiler made assumptions about the function args and return type that held for printf.
C was... different then.
C was... different then.
C was a lineal descendant of B, a language in which every variable had the same type: machine word. It was meant to be a step up (one step) from a macro assembler.
The existence of B always makes me laugh when someone claims Python is typeless. No, Python knows the difference between a string and a float, it just knows it at runtime. B, where everything is a machine word, and integers, floats, and pointers are all the same thing at the language level, is typeless.
The existence of B always makes me laugh when someone claims Python is typeless. No, Python knows the difference between a string and a float, it just knows it at runtime. B, where everything is a machine word, and integers, floats, and pointers are all the same thing at the language level, is typeless.
Excellent alignment of braces. Also, he appears to be using a 3-space indent, but that's not so obvious due to proportional font.
One thing that has bothered me is that open brace { for functions starts at new line but for all other statements it starts on same line in K&R style. Why not just be consistent?
Because for some people it looks better that way. For simple statements, I often find placing braces on their own lines introduces too much of free space. With a few things nested it often looks as if there were more braces than the code itself. And also, I like to group some statements together (by not having free space between them) and suddenly having to separate them by a free-standing brace breaks it. Of course all of this is just a matter of taste.
> This lot also includes a commemorative 3D-printed Babylonian styled tablet containing the password to a private Github repository where the buyer may access the full source of the Hello World algorithm and an image of the lot.
Too bad it's private. It would suck to have to rethink that algorithm from scratch...
Too bad it's private. It would suck to have to rethink that algorithm from scratch...