ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Hey,
I'm pretty new to Linux, about a month or so and I am really wanting to begin learning a programming language which I can use a lot while I'm on Ubuntu but I am unsure of which language to try and learn.
I have done a little bit of Python and even Pascal in the past but I don't know what the benefits of the languages in the title are.
I want something that I can use a lot, will find I can write my own programs or make addon-like codes for already existing programs so that they work how I want them to or something and that's not going to be so hard to learn and also, writing programs that can connect to the internet to do various things and also reading data from other files.
I was just wondering if someone would be able to help me a little bit in deciding out of these three which would be the best for what I am wanting to do?
And I hate to say it, but there's not going to be a definitive answer! The truth is eventually you'll end up learning several languages anyway, and it's probably fair to say that once you know one language you can easily pick up others.
For what it's worth I would discount Ruby. Don't get me wrong, I think it's a great language but it's lacking documentation (in comparison with the other two languages you mention), there are far fewer projects written in it (that aren't Ruby on Rails at least) and you say you want to be able to extend existing programs, and there's no real advantage in using it over using C++ or Python.
Both Python and C++ are very capable languages. Python is quite structured and tends to follow the philosophy that there is one good way to do something (in comparison to Perl's attitude that there are a million and one ways to achieve a goal!). It should teach you good practice.
C++ is very powerful but has certain idiosyncrasies that make it a bit harder for a beginner: things like pointers, references and a compiler whose error messages are not always the most intuitive when trying to debug some code.
I think you'll see results quicker with python which will keep you encouraged. There are lots of projects using python, excellent documentation, a wealth of tutorials online and a load of libraries to do everything from update a twitter status to writing games (pygame is very good). Once you're comfortable with python you can decide where to go from there: hone your skills with it or start learning a different language (maybe C++). It's always useful to have multiple strings on your bow
There certainly will be at least a difference of opinion over the definitive answer. In my opinion, C++ is much better.
Quote:
Python is quite structured
The meaning of the word "structured" is unclear enough to allow that claim. But Python is quite unstructured and that makes it too easy for slapping together unmaintainable code and too hard for building larger well structured projects.
Quote:
C++ is very powerful but has certain idiosyncrasies that make it a bit harder for a beginner:
I can't argue with that.
Quote:
things like pointers
But I will argue with that. I think pointers are a fundamental requirement of a truly powerful programming language. Most languages lack pointers and that is a serious flaw in most languages.
Beginners in C do tend to make mistakes with pointers, partially because they are taught badly and partially because you need pointers in C in a few situations where C++ has better alternatives. A beginner does not need to be confused by pointers in C++.
Do you know what you want to do with this programming language? there are some applications for which the scripting languages (Python and Ruby) are more appropriate than C++, and some for which C++ is more appropriate.
But Python is quite unstructured and that makes it too easy for slapping together unmaintainable code and too hard for building larger well structured projects.
how long have you been coding in Python to make you say that? Have you coded a large Python project before?
You may wish to look at Lua as something to consider too. Of the three listed however, I would be most likely to learn Python, it's the generalist of the bunch and has better documentation than ruby and is easier to learn than C++. Any of the languages will serve you well though it just depends on what specific use you want to gain out of them.
And I hate to say it, but there's not going to be a definitive answer! The truth is eventually you'll end up learning several languages anyway, and it's probably fair to say that once you know one language you can easily pick up others.
For what it's worth I would discount Ruby. Don't get me wrong, I think it's a great language but it's lacking documentation (in comparison with the other two languages you mention), there are far fewer projects written in it (that aren't Ruby on Rails at least) and you say you want to be able to extend existing programs, and there's no real advantage in using it over using C++ or Python.
Both Python and C++ are very capable languages. Python is quite structured and tends to follow the philosophy that there is one good way to do something (in comparison to Perl's attitude that there are a million and one ways to achieve a goal!). It should teach you good practice.
C++ is very powerful but has certain idiosyncrasies that make it a bit harder for a beginner: things like pointers, references and a compiler whose error messages are not always the most intuitive when trying to debug some code.
I think you'll see results quicker with python which will keep you encouraged. There are lots of projects using python, excellent documentation, a wealth of tutorials online and a load of libraries to do everything from update a twitter status to writing games (pygame is very good). Once you're comfortable with python you can decide where to go from there: hone your skills with it or start learning a different language (maybe C++). It's always useful to have multiple strings on your bow
Good luck.
KK
Thanks for that advice.
I may say though, that this is not my first programming language. I also done some work on Windows with Visual Basic .NET and also attempted Visual C# .NET which was a little confusing after VB but I think now is the time I tried not relying on the IDE so much and went for the languages that only really needed a text editor at least.
But yeah, thanks again. I think I'll go for Python and go from there in the future
how long have you been coding in Python to make you say that? Have you coded a large Python project before?
The only thing I've ever done in Python (and far too often) is repair and enhance code in badly structured large programs written by others. I've never written any new Python program from scratch and have no interest in doing so. (When I write from scratch I can select the language).
I also programmed in C++ that same way for quite a while before ever writing a program from scratch, just fixing and enhancing code in projects that were large before I got near them.
Probably the difference in quality of structuring was magnified by the generally low skill level of the programmers who proceeded me on those projects. But there is a real difference in the language characteristics that led equally bad programmers to build worse project structure in Python than in C++.
Hey,
I'm pretty new to Linux, about a month or so and I am really wanting to begin learning a programming language which I can use a lot while I'm on Ubuntu but I am unsure of which language to try and learn.
I have done a little bit of Python and even Pascal in the past but I don't know what the benefits of the languages in the title are.
I want something that I can use a lot, will find I can write my own programs or make addon-like codes for already existing programs so that they work how I want them to or something and that's not going to be so hard to learn and also, writing programs that can connect to the internet to do various things and also reading data from other files.
I was just wondering if someone would be able to help me a little bit in deciding out of these three which would be the best for what I am wanting to do?
There certainly will be at least a difference of opinion over the definitive answer. In my opinion, C++ is much better.
The meaning of the word "structured" is unclear enough to allow that claim. But Python is quite unstructured and that makes it too easy for slapping together unmaintainable code and too hard for building larger well structured projects.
I can't argue with that.
But I will argue with that. I think pointers are a fundamental requirement of a truly powerful programming language. Most languages lack pointers and that is a serious flaw in most languages.
Beginners in C do tend to make mistakes with pointers, partially because they are taught badly and partially because you need pointers in C in a few situations where C++ has better alternatives. A beginner does not need to be confused by pointers in C++.
I don't disagree with you, C++ is my language of choice at home (at work I'm stuck with Delphi ) and I don't necessarily think pointers are difficult, but I do think there are more important things for a beginner to learn before having to worry about pointers, memory allocation, slicing problems, etc.
I would almost certainly encourage the learning of C++ at some stage, but I also believe there are concepts essential to programming that can be better learned elsewhere first to get a sound understanding of the basics before progressing onto more difficult concepts.
Were it on the list I would probably suggest Java (or C#) as having several of the benefits of C++, encompassing most of the essential programming concepts but essentially avoiding pointers.
I'll also say that I wouldn't tell the OP he'd made a mistake if he chose C++ as I do think it's a great language, and which ever language he chooses he's eventually going to have to get around to covering all the necessary concepts anyway
(I would still stay away from Ruby though, for the reasons I mentioned earlier)
The only thing I've ever done in Python (and far too often) is repair and enhance code in badly structured large programs written by others.
If you are able to repair and enhance large Python code, that tells you something isn't it?
Quote:
I've never written any new Python program from scratch and have no interest in doing so. (When I write from scratch I can select the language).
then how would you know something isn't what its supposed to be when you haven't even tried it.?
Quote:
I also programmed in C++ that same way for quite a while before ever writing a program from scratch, just fixing and enhancing code in projects that were large before I got near them.
Quote:
Probably the difference in quality of structuring was magnified by the generally low skill level of the programmers who proceeded me on those projects. But there is a real difference in the language characteristics that led equally bad programmers to build worse project structure in Python than in C++.
An example for you.
2 equally bad programmers, 1 using C++, the other using Python. Both write bad code. BUT the one who writes with Python has no choice but to indent his code properly, because otherwise his program won't work. Now you go and read their code, which one do you prefer, ( even though the other parts may be badly written ) ? the one which has at least indentation proper, or the one without?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.