Jump to content

  • Log In with Google      Sign In   
  • Create Account


Why do I need to learn Python?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
17 replies to this topic

#1 PnP Bios   Banned   -  Reputation: 490

Posted 06 December 2004 - 04:16 AM

From what I understand, the Comp Sci classes I am about to take as a part of my Computer Engineering degree are going to be python heavy. I have been doing the C thing for some time now, and I wonder if there is a reason to take the class, or try to test out, like I did for the C++ one. Any of you Comp SCI/ENG students/grads want to throw some advice my way? This is like a fundamental or an intro class to computer science, but it gets lumped in with computer engineering. I tried python for a while, and found it to simple. What can it really do?
HxRender | Cornerstone SDL TutorialsCurrently picking on: Hedos, Programmer One

Sponsor:

#2 kordova   Members   -  Reputation: 138

Posted 06 December 2004 - 04:21 AM

You couldn't have tried it for very long if you found it too simple... Are you sure that it was simple because you only tried out the initial examples of the language?

Anyway, if your background is primarily C and similar languages, I'd recommend taking it to "broaden your horizons" a bit. If nothing else, learning something different will make you think about the same problems in different ways.

OTOH, if you're not really into programming in general then I'd drop it.

#3 PnP Bios   Banned   -  Reputation: 490

Posted 06 December 2004 - 04:26 AM

Yes, I am big time into programming. I just checked their website again, and it looks like it can do CGI scripts, which could be fun. Looks easier than creating servlets in java anyways.

I guess I will just take the class.

#4 Pxtl   Members   -  Reputation: 354

Posted 06 December 2004 - 04:33 AM

First off, the C/C++ paradigm of heavy, slow-to-code, hyper-optimised languages is only half the computing world, and a rapidly shrinknig half at that. Learning a good RAD admin language is crucial to your skillset, and Python is very good at that. For example, I coded a full cross-platform GUI driven wrapper for Amazon.ca's product system for an assignment over a weekend as my first substantial Python project for school. Meanwhile, it took me that long to code a freaking red-black tree in Java.

Plus, Python will teach you about many aspects of OOP that you don't get in C++ that other real, optimized languages like Lisp and Dylan have, for example closures, generators, metaclasses, and various other things. C++ really only implements a small subset of the OOP paradigm - inner classes alone (that Java brings to the table) open up whole worlds of possibilities. Python is an "everything and the kitchen sink" language, so you'll come out with a fetish for linguistic design.

Ultimately though, the best part of coding in Python will be playing with its C implementation. Python is an extremely well-documented opensource project, and its a somewhat slow language, so a common thing to do in Python is to code modules or classes in C using the Python C API and accessing them from within the Python interpreter. This lets you really optimize the tight parts in C while you explore the higher logic in Python. Plus, the interfaces from within Python are the same for C and Python, so you can easily code a module in Python and then, when you're settled with it, re-implement it in C for the efficiency benefit.

#5 Pxtl   Members   -  Reputation: 354

Posted 06 December 2004 - 04:34 AM

Quote:
Original post by kordova
You couldn't have tried it for very long if you found it too simple... Are you sure that it was simple because you only tried out the initial examples of the language?

Anyway, if your background is primarily C and similar languages, I'd recommend taking it to "broaden your horizons" a bit. If nothing else, learning something different will make you think about the same problems in different ways.

OTOH, if you're not really into programming in general then I'd drop it.


Well, for server scripts most people use a special Python based all-in-one webserver/scripting language/database solution called Zope. Again, this is a reflection of Python's "Batteries Included" paradigm.

#6 Oluseyi   Staff Emeritus   -  Reputation: 1670

Posted 06 December 2004 - 05:08 AM

Quote:
Original post by Pxtl
Ultimately though, the best part of coding in Python will be playing with its C implementation. Python is an extremely well-documented opensource project, and its a somewhat slow language, so a common thing to do in Python is to code modules or classes in C using the Python C API and accessing them from within the Python interpreter. This lets you really optimize the tight parts in C while you explore the higher logic in Python. Plus, the interfaces from within Python are the same for C and Python, so you can easily code a module in Python and then, when you're settled with it, re-implement it in C for the efficiency benefit.
You forgot about Psyco.

@PnP Bios:
Knowing C and C++ won't do you much good. There are paradigms and techniques that those languages are ill-suited for (cue somebody whining about how C++ is multiparadigm, blah blah). Take the class. You'll learn more than you expected.

#7 CoffeeMug   Members   -  Reputation: 852

Posted 06 December 2004 - 05:13 AM

Quote:
Original post by Pxtl
Plus, Python will teach you about many aspects of OOP that you don't get in C++ that other real, optimized languages like Lisp and Dylan have, for example closures, generators, metaclasses, and various other things.

Closures have nothing to do with OOP. Furthermore, you can use closures (albeit somewhat limited) in C++.

#8 Oluseyi   Staff Emeritus   -  Reputation: 1670

Posted 06 December 2004 - 05:15 AM

Quote:
Original post by CoffeeMug
Quote:
Original post by Pxtl
Plus, Python will teach you about many aspects of OOP that you don't get in C++ that other real, optimized languages like Lisp and Dylan have, for example closures, generators, metaclasses, and various other things.

Closures have nothing to do with OOP. Furthermore, you can use closures (albeit somewhat limited) in C++.
Strictly speaking, neither do generators or metaclasses. There are introspection frameworks for C++, too.

#9 Ravuya   Moderators   -  Reputation: 127

Posted 06 December 2004 - 05:26 AM

Python is great. With the PyGame library you can hack together games in minutes, it's a fast RAD environment (particularly for networking and GUI apps) and it's a lot cleaner than other "learner languages" (*cough*PASCAL*cough*).

As a bonus, the syntax is not far off from C++.

#10 graveyard filla   Members   -  Reputation: 583

Posted 06 December 2004 - 05:57 AM

from the small amount of experiance i had with Python, i really enjoyed it. i found it a little too much work to embed in C++ though and used Lua instead. also, from what everyone told me, Python is more suited to be the core language of a game with C embedded into it, and not vise versa. the only thing that bothered me about Python was the indentation-instead-of-brackets thing. i'd rather see brackets, but then again i'm probably just spoiled by C++.

#11 Woodsman   Members   -  Reputation: 426

Posted 06 December 2004 - 06:16 AM

Could anyone list some good Python sites and/or books? Specifically with relation to OpenGL development with it? (Not to derail the thread...)

#12 Drevay   Banned   -  Reputation: 100

Posted 06 December 2004 - 06:20 AM

Quote:
Original post by Woodsman
Could anyone list some good Python sites and/or books? Specifically with relation to OpenGL development with it? (Not to derail the thread...)

Python.org - the tutorial covers the basics of the language, which you can learn in a day or two.

Then you might want to Google PyOpenGL, which I believe is available for the 2.3.x series now. Also, give PyGame a search, it's an SDL port which is very, well, easy to learn and fun to play with.

Have fun.

#13 temp_ie_cant_thinkof_name   Banned   -  Reputation: 100

Posted 06 December 2004 - 06:25 AM

I'm probably going to be the first one to say this, but

Don't take the Python!

Don't you see what it does to everyone!!! It makes them make other people take it and it never stops consuming. Resist!! Assembly pwns all btw.

#14 Woodsman   Members   -  Reputation: 426

Posted 06 December 2004 - 06:27 AM

Quote:
Original post by Drevay
Quote:
Original post by Woodsman
Could anyone list some good Python sites and/or books? Specifically with relation to OpenGL development with it? (Not to derail the thread...)

Python.org - the tutorial covers the basics of the language, which you can learn in a day or two.

Then you might want to Google PyOpenGL, which I believe is available for the 2.3.x series now. Also, give PyGame a search, it's an SDL port which is very, well, easy to learn and fun to play with.

Have fun.
I have done a little work in Python. I have to learn it (it with OGL, rather) soon for work. Thanks a lot for the names, I had found a few things but wasn't sure on the best approach. I'm not sure what they're using, exactly, so I figure anything is a step in the right direction. Cheers.

#15 bastard2k5   GDNet+   -  Reputation: 238

Posted 06 December 2004 - 06:35 AM

Python is a nice language, not my preferred language, but it is nice.
Learning Python is a very nice book to have for beginning the Python language. There is also Programming Python. The Python.org tutorial is also fairly nice.
for OpenGL there is PyOpenGL


#16 Arild Fines   Members   -  Reputation: 968

Posted 06 December 2004 - 09:18 AM

Quote:
Original post by CoffeeMug
Furthermore, you can use closures (albeit somewhat limited) in C++.

How?

#17 Zahlman   Moderators   -  Reputation: 1682

Posted 06 December 2004 - 10:08 AM

@Arild: He may be thinking along these lines?

Anyway. Python offers HUGE amounts of "hack value" to the experienced programmer; I'm still discovering fun little bits of it. The introspection blows Java's out of the water. (Hell, you can even change an object's __class__ - the underscores are not for emphasis but to illustrate the language syntax :) ) You get to play with a bunch of FP toys while keeping a relatively familiar syntax. At the cost of having to keep a little more organized and disciplined, you practically get all of the good things about Perl (except CPAN) with none of the bad.

#18 capn_midnight   Crossbones+   -  Reputation: 1375

Posted 06 December 2004 - 10:14 AM

a lot of organizations use python for their live code, such as NASA. They say that it is easy to develop good code, quickly. Python has some nice features. In my first 15 minutes of learning the language (okay, it was 15 minutes and 10 seconds, I was actually timed) I wrote a script to print out a circle of periods on the screen.
[See some of My Projects] - [Find me on twitter tumblr G+ Github]




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS