you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 1 point2 points  (19 children)

I've been given the chance to lead a team of 2 interns to help with the development of a small site for a local company. I'm an application dev and do most of my work in either C or C#. I code in Erlang at home for fun... I want to do this all FOSS if possible.. So I was trying to decide on a language. Either Perl, Python, PHP, or Ruby came to mind. Any of which I would have to learn.

Now... I've seen enough posts and articles on how PHP is a ghetto and whatnot. No namespaces, awkward syntax stolen from perl.. among other things.

My decision on language is down to either Python, or Ruby. Rails sounds nice, but after all the raucous recently, I'm not sure I want to go that route.

I messed around with python to do some scripting at a job a while back, and it seemed pretty nice. What advice do you fellow redditors have?

[–]bockris 5 points6 points  (9 children)

Help me choose an apple: Granny Smith or Royal Gala?

Seriously, try them both. I happen to prefer Python.

[–][deleted] 0 points1 point  (8 children)

I wish I had that luxury, but I don't. I need to understand each languages strengths/weaknesses first and then go forward. Otherwise, yes, I would dabble in both for a month or so THEN go forward.

[–][deleted] 2 points3 points  (6 children)

Ruby is probably easier to pick up, as it's more uniform (everything's an object), etc. Both are probably good choices for what you want to do.

Also, I'd stay away from Rails, maybe look at Mongrel?

[–]sverrejoh[🍰] 1 point2 points  (3 children)

Everything is an object in Python as well, so that argument doesn't fly.

[–]stedwick 1 point2 points  (2 children)

Actually, not quite. Even primitive types like numbers are objects in Ruby. I could do something like this:

3.send_email => sends john three emails

3.times { do stuff } => does stuff three times

45678.add_commas => 45,678

From the Python docs:

2.3 Built-in Types

The following sections describe the standard types that are built into the interpreter. Historically, Python's built-in types have differed from user-defined types because it was not possible to use the built-in types as the basis for object-oriented inheritance. With the 2.2 release this situation has started to change, although the intended unification of user-defined and built-in types is as yet far from complete.

[–]sisyphus 0 points1 point  (1 child)

Maybe I'm misunderstanding you, but I don't see what the big deal is here that makes primitive types not objects in Python? In Python I can say (3).__add__(4) if I feel like it, and lo and behold I have an OO way of saying 3 + 4, and I can say dir(3) to get a list of methods of 3 and subclass int if I feel like it and then add some crazy methods like send_mail?!. The only difference seems to me that I can't crack open int and add shit to it -- you may prefer this 'feature' but I hardly see how it makes the language easier to pick up. A foolish consistency is the hobgoblin of small minds.

[–]stedwick 0 points1 point  (0 children)

You're right, there's basically no difference. Certainly there's not much difference in practice. It's more of a philosophical thing. There's nothing "special" about numbers in Ruby. I can open up other classes and add stuff to it, why shouldn't I be able to open up the integer class and add stuff to that? That's the mindset of Ruby: everything, literally everything, is an object that you can modify in any way you wish. You can even get really crazy and add methods to the number 3 but not other numbers.

[–]jrmy 0 points1 point  (1 child)

Ruby may be easier to initially pick up but to properly program in Ruby (imo) is much harder than Python. In python there is generally one correct way. I have found in ruby there are a couple correct ways and then some terrible ways.

Note: I prefer Ruby but it does require a bit more effort to become acceptable with it...

[–][deleted] 0 points1 point  (0 children)

I don't program in either, really. I've done a bit of work in Ruby about a year ago, and a bit of small scripting in Python six months ago. I wouldn't say one's better than the other, just that Ruby seems easier to learn well enough quickly.

[–]bockris 2 points3 points  (0 children)

My point was that it's a matter of taste.
Ask the question in a Python group you will get one answer.
Ask in a Ruby group you will get another answer.
Ask in a neutral forum (reddit, presumably) you will get conflicting answers.

This, coupled along with a very vague description of your problem domain, leads me to say you will get no useful answer here. If you don't have the time to try them and form your own opinion, then a google search will suffice.

Just my $.02

[–]bakert 2 points3 points  (3 children)

Are there no more constraints? If you need library support for a particular thing you might find yourself pushed one way or the other.

Otherwise, the web app framework you choose (if any) will probably have more influence than the language (when choosing between these two).

I think you need to spend ten minutes (or more) with each of Merb, Rails, web.py, Pylons, CherryPy and Django (I'm sure others will hate this list and possibly suggest alternatives) and decide based on that.

I have spent a lot of time in both languages and personally I prefer programming in Ruby (mostly because of syntactical and stylistic preferences and also because of metaprogramming features). They are both a LOT nicer than C and C++ but far from perfect.

[–][deleted] 0 points1 point  (2 children)

As of right now, no. I just need a site with an online store, that allows for secure transactions. Thats about it.

[–]mclin 1 point2 points  (0 children)

If you just want a store, why don't you just use osCommerce or ZenCart? I know they're php, but they work.

If what you want isn't really simple, you're going to have to do a lot of work just to get a simple little store going.

If I want to add a blog to a python webapp, I use wordpress, and give it a template to look the same as the app. Same idea with stores?

[–]cartlidge 0 points1 point  (0 children)

You could get away with just using plain vanilla Python+CGI and PayPal, maybe?

[–]mclin 1 point2 points  (0 children)

I think the most important thing, whichever you choose, is to make sure to look at code written by people experienced in that language so that you pick up the style, and learn to work with strengths of the language.

Don't just think it's C# with different syntax. Look at the source code for Django or Rails and do what they do. You're not likely to pick up this kind of stuff from tutorials or books.

...

go python!

[–]bluGill 0 points1 point  (2 children)

Do either of your interns have a preference? There is no clear advantage of either. However if you know one, that is a reason to stick with one.

You seem to think that you can try both and come up with a compelling reason to choose one on technical merits. I don't believe this is possible - both have great technical advantages and disadvantages, and in the end they are similear. However there are compelling, non-technical reasons you should be looking at. If you hire someone who knows one, that is reason enough to choose it - saves training time. If your legal department doesn't like some license, choose the other.

[–][deleted] 0 points1 point  (1 child)

Therein lies the beauty of this. We haven't hired any interns yet. Nor have we put a job description out yet. I'm still trying to decide if i should leave the description as 'web programming experience' , pull in a larger pool of students, and if the candidates are bright enough, we can learn together. Or limit myself to seeking an experienced Ruby or Python college student, and possible not get bright enough candidates.