Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old May 16th, 2006, 3:31 PM   #21
Infinite Recursion
Programming Guru
 
Infinite Recursion's Avatar
 
Join Date: Jul 2004
Location: United States
Posts: 3,467
Rep Power: 8 Infinite Recursion is on a distinguished road
Send a message via MSN to Infinite Recursion Send a message via Yahoo to Infinite Recursion
I'd suggest learning them both... C++ first, then Python.
As far as a linux distro: Fedora Core 5
__________________
http://jasonpowers.net

"There are a thousand hacking at the branches of evil to one who is striking at the root."
Infinite Recursion is offline   Reply With Quote
Old May 16th, 2006, 5:07 PM   #22
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
Why, when I see Infinite Recursion, do I picture a python consuming itself?
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote
Old May 16th, 2006, 5:14 PM   #23
Arevos
Programming Guru
 
Arevos's Avatar
 
Join Date: Aug 2005
Location: England
Posts: 1,499
Rep Power: 5 Arevos is on a distinguished road
Quote:
Originally Posted by Infinite Recursion
I'd suggest learning them both... C++ first, then Python.
As far as a linux distro: Fedora Core 5
I'd say Python first, then C++, and Ubuntu as the Linux distro
Arevos is offline   Reply With Quote
Old May 16th, 2006, 5:36 PM   #24
ReggaetonKing
Sexy Programmer
 
ReggaetonKing's Avatar
 
Join Date: Nov 2005
Location: New Jersey
Posts: 891
Rep Power: 4 ReggaetonKing is on a distinguished road
Send a message via AIM to ReggaetonKing
Using Ubuntu is a must! It's really great for beginners! C++, is what should be learned first, you might not even look back at Python after learning C++. But hey, who knows?
__________________
I would love to change the world, but they won't give me the source code!
ReggaetonKing is offline   Reply With Quote
Old May 16th, 2006, 5:40 PM   #25
Jessehk
The Oblivious One
 
Jessehk's Avatar
 
Join Date: May 2005
Location: Ontario, Canada
Posts: 646
Rep Power: 4 Jessehk is on a distinguished road
I would personally recommend Ruby instead of Python (and I am only mentioning it because I doubt you know it exists). It is a more complicated language, but in my opinion, much more clean (then Python).

I guess what I would recommend is Python first (to learn the basics), then upgrade ( ) to Ruby, and if you are still interested, begin the long journey to C++.
__________________
Dr. Zoidberg: [ecstatic] I'm going to a movie... with FRIENDS!
Jessehk is offline   Reply With Quote
Old May 16th, 2006, 5:47 PM   #26
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
Jesse, I downloaded Python and Ruby at the same time. I'd like to hear your comments on the Ruby syntax. We probably shouldn't hijack this thread; shall I ask in a new post?
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote
Old May 16th, 2006, 6:00 PM   #27
Impact4ever
Newbie
 
Join Date: May 2006
Posts: 2
Rep Power: 0 Impact4ever is on a distinguished road
Quote:
Ok, Linux I will check out. What about Mandrake Linux is that any good?
Ok, I'm somewhat new to programming and my first language is python. But I played with c/c++ to. I had pretty much the same complexing problem until someone told me that " this is not a real problem. Pick a language you want to learn and let that be your base for learning other languages". So it would seem that if you learn the basic concepts of programming, any language you pickup should be easy to understand. Only thing to learn is just the syntax.

Now for the OS issues...

Their isn't one! Just find out what OS you are comfortable with and start programming. What I like about linux, that it has little more development tools for programming. And it looks good running your scripts from the commandline (terminal).

FYI,

I have 4 systems. One of cousre is my XP system that does it all and great for gamming. The others has linux like, Gentoo, Slackware(If I could ever get that to work!), my laptop is running PClinuxOS. Any OS is good, just have fun writting programs.

I hope this help guy!

Impact
Impact4ever is offline   Reply With Quote
Old May 16th, 2006, 6:50 PM   #28
Jessehk
The Oblivious One
 
Jessehk's Avatar
 
Join Date: May 2005
Location: Ontario, Canada
Posts: 646
Rep Power: 4 Jessehk is on a distinguished road
Quote:
Originally Posted by DaWei
Jesse, I downloaded Python and Ruby at the same time. I'd like to hear your comments on the Ruby syntax. We probably shouldn't hijack this thread; shall I ask in a new post?
Oh, the pressure! I'll just get it out of the way.

Some examples of the reasons why I love Ruby:
  • Easy class methods:

    class Test
        def Test.do(x)
            puts "#{x} was passed as an argumnet!"
        end
    end

    The following could then called like this:
    Test.do(3)
    
    OUTPUT
    3 was passed as an argument!
  • Easy class hierarchy.
    for example:

    class Person
    	def initialize(name, age)
    		@name, @age = name, age
    	end
    
    	def to_s
    		"#@name is #@age"
    	end
    end
    
    class Student < Person
    	def initialize(name, age, average)
    		#pass the parameters to the Parent
    		super(name, age)
    		@average = average
    	end
    
    	def to_s
    		#call parent version of method first with super()
    		super + " and has an average of #@average"
    	end
    end
    
    per = Person.new("Jesse", 16)
    stu = Student.new("Anna Smith", 234, 86)
    
    puts per #calls per.to_s
    puts stu

    OUTPUT
    
    Jesse is 16
    Anna Smith is 234 and has an average of 86
  • Everything is both an object and modifiable -- including classes.

    In Ruby, one has the ability to re-open classes (everything is an object), and modify them.

    For example:

    class Integer
        def even?
            (self % 2).zero? #could also be "== 0"
        end
    end

    OUTPUT with interactive ruby:
    $ irb --simple-prompt
    >> require 'test' #name of file
    => true
    >> 3.even?
    => false
    >> 4.even?
    => true
    >>

    This little trick was recently discovered by somebody on #ruby-lang
    >> raise JesseError = Class.new(ArgumentError), "A JesseError occured!"
    JesseError: A JesseError occured!
            from (irb):7
    >>
  • Ruby has the amazing feature of blocks (which I don't feel very comfortable explaining ).

    Hopefully a visual introduction will suffice.

    Many methods take advantage of blocks. For example:

    #   Array#collect
    [1, 2, 3, 4].collect { |x| x + 2 }
    #this means for each element, take it, add 2, and keep the result
    #=> [3, 4, 5, 6]
    
    #   String#gsub -- a globab String substitution using regexp
    >> "Hello, my name is Jesse.".gsub(/[a-z]{3}/) { |match|  match.upcase }
    => "HELLo, my NAMe is JESSe."
    
    #using yield to create an iterator
    def squares_upto(n)
        1.upto(n) { |x| yield x * x }
    end
    
    >> squares_upto(10) { |square| puts square }
    1
    4
    9
    16
    25
    36
    49
    64
    81
    100
    => 1
    >>

Just a few of the things I love about Ruby; there are many others that I haven't gotten too. Thanks for listening David
__________________
Dr. Zoidberg: [ecstatic] I'm going to a movie... with FRIENDS!
Jessehk is offline   Reply With Quote
Old May 16th, 2006, 7:11 PM   #29
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
Okay, a couple questions. If you walked up and looked at this line, cold:
[1, 2, 3, 4].collect { |x| x + 2 }
Even as an accomplished programmer, what would it mean to you? Or this:
super + " and has an average of #@average"

To me, the syntax is labored, despite any slickness under the hood. On the other hand, this seems relatively straightforward:
def cmp (x, y):
    return x.contentStart - y.contentStart

def threadMenu (menuList):
    menuList.sort (cmp)
    ...
    blah, blah
List comprehension? This Python thangy seems eminently straightforward:
[3*x for x in vec if x < 2]

The fact is that I went for Ruby first. I wound up rolling my eyes and moving to Python, where I expected to discover the same belabored "Let's be gurus and complicate this unduly" attitude. I'm pleasantly surprised, I might add, and pressuring my provider to give me Python.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote
Old May 16th, 2006, 8:41 PM   #30
Jessehk
The Oblivious One
 
Jessehk's Avatar
 
Join Date: May 2005
Location: Ontario, Canada
Posts: 646
Rep Power: 4 Jessehk is on a distinguished road
Quote:
Originally Posted by DaWei
Okay, a couple questions. If you walked up and looked at this line, cold:
[1, 2, 3, 4].collect { |x| x + 2 }

Even as an accomplished programmer, what would it mean to you? Or this:
super + " and has an average of #@average"

To me, the syntax is labored, despite any slickness under the hood.
I would have to agree with you about the syntax. My thinking is that what can be accomplished is worth the sacrifice. On that same note, I would never recommend Ruby to a first time programmer.

Quote:
On the other hand, this seems relatively straightforward:
def cmp (x, y):
    return x.contentStart - y.contentStart

def threadMenu (menuList):
    menuList.sort (cmp)
    ...
    blah, blah
List comprehension? This Python thangy seems eminently straightforward:
[3*x for x in vec if x < 2]

The fact is that I went for Ruby first. I wound up rolling my eyes and moving to Python, where I expected to discover the same belabored "Let's be gurus and complicate this unduly" attitude. I'm pleasantly surprised, I might add, and pressuring my provider to give me Python.
Overall, Python is a great language (IMHO), it's just that it has a few warts that bother me. Ruby has plenty of them also.

I suppose if I was rolling out a professional product (something I have never done), I would use Python. But Ruby is just fun, especially when I can write a method and use

6.factorial

in a program.

Thanks again, David.
__________________
Dr. Zoidberg: [ecstatic] I'm going to a movie... with FRIENDS!
Jessehk is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 7:21 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC