7 ms·
A letter to my daughter, Augusta, in ruby
- haven 14y agoLove it! <3
- Skoofoo 14y agoVery touching :)
- knwang 14y agoamazing!
- gesman 14y agoHere's a bit shorter version of this amazing letter: puts 'Augusta, we <3 you!'
- jpfuentes2 14y agoHah! I went for over-achievement, I suppose.
- gesman 14y agoLove expressed is always amazing, no matter the number of lines!
- jpfuentes2 14y agoEspecially when it doubles as a learning exercise for your Daughter one day :)
- DanWaterworth 14y agoHere's a shorter version of love.rb: class Augusta; end def a_letter(*args, &blk) puts 'Augusta, we <3 you!' end
- matthuggins 14y agoNot quite, you'll run into various class/modules/methods not found.
- DanWaterworth 14y agoTry it.
- jpfuentes2 14y agoExcept you're missing the trap and loop : )
- smegel 14y agoThat guy who said Javascript is the new Perl has been proven wrong.
- Kyns 14y ago??
- nwmcsween 14y agoThis has nothing to due with obfuscation but the malleability of ruby itself, read the required file he made a DSL.
- frenchfries 14y agololz yup
- minikomi 14y agoNice! Reminds me of judofyr's "On Camping vs Sinatra" http://timelessrepo.com/on-camping-vs-sinatra http://timelessrepo.com/on-camping-vs-sinatra
- judofyr 14y agoI was about to say that it reminds me of the Haiku's I've been collecting: http://timelessrepo.com/haiku http://timelessrepo.com/haiku Or Tribute (that I wrote): http://timelessrepo.com/tribute http://timelessrepo.com/tribute
- powerfulninja 14y agoBeautiful
- ragsagar 14y agonice
- nicholasspencer 14y agoThis is great! Proof that code is art.
- yuchi 14y agoDon't take me wrong, but I do not think that this poem (or, as @jpfuentes states correctly, prose) can be categorized as "art". I think of it as a lovely crafted letter, written on a very unusual support. Nothing too much different from a cross-stitched handkerchief. Anyway, it's seriously touching.
- jpfuentes2 14y agoThat's what I going for. I tagged it as "Code as Art." I initially dubbed it a poem but decided it read more like a letter, instead. Personally, I think it qualifies as code prose.
- so898 14y agoSeems like the daughter will become a programmer.
- shellehs 14y agoat least know how to read ruby source code
- phodo 14y agoLoL (Lines of Love) is inversely proportional to LoC
- sethbannon 14y agoCode as poetry. Are there any other examples of this?
- reaclmbs 14y agoBlack perl - originally by Larry Wall & updated for Perl 5 by Ovid (http://www.perlmonks.org/?node_id=17000 http://www.perlmonks.org/?node_id=17000) BEFOREHAND: close door, each window & exit; wait until time. open spellbook, study, select it, confess, tell, deny; write it, print the hex while each watches, reverse "its length", write again; kill spiders, pop them, chop, split, kill them. unlink arms, shift, wait & listen (listening, wait), sort the flock (then, warn "the goats". kill "the sheep"); kill them, dump qualms, shift moralities, values aside, each one; die sheep, die, reverse system you accept (reject, respect); next step, kill next sacrifice, each sacrifice, wait, redo ritual until "all the spirits are pleased"; do it ("as they say"). do it(*everyone***must***participate***in***forbidden**s*e*x*). return last victim; package body; exit crypt (time, times & "half a time") & close it, select (quickly) & warn next victim; AFTERWORDS: tell nobody. wait, wait until time; wait until next year, next decade; sleep, sleep, die yourself and rest at last
- draegtun 14y agoSome extra references: - Black Perl updated for Perl 5 - http://www.perlmonks.org/?node_id=237465 http://www.perlmonks.org/?node_id=237465 - Black Perl Revisited - http://www.perlmonks.org/?node_id=578707 http://www.perlmonks.org/?node_id=578707 - http://en.wikipedia.org/wiki/Black_Perl http://en.wikipedia.org/wiki/Black_Perl
- gummydude 14y agoBlack perl is a real art, without hidden setup&definitions. Perlay?
- jpfuentes2 14y agoI must confess I have not seen many. I drew inspiration from Marc-André Cournoyer and his post "how to apply to a job" http://macournoyer.com/blog/2010/02/23/how-to-apply-to-a-job/ http://macournoyer.com/blog/2010/02/23/how-to-apply-to-a-job.... However, I've entertained the idea of writing code as prose for quite some time.
- shmerl 14y agoReminds me of this obfuscated C classic: http://www.ioccc.org/1990/westley.c http://www.ioccc.org/1990/westley.c If you want to compile it, replace each "1s" with "is" in the code and compile for example like this: gcc -Dis=1 westley.c -o westley (or just put is=1; in the beginning with the same substitutions). Normal compilers don't like 1s notation for short. Then run the result with some integer parameter ;)
- liberatus 14y agoYeah but the maintenance overhead on such complexity... Just wait till the teenage years! Nah, given the design decisions inspiring this codebase, I don't have any reason to believe your daughter will have any challenge extending and reusing its functionality once she's grown up. ;-)
- Shank 14y agoI really love how the second to last line rhymes in such a way that, when read with the semicolon out loud, produces a neat sound to it. "Until infinity ends do; Forever end."
- emillon 14y agoThat's cute, but most of the "magic" is hidden behind the require line. That's somewhat breaking the rules I think (compare that to Perl poetry such as the Black Perl).
- sutro 14y agoI once wrote a letter to my son in C++. We don't talk anymore.
- MattBearman 14y agoI God I hope that was meant to be a joke, if not I'm going straight to hell...
- olgeni 14y ago> if not I'm going straight to hell... ...said the future J2EE developer...
- alexkus 14y agoand you got divorce papers from your wife written in Objective-C ? (Or maybe Go?)
- ConstantineXVI 14y agoMe and a former boss a while back: Me: "When I was taking C++ back in high school-" Boss: "Dear god, what kind of high school did you go to?" Me: "A Catholic one" Boss: "Ah, that explains it" Yes, it actually was a bit of a hard-line place. Wouldn't trade it for the world though, even the C++ class (since that's where I discovered Python).
- michael_michael 14y agoSo he returned 0?
- yeison 14y agoI had to upgrade to ruby 1.9 in order to run it. Very beautiful, btw.
- tzaman 14y agoThis is the most emotional script ever I have ever seen :)
- kachhalimbu 14y agoI'm tempted to fork this, change name to my daughter's name and frame it or make a Tee. Not sure if the author would think of it as disrespectful.
- devopstom 14y agoHey, it's Open Source, right? LICENSE seems to confirm this.
- jpfuentes2 14y agoThat's why it's MIT. Please feel free!
- mattyod 14y agoA little more flippant but I wrote this version of Goldilocks in JavaScript a little while back: https://gist.github.com/3755270 https://gist.github.com/3755270
- draegtun 14y agoNice. It inspired me to spend some free time I had today doing same thing in perl 5 & 6 - https://gist.github.com/4542918 https://gist.github.com/4542918
- cupcake-unicorn 14y agoBlah, this is not a good way to get back into Ruby. I get that most of it is just fluff, but can anyone break it down a little? Really stretching the syntax.
- jpfuentes2 14y agoAre there specific pieces you don't understand? Or would you want a walkthrough?
- cupcake-unicorn 14y agoJust kind of a walk-through. I think part of it is that I can't fully force myself to read it as code when it's written poetically like that, so even syntax conventions I fully get are causing my eyes to glaze over.
- frenchfries 14y agowow how impressive. instead of using puts, you can waste hours developing a program that accepts what is supposed to be a letter (looks like bad english) and look cool on hacker news ... man people have so much time to waste, well done
- 3pt14159 14y agoDon't be a dick.
- deleted 14y ago[deleted]
- xyproto 14y ago16 months before finding time for programming again. Sounds about right.
- jpfuentes2 14y agoHahaha. Kids will do that to you.
- kelvin0 14y agoWow it never ceases to amaze me the things that headline in HN. As much as I understand the love for one's child(ren), I am a bit disappointed to go on a site called 'Hacker News' to see this type of irrelevant posting.
- jpfuentes2 14y agoYou may consider reading up on the Hacker way: A hacker is a person that loves to program, or someone who enjoys playful cleverness, or a combination of the two.[3] The act of engaging in activities (such as programming or other media[4]) in a spirit of playfulness and exploration is termed hacking. However the defining characteristic of a hacker is not the activities performed themselves (e.g. programming), but the manner in which it is done: Hacking entails some form of excellence, for example exploring the limits of what is possible[5], thereby doing something exciting and meaningful. http://en.wikipedia.org/wiki/Hacker_(programmer_subculture) http://en.wikipedia.org/wiki/Hacker_(programmer_subculture)
- elliottcarlson 14y agoThe concept of code as poetry - or the hidden elegance capable behind it is something that obviously piques ones interest - if it were just for the aww factor it wouldn't get as many up votes. Code is an art, and it's nice to see it sometimes used for something other than the norm.
- chiquitabacana 14y agoI started reading ready to troll, but that was really cute.
- EGreg 14y agoThe thing is, these things are supposed to be personal. But someone can fork it.