|
|
Which should I learn - Python or Ruby?
67 responses total.
Why not both? Either is sufficiently intuitive that one can be usably proficient in a day or two; picking up both should not be that hard. Personally, from a pure language-design perspective, I prefer Ruby over Python. Steve Yegge, however, feels that it is not an acceptable substitute for LISP and gives a number of reasons why: http://steve-yegge.blogspot.com/2006/04/lisp-is-not-acceptable-lisp.html Python feels a bit rougher around the edges, but is still useful.
Remmers, with all do respect, isn't it rogaine and viagra time for you?
I've never dealt with ruby and spent maybe 2 hours with python. Maybe I wasn't fully understanding python, but from what I could tell, python names it's chunk of memory. Here is how I understood it. In C, I would go like char i = 6; char *p = &i; in C, &i is just a chunk of unamed memory. The only thing that has a name is the shit associated with the variable i. However in python this would be a reference (ie not a pointer) and this reference would have a name. This means I can do true variable rebinding as opposed to simulatng variable rebinding in C.
It is true that, in python, variables are references. To me, Python feels a bit more hacked together; you can tell that some things were bolted onto the side of the language, often rather clumsily. Ruby is much cleaner in this respect.
I find some of the syntax of ruby very elegant. Never did any serious coding with python to really compare. But really like ruby.
Re #1: I'm sure you're correct that it's not difficult to pick up the basics of both languages, so let me clarify the question a bit. Do folks have a preference for one over the other as an environment for developing web applications? Or some third language? PhP (with which I've had a bit of experience) is another candidate to throw into the mix.
I prefer to write my web applications in PHP, and do any back-end scripting using Perl.
Regarding #6; Ah, that's a little clearer. Ruby, hands down. Rails is the `killer app' for web type stuff.
I've been hearing a lot of buzz about Rails, most of it favorable, although apparently there are scalability issues (Twitter is written in Rails and has run into some problems). Yeah, I've done some PHP development - my jremmers.org website is all PHP-based, currently. What would be the advantages of Ruby+Rails over PHP, or PHP+Perl?
(I've retitled this item to better reflect its purpose.)
Regarding #9; The usual: A better underlying language, a huge amount of 3rd party support, and some others: Rails has a good implementation of model 2 for web applications, which is really nice to work with. It makes developing really fast; and hopefully, a lot of of the scalability issues will be resolved with future upgrades to the Ruby interpreter. But how big do you expect your demands to be? Do you really expect to run into a lot of scaling problems?
Java + JSP in a Websphere or JES container, using Struts for the presentation framework and Oracle or DB2 or Postgres on the backend. Ok, that is probably overkill for what the average person plans to develop, but it would certainly be scalable and well supported, and marketable.
Linked from Jellyware 79 to Web 14.
Re #11: I don't expect to run into scaling problems for a while. I've done some cursory reading up on Rails (and also Django, its Python counterpart). Is it correct to say that these frameworks are geared to using a relational database as the backend data store? Or are they more general than that? I'm also discovering that some web hosting companies support Rails and others (like my current web host) don't.
Geared toward, but not required.
I really wouldn't use Perl or the Perl DBI when connecting to any kind of proudction level database. My whole gripe is because Perl OOP paradigm still lacks the maturity needed to be used in a production level setting. I also think the whole reference counting garbage collector that Perl uses is a bigger load of shit than organized religion. Cross, admit it. The perl garbage collector lags 3 decades behind the lisp garbage collector. Going off on a tangent, Perl sort used to suck ass because the sorting was unstable. However, I think as of Perl 5.6, they switched over to mergesort and hence you can finally get a stable sort. I refuse to comment on perl hashes. However, for a personal website or writing hobbyist code, I would use perl to connect to my database.
I don't care for perl.
Is this because nharmon and vive fagged up your perl experience?
No, because it's a sucky language.
I don't care for perl either, and agree that it's a "sucky language", though I still use it for quick jobs -- usually nothing that I think I'm going to have to go back to, because when I'm done the code usually looks like line noise and a month later I find it borderline unreadable. But #16 is a pretty silly thing to say. Perl is obviously being used in a really whopping number of production environments all around the world. The comments about the garbage collector and OOP paradigm are true, but pretty much totally beside the point.
I probably should play around with Ruby the next time I have a project..
Perl put a ridiculous number of man pages onto my computer so I removed it.
...
re #22: Why not just remove the man pages?
Perl sucks when its used for what it is not good at. but for small text editing I find perl one liners the best at the job. I would definitely not write a 1000lines program in perl.
You'd prefer a 10000lines program in C
Most people would be both pleased and astonished to have manpages that give copious amounts of information. I have to say, though, the Linux LVM manpages are REALLY good.
Yeah, Perl does spam the manpage space. Really clutters up manpage search results to the point of making them unusable. Shame on them. I wouldn't go so far as to remove Perl on that account, though. Getting back to Ruby vs. Python: Google searches turn up tons of discussion, with lots of opinions on both sides but no particular consensus. The _RESTful Web Services_ book I'm reading favors Ruby for its code examples, so that tends to tilt me in the Ruby direction, at least for now.
Writing 10000 line of C code is about as enjoyable as getting a BJ in a dres, stocking, and heels.
I thought you were into that kind of thing?
Okay, outside of the really bad typos in thread 29, writing 1000 lines of threaded code for Linux in C is like wearing cheap stockings. Both are piss poor imitations to the real thing and both tend to rip apart at the most inappropriate moments. I really forgot where I was going with this analogy. I'm also getting the feeling uncle remmer is ignoring me. And in other news, I finally understand what a fucking tagged union is. Yes, another winner topic that has taken me 6 months to understand.
I removed the man pages. Then I removed the doc pages (html). Then I noticed a large unicode directory containing Tibetan. ANd a Test directory. And a whole bunch of other files, maybe thousands of them. I only needed perl once to compile one program, and there was a workaround (manual installation?). If I ever need it again I can use it at grex or reinstall. The list of files in perl is 43K (20 printed pages). 80x43=3200 files? Do I really need anything not in bin or lib (not even including /lib/perl5/unicode - Bengali, Cherokee, Bopomofo, Ethiopic, Hangul are all interesting but not relevant to what I am doing with my computer). What do other people use perl for?
Mostly, text processing (in various guises). So it created a lot of files; were you running out of space or something?
What I'd recommend, if you can borrow use of someone else's machine and they will let you download and build on it, make either the microperl or miniperl (depending on your needs and space constraints). You will then have the relevant exe and can move just it and (I think) one or two .so files and be done with it.
Thanks for the suggestion about building a smaller perl. I don't like having a lot of junk on my computer that I do not use. I process text with pico. I have perl source code (from Slackware 10).
Please do not develop the bad habits of so many people who write perl codes. Many perl authors write intentionally opaque codes that use shortcuts, exploit side effects and massive (unnecessary) indirection. The arrogance seems to be "well, if I wrote it and I understand it, and if you cannot understand it to maintain it, I must clearly be smarter than you". Those fuckers deserve to be sodomized with a rusty hashmap and force-fed an uncommented library characterized by its gotos into inner-loops. And then beaten savagely.
Sounds like you need to learn perl.
It's possible to write decent code in Perl. All of my Perl code is *supremely* elegant and readable. :)
I would have to say the main reason I develop web apps in PHP is because it is almost universal for web hosts.
|
|
- Backtalk version 1.3.30 - Copyright 1996-2006, Jan Wolter and Steve Weiss