DaemonForums  

Go Back   DaemonForums > Miscellaneous > Programming

Programming C, bash, Python, Perl, PHP, Java, you name it.

View Poll Results: Which do you prefer Ruby or Python?
I prefer Ruby. 5 41.67%
I prefer Python. 7 58.33%
Voters: 12. You may not vote on this poll

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 6th February 2010
tetrodozombie tetrodozombie is offline
Real Name: bill slusser
Banned
 
Join Date: Dec 2009
Location: atlanta, ga
Posts: 82
Thanked 1 Time in 1 Post
Default Python Vs Ruby & Django Vs Rails.

Been programming with Ruby and Rails sporadically for the last two years. Tonight, I tried Python and whoa! It was a blast. It's easy to understand and write where Ruby is harder to grasp for me b/c it's more abstract and things are done without any closures.

I hear the Python interpreter is a lot faster than the Ruby interpreter.

I'm cool with Django being a rails for python. There are a lot of smart people out there who don't use the same tools you use or I use and we have to tip our hat to their creativity and knowledge.

I like the flow of Python better than Ruby. When I program in Ruby I always feel something is missing that I'm getting from Python.
Reply With Quote
  #2   (View Single Post)  
Old 6th February 2010
ephemera's Avatar
ephemera ephemera is offline
Knuth's homeboy
 
Join Date: Apr 2008
Posts: 537
Thanked 49 Times in 43 Posts
Default

I'd like to learn Python sometime.
But learning a language (properly) takes a lot of time & effort.
Currently I am not motivated enough to learn a new language. :-(
Reply With Quote
  #3   (View Single Post)  
Old 6th February 2010
roddierod's Avatar
roddierod roddierod is offline
Real Name: Rod Person
VPN Cryptographer
 
Join Date: Apr 2008
Location: Pittsburgh, Pa
Posts: 371
Thanked 13 Times in 13 Posts
Default

Quote:
Originally Posted by ephemera View Post
I'd like to learn Python sometime.
But learning a language (properly) takes a lot of time & effort.
Currently I am not motivated enough to learn a new language. :-(
I felt the same way until I actually tried Python. It takes a week to grab the basics - depending on where you are coming from language-wise.

Until I tried Python, I programmed because it was my job. Python brought the love and joy back to programming that I had when I was a kid, and it had been missing for 15 years or so.
__________________
"The basic tool for the manipulation of reality is the manipulation of words. If you can control the meaning of words, you can control the people who must use the words." -Philip K. Dick
Reply With Quote
  #4   (View Single Post)  
Old 6th February 2010
Carpetsmoker's Avatar
Carpetsmoker Carpetsmoker is offline
Real Name: Martin
Old man from scene 24
 
Join Date: Apr 2008
Location: Eindhoven, Netherlands
Posts: 2,051
Thanked 198 Times in 156 Posts
Default

You mention Django and Rails, so I gather you plan on doing some web programming?

I tried both Django and Zope, and found them to be rather big and complicated to deal with with, I found using just the cgi module and cheetah to be easier ... YMMV of course
As a sidenote, a friend of me if very enthusiastic about web.py ...

I have never used Ruby.
__________________
UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things.
Reply With Quote
  #5   (View Single Post)  
Old 6th February 2010
J65nko J65nko is offline
Administrator
 
Join Date: May 2008
Location: Budel - the Netherlands
Posts: 3,116
Thanked 182 Times in 149 Posts
Default

From OT: Python (was Re: vi in /bin)
Quote:
Originally Posted by Claudio Jeker
Ugh, a programming language where you can't copy paste from xterm to xterm
without fucking up the program is just way to much pain to work on.
The indenting of code is an optical help but should not change the
behaviour of the program. For me it is important to be able to write code
with style(9) in mind (and I think most other BSD developpers think
similar because our code all looks similar).
This discussion was triggered by the following
Quote:
Originally Posted by Henning Brauer
* Randal L. Schwartz <merlyn@stonehenge.com> [2009-12-19 00:34]:
> There's really no excuse for not knowing Perl and Python these days.

any excuse to not know python is a good and valid one. any.
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump
Reply With Quote
  #6   (View Single Post)  
Old 6th February 2010
tetrodozombie tetrodozombie is offline
Real Name: bill slusser
Banned
 
Join Date: Dec 2009
Location: atlanta, ga
Posts: 82
Thanked 1 Time in 1 Post
Default

I've been programming a lot of Action Script 3.0 these last three years. I've used Ruby on Rails as the back end, but found Rails easy while Ruby was a thorn in my side the whole time. To be honest, Ruby rocks, but it's too abstract for me right now. The conventions in the language are constantly throwing me off because of my background being Java Script, Java, AS3 which all three are so similar if you can program one, picking up the other two is very straight forward.

Python is like roddierod said bringing some of the joy I've lost in programming back. My first attempts to program on my own were with Basic on the Commodore 64. Python works like it should. Ruby would call this principle the principle of least suprise. I like Python better than ruby and wish rails ran on Python, which is why I was seriously taking a look at Django.

I've spent a few times trying socket programming with C. Still, C isn't second nature to me. Neither is Python. Not the way AS3 is. I'd like to get at last 1 scripting language down second nature. And, get C down second nature. Then, I feel I will really be in a good place programming wise. I don't like making programs in a language that isn't like an extension of my mind b/c I feel like I'm debugging all the time. When you've got a language down second nature, you feel the force flowing through your system and it's almost a spiritual transcendental experience. I know all you guys who have at least one langauge down second nature know that feeling.
Reply With Quote
  #7   (View Single Post)  
Old 6th February 2010
Carpetsmoker's Avatar
Carpetsmoker Carpetsmoker is offline
Real Name: Martin
Old man from scene 24
 
Join Date: Apr 2008
Location: Eindhoven, Netherlands
Posts: 2,051
Thanked 198 Times in 156 Posts
Default

@j65nko:
That's their opinion, not sure if you mean to imply that that's also yours or if it's jut a random quote ...?
Anyway, you can copy Python, so I don't know what he's doing ... Also, style(9) doesn't really apply since Python looks different from C anyway. I don't understand some people's fetish for curly braces and semicolons ...
__________________
UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things.
Reply With Quote
  #8   (View Single Post)  
Old 6th February 2010
TerryP's Avatar
TerryP TerryP is offline
Arp Constable
 
Join Date: May 2008
Location: USofA
Posts: 1,547
Thanked 112 Times in 104 Posts
Default

I've come to prefer Python: it makes my life easier. In researching various languages and their utility for cross platform development, with particular eyes on FreeBSD and Windows; I found Python to be much less trouble then Ruby, although getting support for the correct versions can be problematic in some cases (e.g. Panda). My research also makes me wonder if Common Lisp is the best language available... lol.


Both Ruby and Python are very fine languages and both have survived me as "General purpose language for new projects and scripts" for years at a time. I look at comparing them much the same as comparing Java and C++, they are about the same in that regard to be different beats. I find Ruby better suited for interactive usage (irb), but like wise that Python has considerably better documentation on how to use stuff - that's why I prefer Python. The documentation is just several times better then Rubies was, when I took up using Python, and I expect it still is that way. My only complaints about Python, missing dictionary keys are exceptions rather then None (more logical but also more inconvienant), and that regular expressions are not built into the language. I like how Perl mates regular expressions directly into the language, Ruby does this to a lesser extent (in fact, I often use a Ruby regexp reference when I need a regex reference for any language), but Python implements it through the re module. I don't like the re module, because I feel it unnatural compared to Perl, but re does do what's needed most of the time.


I have dabbled with Django and have no problems with it, but I have never used Rails. My use of both languages is oriented on developing cross platform applications and task specific tools, not web development. If I was going to do serious web development in any language, I would probably want something like GWT. So that would likely suggest using something like Pyjamas or RubyJS rather then Django/Rails, given my experience with using core Ruby classes and third party modules in every language, I would probably opt for Pyjamas. More likely I would be forced to use PHP, and therefore develop something around it that I can 'live with'.




Quote:
Originally Posted by roddierod View Post
It takes a week to grab the basics - depending on where you are coming from language-wise.
It actually took me parts of 3 days. One to study Python, one to learn Qt through the C++ docs and Python bindings, and a third to experiment in using them together non-trivially. It would've gone faster if I hadn't skipped using any C++ OOP features for a couple years lol.
__________________
My Journal

Thou shalt check the array bounds of all strings (indeed, all arrays), for surely where thou typest ``foo'' someone someday shall type ``supercalifragilisticexpialidocious''.
Reply With Quote
  #9   (View Single Post)  
Old 6th February 2010
J65nko J65nko is offline
Administrator
 
Join Date: May 2008
Location: Budel - the Netherlands
Posts: 3,116
Thanked 182 Times in 149 Posts
Default

Quote:
Originally Posted by Carpetsmoker View Post
@j65nko:
That's their opinion, not sure if you mean to imply that that's also yours or if it's jut a random quote ...?
Does a reporter in Haiti agree with the earthquake?

Quote:
Anyway, you can copy Python, so I don't know what he's doing
You lose the tab characters, CNTRL-I's, if you copy and paste with the mouse from one xterm to another one.

The same issue happens with Makefiles. A makefile operator line, the command to (re)create the target, must be preceded with a tab character.
See http://www.daemonforums.org/showthre...4257#post29665 , where I warn for this.
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump
Reply With Quote
Old 6th February 2010
ocicat ocicat is offline
Administrator
 
Join Date: Apr 2008
Posts: 2,833
Thanked 190 Times in 160 Posts
Default

Since there are two topics in this poll:
  • Quote:
    Originally Posted by J65nko View Post
    The following response is more indicative of the OpenBSD developers' collective opinion:

    http://marc.info/?l=openbsd-misc&m=123044348520838&w=2

    Basically, Perl was adopted into base first.
    Quote:
    Originally Posted by Carpetsmoker
    Anyway, you can copy Python...
    Even if indentation could be preserved in a cut-and-paste operation, rarely is the target at the same indentation level as the original. Additional fussing has to be spent lining everything appropriately to be syntactically correct. Having worked on large Python projects, copying code is not as trivial as it should be.
    Quote:
    Originally Posted by TerryP
    I find Ruby better suited for interactive usage (irb), but like wise that Python has considerably better documentation on how to use stuff - that's why I prefer Python.
    What you are seeing is the difference in cultures. Python has been around significantly longer than Ruby, & with Google's embrace of the language, Python's documentation has gotten noticeably better during the last few years. If it wasn't for Rails, Ruby would still be an obscure language coming from Japan.

    Not to digress, but what makes any one language "successful" in the marketplace over another is an interesting study. Ruby is very popular in Japan, but it has not taken on here in the US outside of the Rails phenomena. I have seen it stated that it didn't help that Matz' command of English is minimal, & his first O'Reilly book on Ruby was poorly translated. With the popularity of Rails, a number of solid books penned by a later generation of Ruby enthusiasts have been published, but I don't suspect that Ruby offers enough of a different feature set for it to become a dominant player.

    But I will also take the moment to place devil's advocate. While I too like Python for its lack of syntactic cruft, Ruby is more pure when it comes to being an object-oriented language. Everything is an object. Thus, everything can have related methods applied. This can lead to some very powerful code, & it is not a surprise that Martin Fowler championed Ruby here in the US over a decade ago.

    On the other hand, Python had object extensions tacked onto the language long after its inception, & it shows. I have not studied Python3 enough to have an opinion, but I suspect that providing any level of backward compatibility will hamper Python from becoming as syntactically powerful as Ruby.
    Quote:
    Originally Posted by tetrodozombie
    I hear the Python interpreter is a lot faster than the Ruby interpreter.
    I haven't seen published benchmarks lately, but Ruby offers a lot of its feature set through runtime binding. This has both its good & bad aspects. I also know that the Ruby community is working on making their interpreter more efficient too.
  • Quote:
    Originally Posted by Carpetsmoker
    I tried both Django and Zope, and found them to be rather big and complicated...
    Here, I agree with you. While Django, Zope, TurboGears, etc. all have their followings, none have had the success of Rails. The popularity of libraries & frameworks don't always follow from the popularity of their underlying languages.
Reply With Quote
Old 6th February 2010
Carpetsmoker's Avatar
Carpetsmoker Carpetsmoker is offline
Real Name: Martin
Old man from scene 24
 
Join Date: Apr 2008
Location: Eindhoven, Netherlands
Posts: 2,051
Thanked 198 Times in 156 Posts
Default

Quote:
Originally Posted by J65nko View Post
Does a reporter in Haiti agree with the earthquake?
Haha, well, maybe I didn't formulate my question very well, my question was whether you were reporting your opinion by proxy, of if you were just reporting some quotes ... It would seem the last was the case

Quote:
Even if indentation could be preserved in a cut-and-paste operation, rarely is the target at the same indentation level as the original. Additional fussing has to be spent lining everything appropriately to be syntactically correct. Having worked on large Python projects, copying code is not as trivial as it should be.
I never had any problems copying the TAB characters, come to think of it, that may be due to the fact I mostly copy my code inside Vim tabs and almost never from xterm to xterm.
But yeah, if you copy a post from a different level then that won't work work of course ... I haven't worked on any large projects, but Vim deals with this pretty well IMO (Using < and > with visual mode for example) ... But yeah, I can understand this can be a problem, Python isn't perfect.
__________________
UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things.
Reply With Quote
Old 6th February 2010
TerryP's Avatar
TerryP TerryP is offline
Arp Constable
 
Join Date: May 2008
Location: USofA
Posts: 1,547
Thanked 112 Times in 104 Posts
Default

Quote:
Originally Posted by ocicat View Post
On the other hand, Python had object extensions tacked onto the language long after its inception, & it shows. I have not studied Python3 enough to have an opinion, but I suspect that providing any level of backward compatibility will hamper Python from becoming as syntactically powerful as Ruby.
I first encountered Python in the 2.4'ish days so that's where I'm most used to it. Compatibility is quite broken between major versions but not shorter gaps. Aside from issues relating to string types, you can easily write code that will run on Python 2.6 and 3.1 without much trouble. General compatibility between 2.6 and 3.1 is very good (by design), but for example, don't expect 3.1 and 2.2 code to work together.

Since the early days Python has gotten better with the OO stuff, but culturally, it's not as ingrained as with Ruby. I'm almost surprised that Ruby doesn't follow closer to Java / C# in some ways.
__________________
My Journal

Thou shalt check the array bounds of all strings (indeed, all arrays), for surely where thou typest ``foo'' someone someday shall type ``supercalifragilisticexpialidocious''.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
apache with python deadeyes FreeBSD Ports and Packages 1 27th August 2009 01:31 PM
py-yaml - Python 2.5 and 2.6 iGloo FreeBSD Ports and Packages 0 20th December 2008 08:36 PM
ruby execute commands remotely Dr_Death_UAE Programming 0 18th August 2008 11:23 AM
Ruby-gem problem giga FreeBSD Ports and Packages 2 21st July 2008 02:34 PM
Ruby qtruby installation map7 Programming 6 17th July 2008 06:00 AM


All times are GMT. The time now is 11:55 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick