4 ms·
Rosetta Code : similar programs written in various languages
- SandB0x 16y agoIt's worth having a look through Rosetta-stone tagged questions on Stack Overflow. There's a large overlap with code golf entries. http://stackoverflow.com/questions/tagged/rosetta-stone http://stackoverflow.com/questions/tagged/rosetta-stone
- mishmash 16y agoSuch a great site. The page on flattening arrays blows me away at how different and beautiful some languages can be (especially Ruby and Erlang's take). http://rosettacode.org/wiki/Flatten_a_list http://rosettacode.org/wiki/Flatten_a_list
- oofoe 16y agoI'll give you Erlang, but the Ruby solution is cheating rather.
- judofyr 16y agoHere's a better Ruby version: module Enumerable def custom_flatten inject([]) do |result, element| if element.respond_to?(:custom_flatten) result.concat(element.custom_flatten) else result.push(element) end end end end Works on all Enumerables (Array, Hash, Set, etc)
- woodall 16y agoHow is Ruby's method and different than Groovy or JavaScript? I think their all pretty neat. Goes to show that there is always more than one way to skin a list.
- mishmash 16y agoTrue. I guess built-in functions shouldn't count.
- Detrus 16y agoThey did JavaScript concurrency wrong! omg! http://rosettacode.org/wiki/Concurrent_computing#JavaScript http://rosettacode.org/wiki/Concurrent_computing#JavaScript We have workers now. But seriously, it is an amazing resource. I was looking this stuff up on wikipedia but that has almost no detail.
- jamespitts 16y agoMichael Mol did a demo of rosetta for the Lansing, MI perl mongers and it was a riot (far better than my DBIC/architecture talk). There are fewer better forms of entertainment for geeks than eating pizza while discussing common programming expressions implemented in bizarre and obscure languages.
- qrush 16y agoYeah, the site is fantastic. He's a funny dude. I helped out with RosettaCode a few years back, hosted it for a little while on my SliceHost instance when they had some trouble. My <a href="http://rosettacode.org/wiki/User:Mwn3d>good http://rosettacode.org/wiki/User:Mwn3d>good friend</a> contributes all the time. Glad to see the site still exists and is flourishing, albeit slowly.
- mikemol 16y agoAnd much appreciated. I don't know when I'd have had the stones to switch to VPS (I still don't think of myself as a sysadmin all that much) if you hadn't helped us jump over to Slicehost. I've got a 2GB RAM node over at prgmr.com, now; more RAM than I know what to do with. Site grows slowly because it's growing steadily. Well, that, and I haven't had the time to set up income or the really nice features that would depend on it. :) If you ever hit the GRR area, I need to buy you a drink.
- roryokane 16y agoThere’s also http://99-bottles-of-beer.net/ http://99-bottles-of-beer.net/, which is basically the same thing but only for printing out the lyrics of the 99 Bottles of Beer song. It has a version in pretty much any language you can think of. However, some of the versions are made not to show the language’s normal way to print the lyrics but to show a strange way only possible in that language.