365 Days of Hello World

A place to discuss the implementation and style of computer programs.

Moderators: phlip, Moderators General, Prelates

Two9A
Posts: 194
Joined: Sat Jul 26, 2008 11:22 pm UTC
Location: The smogbound wastes of northern England
Contact:

365 Days of Hello World

Postby Two9A » Thu Jul 30, 2009 5:06 pm UTC

#xkcd introduced an interesting idea to me: write a program once a day that prints out "Hello World!", for a year. Caveats:

  • The programs can't all be the same; they must be substantially different either in algorithm or language.
  • Obfuscation is fine, in accordance with the first item (try not to just obfuscate your entry from last week).
This is self-enforcing more than anything; if you were to write the exact same Python program every day for a year, I doubt anyone would mind. The current medium of exchange is Twitter, I'm afraid (sorry about that); messages tagged #365helloworld.

I've put up my day 1; anyone else?
The Unofficial "Making xkcd Slightly Worse" Archive [Incomplete]: xkcdsw.com
Articles that fall out of my head about once a month: imrannazar.com

User avatar
tetsujin
Posts: 426
Joined: Thu Nov 15, 2007 8:34 pm UTC
Location: Massachusetts
Contact:

Re: 365 Days of Hello World

Postby tetsujin » Thu Jul 30, 2009 5:41 pm UTC

Can't help but feel that it's just a waste of time. You could probably spend the same amount of time every day working on a real project and have something worth running at the end of the year...

Years slip by too easily. At some point one comes to the realization that the number of them one can reasonably expect to experience is actually rather limited.

(EDIT): Alternately, use the time to read Knuth and implement all the algorithms and data structures he describes...
Last edited by tetsujin on Thu Jul 30, 2009 6:21 pm UTC, edited 1 time in total.
---GEC
I want to create a truly new command-line shell for Unix.
Anybody want to place bets on whether I ever get any code written?

User avatar
Area Man
Posts: 256
Joined: Thu Dec 25, 2008 8:08 pm UTC
Location: Local

Re: 365 Days of Hello World

Postby Area Man » Thu Jul 30, 2009 6:16 pm UTC

^ what tetsujin said.
I don't know how it came up in the chat, but I can't help but feel this is one of those "how do you keep a moron busy for a year" pranks.


...No offense. :D
Bisquick boxes are a dead medium.

Two9A
Posts: 194
Joined: Sat Jul 26, 2008 11:22 pm UTC
Location: The smogbound wastes of northern England
Contact:

Re: 365 Days of Hello World

Postby Two9A » Thu Jul 30, 2009 6:20 pm UTC

I'd be willing to class it as that, but it's maybe a few minutes a day. I'm hoping I can investigate some silly obfuscation ideas, and some obscure languages, by putting this together over the course of a year.

Of course, I could just spend all the days in C, writing increasingly crazy #define mappings; sounds fun.
The Unofficial "Making xkcd Slightly Worse" Archive [Incomplete]: xkcdsw.com
Articles that fall out of my head about once a month: imrannazar.com

User avatar
Qoppa
Posts: 694
Joined: Sat Nov 24, 2007 9:32 pm UTC
Location: Yes.

Re: 365 Days of Hello World

Postby Qoppa » Thu Jul 30, 2009 7:11 pm UTC

#define obfuscation is largely uninteresting since most editors have a find and replace feature.

Code: Select all

_=0,w=-1,(*t)(int,int);a()??<char*p="[gd\
~/d~/\\b\x7F\177l*~/~djal{x}h!\005h";(++w
<033)?(putchar((*t)(w??(p:>,w?_:0XD)),a()
):0;%>O(x,l)??<_='['/7;{return!(x%(_-11))
?x??'l:x^(1+ ++l);}??>main(){t=&O;w=a();}

User avatar
tetsujin
Posts: 426
Joined: Thu Nov 15, 2007 8:34 pm UTC
Location: Massachusetts
Contact:

Re: 365 Days of Hello World

Postby tetsujin » Thu Jul 30, 2009 7:45 pm UTC

Two9A wrote:I'd be willing to class it as that, but it's maybe a few minutes a day. I'm hoping I can investigate some silly obfuscation ideas, and some obscure languages, by putting this together over the course of a year.


Meh...

How much would you learn about Haskell, for instance, from this? (Assuming for the moment you don't know Haskell) What does this:

Code: Select all

main = do
    print "Hello, World!"


teach you about what makes Haskell a unique and expressively powerful language? A program like that doesn't even come close to the real meat of the language. Haskell is an extreme case, of course, because the language is aligned in the direction of functional programming, and yet builds its way back toward imperative-style programming with monads... But really the same is true of almost any programming language - the "Hello World" exercise doesn't give you any kind of idea of how problems are solved in the language.

Now, in something like Brainfuck, a program like "Hello World!" actually is a somewhat educational experience - but only because Brainfuck is so obtuse that any trivial program would put a newbie knee-deep in new concepts. As problems go, "Hello World" doesn't have enough meat on it to make an interesting exercise unless you (or your tools) go out of your way to make the problem more complicated.

The point I'm trying to make is the committing yourself to doing a certain thing every day is great - even if it's not a lot of time per day the fact that you commit yourself to doing this every day sets you apart from the vast majority of people who are happy just to p[ai]ss the time away. But I really strongly believe that spending that time exploring permutations and obfuscations of a trivial problem is just a complete waste. There's so many other things you could accomplish with even just a minimal daily commitment... Things that could be awesome...
---GEC
I want to create a truly new command-line shell for Unix.
Anybody want to place bets on whether I ever get any code written?


Return to “Coding”

Who is online

Users browsing this forum: wurlitzer153 and 9 guests