Hacker News new | ask | show | jobs
by tmm84 1283 days ago
That snippet looks like Python/Lua/C with the for, case and close being used. Ruby is one of those languages that like Lisp/Scheme, Smalltalk or Haskell requires you to know what is going on as well as what is available to come up with a clean/simple solution. I think finding good Ruby resources that are up to date are few but I believe most of the stuff out there still works in recent versions.
2 comments

> That snippet looks like Python/Lua/C with the for, case and close being used

Not really Python like at all - apart from the one line with for. Python doesn't have a case or when statement, or syntax level regex, doesn't open or close directories, and for files it would idiomatically would use the context manager for file access rather than closing it.

But it also doesn't look like any Ruby I've seen or written either :)

For the record, Python didn't have a case or when statement. It does now, recently added to version 3.10.
Doh, spending too long in Ruby lately - got some catching up to do.
>> I think finding good Ruby resources that are up to date are few...

I just finished a class that was taught with Ruby. It seems like an absolutely delightful language, but I could not find docs pertaining to several projects that I had conceptualized as my 'final project'. Microsoft Graph API has no docs available for Ruby.