5 ms·
This is tangential, but I've found that ruby's non-standard libs have, for the most part, been horribly named. Recall from the article: curb, nokogiri, syck, p
by leif 16y ago
This is tangential, but I've found that ruby's non-standard libs have, for the most part, been horribly named. Recall from the article: curb, nokogiri, syck, psych, home_run. Others: sinatra, rack, thin, unicorn, maruku. None of these give me the slightest clue about what they do, and if I wanted, for example, to parse XML, how on earth would I know that I wanted to find "nokogiri" (or "hpricot")? Could I pick what I wanted out of a lineup?
How do you ruby people find the good libraries when you need to perform a task? Is it all word-of-mouth (word-of-blog I guess)?
- nwmcsween 16y agoTwo second google search would suffice http://ruby-toolbox.com/ http://ruby-toolbox.com/
- leif 16y agoWhat was the query?
- shubber 16y ago'gem -r -d search' works pretty well.
- koenigdavidmj 16y agoSame applies to nearly every tool for every language. yacc, for instance, does not give any indication as to what it does (well, until you expand the initialism). Java is, of course, one place where this is a bit better. log4j and jUnit both tell you what they do quite easily. (But then again, Apache Maven does not.) We have Google these days, and if that doesn't help you, go on the #ruby IRC channel and ask what they recommend.
- jshen 16y agoLucene, guice, solr, spring, hibernate, jmx, osi, nailgun, etc.
- crazydiamond 16y agoawk, grep, sed, perl, cat, finger, man, etc
- gloob 16y agoawk -> I forget what grep -> global/regular expression/print sed -> stream editor perl -> I'll give you this one cat -> concatenate finger -> I'll give you this one man -> manual A large percentage of them are mnemonics.
- jshen 16y agoI wasn't implying that it's better elsewhere, just that java isn't any better.
- rbranson 16y agoHow do you propose to differentiate between multiple implementations of the same concept otherwise? It is nice that there is a "nokogiri" and "hpricot," unlike the PostgreSQL gems, which are called "postgres", "pg", and "postgres-ruby". The one you actually want to use is "pg" though. Should "rack" be called standard-http-server-api-with-support-for-middleware, and then "unicorn" be called pre-forking-web-server-using-standard-http-server-api-with-support-for-middleware?
- leif 16y agoThe "-ng" prefix has served the programming community quite well for some time.
- derefr 16y ago> Should "rack" be called standard-http-server-api-with-support-for-middleware, and then "unicorn" be called pre-forking-web-server-using-standard-http-server-api-with-support-for-middleware? No, but perhaps we could have: WebServer = require_any_satisfying_protocol 'http-server/with-middleware-support' WebServer.new where each rubygem installed has a table of protocols each of its classes and modules support. For example, Mongrel would have a table that starts: {Mongrel::HttpServer => ['http-server', 'http-server/with-middleware-support']}
- djacobs 16y agoThere are hints of efforts in this area. See rubyinterfaces.com. As an example, their proposed HTTP interface can be found here: http://rubyinterfaces.com/httpi-0.1.0/ http://rubyinterfaces.com/httpi-0.1.0/
- FooBarWidget 16y agoThere are two problems with that. 1. In practice you almost never want to load a random library that says it supports a certain interface, you will want a specific library. Notable exceptions are glibc where the interfaces are well-defined over several decades but that brings us to... 2. Few libraries implement the same exact interface. Mongrel and Unicorn have totally different interfaces. Phusion Passenger is also a web server but works in a fundamentally different way from either of them. Hpricot and Nokogiri are both XML parsers but their usage API is different.
- jshen 16y agohttp://www.google.com/search?q=ruby+xml+parser&ie=UTF-8&oe=UTF-8&hl=en&client=safari http://www.google.com/search?q=ruby+xml+parser&ie=UTF-8&... Nokogiri is the 5th result for me. How does anyone find libraries and then choose between them? I believe you should always do a little research unless your feeling lucky.
- catch23 16y agoSame goes for just about every library under the sun. The other day I was searching for redis libraries for nodejs, the first one from google by fictorial is maintained by someone who has gone for maternity leave where the current version doesn't even compile against the latest node. The one that you're actually supposed to use doesn't even list on the first 5 pages of the google search. (but is the first one found via npm)
- catch23 16y agonot much better in python either, or any language. How does one name an xml parser beautiful soup?
- evgen 16y agoIt is an html parser, not an xml parser. It was probably named as a tongue-in-cheek reference to adding some beauty to the tag soup that was state of most (mal-formed) html pages out there at the time of its creation.
- FooBarWidget 16y agoI think you are putting too much weight on the name. Humans brains are by nature powerful association engines. People tend to associate brand names with their purpose and (perceived) quality pretty quickly. If you've heard of that a once and the product turns out to be good then you are likely to remember it in the future. Why do you think Coca Cola is called Coca Cola and not Black Sweet Beverage? Heineken instead of Dutch Beer? Nike instead of Expensive Nice Shoes? Names do not have to be descriptive. It confuses people for maybe a few minutes. Then they look for information, find it, and they move on. There's absolutely no point giving products generic names because in the long run it hurts the authors by being unable to differentiate themselves from others who do the same thing. Don't know what "nokogiri" is? Search the internet and the first result will tell you. Looking for an XML parser but don't know its name? Search the internet and the first result likely gives a good recommendation.
- blasdel 16y agoIt's much worse than that — ruby's non-standard libs all have at least three potentially-different names: $ gem install rack-cache $ irb irb(main):001:0> require 'rack/cache' => true irb(main):002:0> Rack::Cache => Rack::Cache Only a japanese person could have come up with this clusterfuck — it's like dealing with Kanji!