views:

403

answers:

12

I thought I'd start learning a real programming language from scratch. I can manage to code in C++, but I haven't been brushing up on my C++ skills at all.

This time I'm teaching myself. And I've decided on python. Is it the right language for me? I'm just being an enthusiastic kid, and I'm not learning for any strict purpose (rather than just programming for the heck of it ;)

One more question on the sly, does python support OOP?

Should I start using a thirdparty IDE straightaway or shall I stick to IDLE?

+4  A: 

Python will be good for this. So get busy. :)

It is object-oriented, but not as strictly as others.

Jweede
"Not as strictly"? I think it's pretty strict. There are no class casts (like with C++) that cause segmentation faults. Perhaps you mean, "no static variable type declarations like others".
S.Lott
Thanks for the link..The book looks interesting, though for now I'm sticking to the official non-programmers guide. Let me get through that first..
thunderror
encapsulation is not as strictly enforced. I considered this was a property of object-orientation. I could be wrong however.
Jweede
I imagine he means that you don't have to write object-oriented programs. Procedural and functional styles are both well-supported in Python.
gbc
+1 for dive into python. That's how I learned it in College.
Brian
@Jweede: Encapsulation is a design principle. Python has it. Privacy, however, is an implementation quirk it doesn't have. It uses an "implicitly public" rule instead of Java (and C++) "implicitly private except in the same package" rules. Privacy != encapsulation. I supposed one could call that "not as strict". I think that "strict" goes with "no casting". In which case Python is very strict.
S.Lott
It's also worth noting that if you follow naming conventions (`public_method', and `__private_method`) Python does some name mangling that makes it a very bad idea to touch private methods.
Imagist
That's good to know.
Jweede
+1  A: 

I would suggest C#. If you have some experience with C++, C# should be pretty easy to pick up. Python works too, but I'd say maybe save it for later because it's more of a functional language with dynamic typing (meaning the variable datatypes are determined at runtime, not compile time), so it's more deviant from 'traditional' languages such as C# and Java.

Daniel T.
and therefore a good thing to broaden the mind ;-)
djna
so, how does it really affect? does it matter that it is "deviant"?
thunderror
Thunderror, not it doesn't really matter, but when you're applying for a job and you tell them that you know LISP, Prolog, and D, they may not care unless that's what they're specifically looking for. In other words, learn a major language first so you're commercially viable, then learn the other ones which improves your programming prowress.
Daniel T.
Hmmmm..Well, I'm not exactly learning it for a job because I'm a Chartered accountant (CPA) by profession. But I might put it on my profile..
thunderror
+17  A: 

Is it the right language for me?

It is.

does python support OOP?

It does.

EDIT

I would suggest you to take a look at Google App Engine. While is not meant as a Python tutorial I think it is much better to learn and see your work "live" than just creating castles in the air.

It is also very easy to create a Hello World app.

If you are starting to learn how to program this would be a good 2nd task to do ( rather than first )

OscarRyz
the google app engine was one of the reasons I got around to learning all about python in the first place..but shouldn't I get my basics right first??
thunderror
@thunderror That's why it's the 2nd task. :)
Jweede
+1, and perhaps starting with Python 3 straight away is a better choice, too, because of some cleanup of legacy warts that happened there.
Pavel Minaev
Mmm, yes Python 3. Definitely start there. I should have started there this second time I've gotten into Python. I did python 3 years ago, drifted to Ruby, then dabbled in Java, then back to Ruby, and finally home to Python last fall. Make sure you learn Python 3.
Jonathanb
You sir, are bold. But I must agree.
sheepsimulator
+1  A: 

I think every programmer should be well enough at "C" and i believe C is a real programming language.
If you are looking for OOP.. then C++,python,C# may be your choices.
I personally prefer compiled languages over interpreted ones because you can closely follow what is going on and they are faster as well.

Neeraj
Is C a real programming language? Why not Assembly? It's compiled and you can follow __very__ closely what's going on.
Jweede
Yeah, and I guess with my exposure to C++, I find python a bit weird too..Don't know why though..
thunderror
@JweedeAah C is not as difficult to program as assembly and btw can you tell why C and not python or C# forms the basis of most introductory classes in programming..
Neeraj
Most colleges teach either Java or C++ for Programming intro courses. But C has an important place in a CS education, no doubt.
Jweede
Knowing C is a good idea for everyone, but it doesn't make a good language to _learn to program_, which is what the question is about.
Pavel Minaev
Very good point Jweede, C should be taught in every CS curriculum because you really get a good idea of what's going on in memory instead of abstracting everything into a class/ADT. It's only when you understand what's going on with pointers and memory allocation, that you know what NullPointerExceptions and memory leaks really mean.
Daniel T.
-1 for "real programming language". C is a good and important language to know, but it's not the only "real" programming language. People should be choosing the appropriate language for a task, not just always choosing C because it's fast and allows you to look at the resulting assembly.
Imagist
+5  A: 

Python is a great language to learn. It has all the language features required to practice OOP, but is flexible enough to be used procedurally or functionally as well. While some folks are turned off by the use of indentation to structure your code, it is actually a boon when learning since it forces you to keep clean formatting of your code and teaches you to write code in a readable fashion.

Another advantage of learning with Python instead of a traditional compiled language is that you can play with your code interactively. You can run the Python interpreter and poke your objects to get a feel for how your code works. This sort of experimentation is a great learning tool.

Python also has a lot of library support built-in, so chunks of functionality that could require many lines of code in other languages are often trivial to implement in Python.

As your skill level grows, you'll find Python continues to be a useful tool in your toolbox for all sorts of programming tasks: web development, simple scripting, or desktop applications.

Good luck, and have fun!

gbc
thanks :) That's precisely what got me into Python, IDLE is so damn addictive and fast..its like playing a video game..
thunderror
+10  A: 

Python is an excellent beginners language. That's why I use it! :)

The link above is excellent if you feel you're advanced beginner with you C++ or a quick learner. Think like a Computer Scientist is another that starts at a much lower level. And don't forget The Tutorial.

Personally, I find I think in Python better than I do any any other language. It's a great experience when you get into a problem and you're coding away and you suddenly realize the bottleneck isn't your head, it's your fingers. With Java, I never made it to that point. With Ruby, I got close, but it never really clicked. With Python, I was there in less than a week (less than 8 hours of dedicated coding, since I only get an hour or so a day). Now, my 45-50 WPM typing speed just can't keep up with my brain's code output for most of the time I'm coding.

Jonathanb
"45-50 WPM typing speed just can't keep up with my brain's code output" wow. I've only heard of that for assembly programmers back in the day (because its so repetitive).
Dustin Getz
To be fair, I usually spend all day thinking to myself, "How am I gonna solve that when I get home." But, that still means Python is clean enough I can hold the code to solve problems like the Project Euler problems in my head so when I sit down to do it all I have to do is type out my internal dictation.
Jonathanb
@Jonathanb: You should definitely examine APL ;-)
Vanya
+4  A: 

G'day,

For Python you might like to look at the excellent book "Dive into Python" by Mark Pilgrim.

There's a free version available as well.

HTH

cheers,

Rob Wells
yup..just got that today, but for now I've just started off with the non-programmers guide.
thunderror
*Dive into Python* is intended for programmers with experience programming in other languages. I don't think that it's a good beginner's book.
Imagist
@Imagist, the asker states in the question that he's not a newbie. Hence, the recommendation.
Rob Wells
A: 

Java...with out a doubt my answer would be Java. C# would be a close second but Java is more widely used especially in the academic and open source world.

gshauger
+2  A: 

I had been doing mostly C++ for a few years when I needed to write a script for something. I decided to do this in Python, and my am I glad I did! It really struck me how obvious the Python syntax is (at least for the most part). I was basically doing what sounded like the reasonable thing to do - and mostly that was correct.

So - learning Python is plain fun, and is surely a nice pick. Whether it is the right for you depends on what you want to do, but it sounds like you just want to play around with something. Having Python in your toolbox at a later time when you maybe work with some other language will always come in handy. So I'd say go for it! And good luck :-)

stiank81
+1  A: 

Choose the language that is common with your peers, as they will be of great support for you when you learn.

Alternatively, learn Python and show them who The Real Man is. :)

Daniel Mošmondor
A: 

Python is probably the best answer for you. You'll be able to learn many programming and software engineering paradigms with it. Designing, programming, testing, refactoring, and documenting software with Python is easy, fast and enjoyable (just ask around ;-)

+1  A: 

NOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO.

Just kidding it's an amazing language. And you are awesome.

pageinventor