Re: Re: Mastering CSV in Ruby book(let) pdf download (37-pages, 185kb) is now free (Donation Optional). Happy Monday! -- Paweł Dąbrowski (Ruby is dead, long live Rails!)

Why ruby is dead? I saw many people still use ruby for development, not only web development. For instance, fluentd is developed by Ruby.

···

On Aug 24, 2022 - 07:26, andy.am@gmail.com wrote:

> Did you now that reading the data into a "true" plain-old vanilla hash requires
> this dance

But, I love dancing! Now, you’re taking away all the fun!

Just kidding. But, seriously why don’t you contribute the shorter version to Ruby CSV directly as a shortcut helper, option, or some smart default?

In any case, I’ve heard the alternative saying “Rails is dead! Long live Ruby!” before. I think I like that saying a lot more than “Ruby is dead Long live Rails…” as it makes more sense. If Ruby were dead, Rails would die automatically with it too because it’s built on it. But, Rails could die alone without Ruby dying.

Still, who are we kidding?! Both Ruby and Rails are very alive and well, except perhaps in the minds of inferior programmers. That is programmers who either aren’t smart enough to understand their benefits over similar technologies or don’t have the discipline to learn them well enough to see the light. So, they end up gravitating towards newer yet lesser technologies just because of their greater buzz while thinking there is no difference except in “preference”, despite doing 4-10 times more work with them than necessary with more code to maintain too. Let them just be!

That said, I have great regard for C/C++/Swift/Java too even if Ruby (incl’ JRuby) generally works well for most requirements out of the box. I think having the other options on the table is useful, especially when having special memory, parallelization, or performance requirements. These languages have very deep reliable communities unlike some other technologies and languages that I didn’t mention.

But, I think Crystal & Kotlin are rising stars too. And, some highly specialized languages like GNU Octave and R could be useful in limited domains like Math and Stats. Also, Lisp and Smalltalk are great educational languages as precursors to Ruby, but I wouldn’t use them or use any flavors of them directly for business no matter what some “experts” might say (unless you want to maintain weird code just to show off how smart you are or be bound by libraries with very small communities).

Anyways, I really appreciate Ruby for 80% of development needs at least. What else did you expect from me in a Ruby mailing list!?!!

Cheers,

Andy

> On Aug 22, 2022, at 11:50 AM, Gerald Bauer <gerald.bauer@gmail.com> wrote:
>
> Hello,
>
> Paweł Dąbrowski (Ruby is dead, long live Rails!) writes:
>
>> Mastering CSV in Ruby book(let) [pdf download (37-pages, 185kb)] is now free [(Donation Optional)].
>> Happy Monday!
>
> See Mastering CSV in Ruby
>
>
> It's a great read on the "state-of-art" of the built-in standard csv
> gem / library in 2022.
>
>
> Did you now that reading the data into a "true" plain-old vanilla hash requires
> this dance:
>
>
> rows = CSV.read( "example.csv", headers: true ).map { |row| row.to_h }
>
> vs
>
> rows = CsvHash.read( "examples.csv" )
>
>
> in - dare I say - my humble alternate csv reader gem / library [1].
> Or even easier
> or using ruby cocos (code commons) [2]:
>
>
> rows = read_csv( "examples.csv" )
>
>
>
> Anyways, that's pretty much sums up the interest and state-of-art of
> data wrangling in ruby.
> I am talking to myself ;-). Ruby is dead. Long live Rails!
>
> What's your take? What alternate csv / tabular data gems / libraries
> do you use (or recommend)?
>
>
> [1] GitHub - rubycocos/csvreader: csvreader library / gem - read tabular data in the comma-separated values (csv) format the right way (uses best practices out-of-the-box with zero-configuration)
> [2] GitHub - rubycocos/cocos: cocos (code commons) - auto-include quick-starter prelude & prolog
>
> Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe>
> <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt;

Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt;

-------------------------------------------------------------------------------------------------
FreeMail powered by mail.de - MEHR SICHERHEIT, SERIOSITÄT UND KOMFORT

Hello,

I’ve heard the alternative saying “Rails is dead! Long live Ruby!” before.

   For the record: I was quoting (with a little joke for sure) the tagline of
  Paweł Dąbrowski - the author of the Mastering CSV in Ruby book.

  His blog was called "Ruby is Dead! Long Live Ruby!" and - surprise, surprise -
  now rebranded to "Rails Formation" - thus. leading to the
“Rails is dead! Long live Ruby!” joke. See

Why ruby is dead?

Just joking of course - but compared to python, javascript or excel
macros or even yes, rails - ruby's popularity is practically no
longer measureable or showing up in charts ;-).

seriously why don’t you contribute the shorter version to Ruby CSV directly as a shortcut helper, option, or some smart default?

   As written in the how to fix the csv library / gem series [1] - the
tabular data model (with headers: true) is broken (among other things)
- I'd argue to keep it simple and use plain-old hashes for rows /
records - instead in the 90s object-oriented was all the rage and,
thus, the gem/library use CSV::Table, CSV::Row, and so on oo-style
wrappers.

   Also it might be a better practice and -yes - follow the python csv
library and offer to readers in two flavors instead of one reader with
a "magic" switch to turn on headers on and off (and get an array or
arrays or CSV::Table/CSV::Row, that realy should be an array of
hashes) and so on.

  Anyways, as written before as far as I can tell the better more
pragmatic approach is to offer an alternate csv gem / library. Doing
a "rewrite" of the existing library if you are not the "module owner"
I'd say is practically impossible. Imagine discussing every minuscule
change forever and asking to get the patch applied.

  Again the csv gem [2] was an unloved orphan (the father e.g. created
by James Edward Gray III on 2005-10-31 leaving his baby behind now an
all Elixir evangelist or whatever!)
and is now for more than two years or such lovely updated by Sutou
Kouhei (kou) - you are a hero - with a real parser, more options
(strip whitespace for values), and more - but a pig with a lipstick
is still a pig!

   Cheers. Prost.

[1] csvreader/docs at master · rubycocos/csvreader · GitHub
[2] GitHub - ruby/csv: CSV Reading and Writing