5 ms·
Is it wrong that I was secretly hoping the answer was "I rewrote it in something that isn't ruby"?
by orclev 13y ago
Is it wrong that I was secretly hoping the answer was "I rewrote it in something that isn't ruby"?
- rubiquity 13y agoWrong? Sometimes. Trendy? All of the time.
- joemaller1 13y agoAt this point on HN, I was expecting a page that just said "I rewrote it in Go"
- unknownian 13y agoOr Erlang/Elixir.
- SkyMarshal 13y agoDamn, busted. Elixir was the first thing that popped into my head on seeing this title. It looks almost like a Ruby port to the Erlang VM. That said, good writeup, even for a non-Rubyist, enjoyed seeing the process. One thing that stuck out is how control flow via if/then/else is faster than via case (for more than 2 options) in Ruby. I always assumed the opposite, for any language.
- ics 13y agoThere's an older (but still interesting) post about case in Ruby here[1] and another here[2] with some extra insight into the MRI implementation. Having learned Ruby before most of the other stuff I play with these days, I always second-guess myself when using a switch/case construct in my code. [1] http://www.skorks.com/2009/08/how-a-ruby-case-statement-works-and-what-you-can-do-with-it/ http://www.skorks.com/2009/08/how-a-ruby-case-statement-work... [2] http://www.daniellesucher.com/2013/07/ruby-case-versus-if/ http://www.daniellesucher.com/2013/07/ruby-case-versus-if/
- SkyMarshal 13y agoNice writeups, thanks!
- orclev 13y agoNever any love for Haskell... which is ironic considering his ruby library is essentially a (weak) runtime version of Haskell's type signatures.
- plg 13y ago"how I made my toyota tercel 5x faster... (I sold it and bought a porsche)"
- rubyissofun 13y agoRuby is awesome, so yes that would be wrong. But is it wrong that I was secretly hoping the answer was to abandon the project? Contracts are not needed and it obfuscates the error raising. Just use plain Ruby if you need to raise an exception. I'm will seriously quit using Ruby if someone makes me use contracts. But it looks like a fun project to write. Nothing wrong with that.
- cmccabe 13y agoYeah, it sounds like he should just use a statically typed language. (yes, I am aware that types != contracts, but they're similar enough that my statement still stands)