News for hackers. Stuff that matters.
Re:Hello World, 1978 by oneeyedpigeon on Monday January 04, 2016 @10:29AM (#10836056)
I'm glad Brian Kernighan has as much trouble writing braces by hand as us mere mortals do.
Re:Hello World, 1978 by kozukumi on Monday January 04, 2016 @11:44AM (#10836570)
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.

Re:Hello World, 1978 by AdmiralAsshat on Monday January 04, 2016 @09:31AM (#10835762)
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...

Re:Hello World, 1978 by davidjhall on Monday January 04, 2016 @09:58AM (#10835878)
Just curious - does anyone know how much it went for?
Re:Hello World, 1978 by MarcusP on Monday January 04, 2016 @10:20AM (#10836004)
Re:Hello World, 1978 by danso on Monday January 04, 2016 @10:22AM (#10836011)
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

        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

Re:Hello World, 1978 by yarrel on Monday January 04, 2016 @12:07PM (#10836735)
"Please note: this lot includes a code license"

For a fragment shorter than a tweet. It's a stretch IMO.

Re:Hello World, 1978 by krallja on Monday January 04, 2016 @01:36PM (#10837453)
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."
Re:Hello World, 1978 by amelius on Monday January 04, 2016 @08:01AM (#10835359)
It seems that he forgot to include stdio.h.
Re:Hello World, 1978 by tacostakohashi on Monday January 04, 2016 @08:13AM (#10835408)
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.

Re:Hello World, 1978 by cygx on Monday January 04, 2016 @09:22AM (#10835729)
Even now, prototypes are optional in C

It's been illegal in standard C since 1999.

Re:Hello World, 1978 by bitwize on Monday January 04, 2016 @08:06AM (#10835382)
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.

Re:Hello World, 1978 by cbd1984 on Monday January 04, 2016 @12:33PM (#10836946)
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.

Re:Hello World, 1978 by omoikane on Monday January 04, 2016 @12:37PM (#10836970)
Excellent alignment of braces. Also, he appears to be using a 3-space indent, but that's not so obvious due to proportional font.
Re:Hello World, 1978 by sytelus on Monday January 04, 2016 @06:43PM (#10839726)
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?
Re:Hello World, 1978 by pkolaczk on Tuesday January 05, 2016 @07:06AM (#10842780)
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.
Re:Hello World, 1978 by markild on Monday January 04, 2016 @08:02AM (#10835364)
> 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...

Re:Hello World, 1978 by pionar on Monday January 04, 2016 @08:55AM (#10835616)
Perhaps the person who won the auction will make it public? That would be a great contribution to society!!! /s
Re:Hello World, 1978 by TeMPOraL on Monday January 04, 2016 @08:58AM (#10835627)
They'll probably file a patent for it, to best advance the arts and sciences. /s