View Feed
Coffee Room
Discuss anything here - everything that you wish to discuss with fellow engineers.
12915 Members
Join this group to post and comment.
Ashraf HZ
Ashraf HZ • Jun 3, 2008

Python or Ruby?

I'm currently learning Python as a new programming language, and discovered that Ruby is pretty much similar. However, in terms of web development, Ruby scores with Ruby on Rails (eg Twitter), while Python is still catching up for now.

Ideally, I would love to learn both. But I want to focus my time and efforts on only one of them.

Which one is more desirable on the long run? xheavenlyx found sources ( towards programming robots with Python, which is pretty nifty. TurboGears and Django might equal or even surpass RoR soon in the web development arena (which I might venture in the future).

Would really appreciate your feedback, CEans 😀
xheavenlyx • Jun 3, 2008
This is so cool Ash. I didnt see this post before as I hadnt come on CE much for the past 2 weeks, and also not much in CS section 😁

I can give you some more info on Python from what Ive read 😀.

For example Google itself uses only 3 primary languages. C++, Java and .... anddd behold (It was surprising to me too!) Python! They wrote the whole in Python with just 100 lines of code BUT all the functions which were easily imported and wrapped for Python made the final compilation file about 3MB+ ! Info is from this INTERESTING web-log from a Google guy: Python at Google.notes

A Quote:
Google's programming environment
Primary Languages

If you want to write a piece of something else, like Perl, you have to
almost get special permission. (Exceptions in ops, but for actual
product stuff, see above)

Some Perl used by Operations (others almost have to get permission to use Perl)
PHP creeeps in for internal webapps
Saw Ruby sneaking around
Small amount of C#
As for Ruby, you would know better as you must have already searched google for "Python or Ruby for web development". lol 😀 I did that too, interesting stuff.
Ashraf HZ
Ashraf HZ • Jun 3, 2008
Thanks for the Google stuff!

Haha, I got pretty tired of reading the "Ruby vs Python" stuff. The "Rubys" and "Pythonistas" tend to get very fanatic! They post codes and compare little details.. attacking each other with "I got this, you dont!" mentality. In the end, the impartial verdict is that they are the same at heart.. (and that both is better than PERL *ahem* )

Perhaps I could understand.. I mean, I've been taught C and C++ in engineering, and not a drop of Java (but the department of ICT does), so I tend to steer clear of Java code. But that doesnt mean I have to say C++ kicks Java's butt 😛 If one is happy with a programming language, and its suitable for your needs, just make the full use of it.

I'll guess I'll stick to Python for now.. it seems to have more versatile applications, especially in engineering (eg software, robotics, embedded, etc). NASA uses it too, but I'm sure we should take that as a technical reason and not a marketing one 😉 When I have time in the future, I'll take a look at Ruby.. or even SmallTalk.

Anyways, because languages like Python and Ruby are easy to pick up, and are HIGHLY portable, perhaps we should consider writing CE: IM in it? That'll give more opportunities for more CEans to try out.
Kaustubh Katdare
Kaustubh Katdare • Jun 3, 2008
I'm playing with Ruby in my spare time. Though I haven't progressed much, I'll update you on how it stands against Python.

One important learning : Ruby rocks on Rails!*

*-> The framework!
Ashraf HZ
Ashraf HZ • Jun 4, 2008
Here's an interesting comparison between RoR and Django:
vaporbase :: Postings

Its quite a long analysis.. but from the final conclusion, RoR beat Django overall. But, the latter won (barely) the "technical" side of things. One has to read through all the 15 parts to get the whole picture. I'm not going to bother just yet though 😉 Keep in mind that this analysis was made a year ago. Who knows how much things have changed to both of them.

Am downloading Pyro now btw! *rubs hands in anticipation*
xheavenlyx • Jun 4, 2008
Yea, its really good to know 2 to 3 languages at best. Specially since Biggie is doing Ruby and RoR, we can use that for IM or even Python for certain tasks. The best part is they can be inter-communicated (donno about Ruby, but most probly will be able to).

Good idea about the IM though! 😀 I was getting scared thinking how the helll are we going to make that!! lol

(On a side note: The GUI can be built using another lang (wxPython or C/VB), and the networking part on ruby...just a shitty comment lol, some computer programmer must input on this.)
Ashraf HZ
Ashraf HZ • Jun 4, 2008
For python, we can use this for GUI:
TkInter - PythonInfo Wiki

Yea, I think its possible for Python and Ruby to communicate well with each other easily.

Haha, It'll be cool to see Biggie introduce RoR into Crazy Engineers! It'll look awesome for sure!

Check out cspace!

CSpace provides a platform for secure, decentralized, user-to-user communication over the internet. The driving idea behind the CSpace platform is to provide a connect(user,service) primitive, similar to the sockets API connect(ip,port). Applications built on top of CSpace can simply invoke connect(user,service) to establish a connection. The CSpace platform will take care of locating the user and creating a secure, nat/firewall friendly connection. Thus the application developers are relieved of the burden of connection establishment, and can focus on the application-level logic!
CSpace is developed in Python. It uses OpenSSL for crypto, and Qt for the GUI. CSpace is licensed under the GPL.
xheavenlyx • Jun 7, 2008
Yea, good idea, we can use TkInter as GUI. I didnt know much about it before. Thot it was just for Linux users.

Man, CSpace looks like a normal client and making something like that would be our aim, plus some more CE related eye candy 😀. I wish we can also have the capability of sending offline messages! (Provided we have access to a 24h Server to store our client)
elric • Jun 15, 2008
TkInter come up with quite barebones ( in terms of visually pleasing ) interfaces, check out wxPython for making GUI's, its multi-platform too. 😛
Also am strartin to learn RoR now, though am pretty well versed with python ( have been using it for a year now 😛 )
xheavenlyx • Jun 15, 2008
Hey thats so good! So, if I get in a fix I can ask you for help! 😀

Yea, wxPython is really really good. But we were thinking of using TkInter for very basic stuff, mainly in interfacing it with our CE bot (multi-platform). But yea, we can use wx to make it look and work much better than Tk.

Ok, can you give me some ideas to work on? I am learning it, a bit above the beginners level, but I need some project to try my skills on...A real world problem...and also do you think learning several Packages at the same time should be avoided? (Pyglet, Vpython, Numpy, wxPython?)

What small proj's did u take up back then when you were still learning?
elric • Jun 16, 2008
I guess it doesnt hurt learnin multiple packages at the same time, cause in a final program you would have used quite a few packages anyways.

I found wxpython quite easy to learn cause i had used wxwindows for gcc in an earlier project (was making a crude front end for mysql 😛 )
some mini-projects i did when i was learnin wxpython was writing a note-making/organising program, which i wrote to keep track of the various things i had to do and stuff relating to various projects i was doing 😛
another thing i did was to write a basic scheduling interface, to add jobs to be executed at a specific time and manage it easily, (was essentially a front end for the at command in linux)
Something that i always wanted to try but never got time to do was make a search program for unix (like beagle 😁) using python, probably you could try it 😛

Share this content on your social channels -