Which Programming Language To Learn?

In summary: You'll gain experience, so I don't want to completely dissuade you from the idea, but be aware that there is a very real downside.Because of this, I would not recommend C or C++. There's time enough to learn them later. You'll be learning abstractions of programming anyway, and when you need to check the syntax, that's what manuals are for. Same with Perl.
  • #1
Ithryndil
142
0
I am currently wanting to go into Software Engineering. With that in mind I want to learn a programming language. I am planning to go back to school and major in either Computer Engineering or Computer Science (depending on which is closer to Software Engineering).

Before I go back next year, I am wanting to try and learn a programming language on my own. I feel it will definitely be beneficial to learn a programming language in the long run. There are many and some stand out more than others...such as Java, C++, Python, etc. I am not certain which language would be most beneficial. I realize in the end it would depend on where I get a job at and what they focus on...

Also, one of the course descriptions at the University of Arizona (where I am going) is as follows:

C SC 352 -- Systems Programming and Unix (3 units)
Description: Programming in C, including single and multi-dimensional arrays, lists, stacks, queues, trees, and bit manipulation. Unix topics, including debuggers, makefiles, shell programming, and other topics that support systems programming.


I am fairly ignorant in regards to programming language and I don't wish to break my wallet, so a programming language which doesn't require me to purchase expensive software would be helpful. Thank you for the advice!
 
Physics news on Phys.org
  • #2
How about Perl? You can pick it up pretty easily, there are some good beginning Perl books out there, it's pretty universal, and it's free.
 
  • #3
In what I have read it's a good one to learn. I understand that ultimately I will need to learn more than just one programming language. I have some familiarity with Java, but I don't know how much of what I learned in high school 4 years ago will come back. I also have some familiarity with Visual Basic, but same scenario. I have read that learning C is a good base as many programs "branch" out from C.
 
  • #4
C,C++, or Java with emphasis on C++. They are more commonly in use in engineering/research than Perl.

If you want to be hardcore Fortran or Assembly.
 
  • #5
Well, since this is something I am wanting to learn on my own, I don't want to pick one too difficult. Does C require any additional software, etc?
 
  • #6
A compiler and/or an IDE. Eclipse maybe as an IDE.
 
  • #7
What would a good compiler be? Also, how much do those cost?
 
  • #8
most are free. Most IDE include a compiler. The simplest thing to do is to download eclipse or another common IDE for C or whatever language you want to learn.
 
  • #9
gcc contains many free compilers for C/C++/Java and so on. It's primarily Linux/Unix-based, but you can also get a free Unix-like environment for Windows, cygwin. It's not perfect, but it's certainly worth every penny... :smile:
 
  • #10
j93 said:
most are free. Most IDE include a compiler. The simplest thing to do is to download eclipse or another common IDE for C or whatever language you want to learn.

So, Eclipse would have a compiler in it? Ah, so it looks like if I go with C I should get Eclipse for the IDE and GCC for the compiler...and then from there a good book for it. Does anyone have another language they think would be better for me or most beneficial? I am not sure what I want to do with it yet, but I think that a program that allows me to learn other programs easier would be best considering I would like to learn more later. I suppose what I am getting at is which language results in learning other languages easier (again, I don't want to kill myself in the process). Thanks again for the help.
 
Last edited:
  • #11
First, many people think a degree in CS is about learning as many programming languages as possible. Let's sweep that aside right away.

Second, be aware that learning to program on your own is almost certainly going to teach you some bad habits that you will have to unlearn. You'll gain experience, so I don't want to completely dissuade you from the idea, but be aware that there is a very real downside.

Because of this, I would not recommend C or C++. There's time enough to learn them later. You'll be learning abstractions of programming anyway, and when you need to check the syntax, that's what manuals are for. Same with Perl. Twenty years ago, I would have recommended Pascal, but it's getting quite dated. Today Python is not a bad choice, but I would seriously consider looking at Ruby.
 
  • #12
Vanadium 50 said:
First, many people think a degree in CS is about learning as many programming languages as possible. Let's sweep that aside right away.

Second, be aware that learning to program on your own is almost certainly going to teach you some bad habits that you will have to unlearn. You'll gain experience, so I don't want to completely dissuade you from the idea, but be aware that there is a very real downside.

Because of this, I would not recommend C or C++. There's time enough to learn them later. You'll be learning abstractions of programming anyway, and when you need to check the syntax, that's what manuals are for. Same with Perl. Twenty years ago, I would have recommended Pascal, but it's getting quite dated. Today Python is not a bad choice, but I would seriously consider looking at Ruby.

Thanks for the advice, and based off of what I seen regarding the University's CS program, it's not all about learning as many programming languages as possible. However, I do want to do this on my own and at the same time I feel it would be beneficial. I guess now I am back to square one. Places recommend Java, Perl, C, C++, and Ruby. I suppose I should flip a coin so to speak when choosing...but add weight to what has been discussed here so far.

Edit: If anyone has anything else to add, please let me know. I am determined to learn a language. If it helps I would like the language to be fairly easy to learn and to either not cost a lot, or to be free. Thanks again for any and all advice.
 
Last edited:
  • #13
As I mentioned before, my recommendation is Ruby. It's not particularly popular, but it is perhaps the one least likely to cause you to learn bad habits.
 
  • #14
C++ is still lingua franca. C is an introduction to C++. It would always do you good to preview C. But if you are interested in getting a jump on things, check-out the first-year programming courses you will take. You'll find them in the skoolz course catalog under course requirements for software engineering.
 
  • #15
Vanadium 50 said:
As I mentioned before, my recommendation is Ruby. It's not particularly popular, but it is perhaps the one least likely to cause you to learn bad habits.

Why would I necessarily learn bad habits from picking up a book and attempting to learn other languages? Can you explain what these bad habits are?

Also, the University of Arizona offers a http://www.ece.arizona.edu/prospective-undergrads.php" .
 
Last edited by a moderator:
  • #16
I suggest as a first language try Python.
  • It is an interpreted language so you can run the program as a script and don't need to compile first.
  • It is quite fast and efficient especially for an interpreted programming language.
  • It has a very rich set of built in data structures.
  • Its format "forces" readability and its error system makes it quite clear where you make a mistake. (This is by design.)
  • It is an OOPL (object oriented programming language) having all the desired features of a modern programming language.
  • There is a large package repository with extensions which allow many applications such as interacting with the internet, creating graphical interfaces, etc.
  • There is a mechanism for incorporating compiled c or c++ functions.
It is free to download:http://www.python.org"

Once you have some proficiency then I would suggest you learn c and/or c++.

I personally have programmed in BASIC, Fortran, Pascal, C, C++, Cobol (ugg!), Python, and some dabblings at assembly language. I find it best to work out the program in Python, get it running the way I want and then translating it to C++ when and if I need more speed. Usually I don't need that much speed and stick to Python.
 
Last edited by a moderator:
  • #17
Ithryndil said:
Why would I necessarily learn bad habits from picking up a book and attempting to learn other languages?

Because you don't know any better. Learning to program and learning a programming language are two different - and perhaps even orthogonal skills. Given that, it's probably a good idea to avoid languages more likely to have you fall into that trap.

C++ is particularly bad, since it has many different ways of doing the same thing. You can write bad code that gives the expected result, which provides positive reinforcement.

jambaugh's suggestion of Python was also my first thought, which is why I suggested Ruby. Ruby is much like Python, and has all it's advantages, but is maybe a little easier for a beginner, as it has its own interactive environment. I'd argue that it's a little more "OO" than Python as well.
 
  • #18
I would second Python (my favorite) or Ruby as a first language
Do take the C course they offer. Whatever language you use it is important to know 'C' to understand how the computer actually works. By knowing what is happening 'under the hood' you know the costs and consequences of higher level concepts in newer languages like Python. But I would certainly not try and learn c++ first (if at all)

As Vanadium said there is more to CS than programming. Some places deliberately teach using their own invented language or an obscure one such as modula-2 so that everyone starts from the same point and you aren't concerned with details of it's commercial use.
Avoid schools that just teach Java - they tend to be aimed at people that just want to go straight into a job.
 
  • #19
mgb_phys said:
Avoid schools that just teach Java - they tend to be aimed at people that just want to go straight into a job.

Agreed.

mgb_phys said:
Some places deliberately teach using their own invented language or an obscure one such as modula-2 so that everyone starts from the same point and you aren't concerned with details of it's commercial use.

MIT starts their students with Lisp. (Scheme, actually) It's not a bad choice for what they expect to teach, but it's also unfamiliar to most freshmen.

I think Python is a good choice - the reason it's not my first choice is that I think it suffers from not really knowing if it's a procedural language with some OO features or vice versa. It's neither fish nor fowl. Ruby is a little cleaner in this regard - it's OO that emulates procedural features. It's also intended for beginners.
 
  • #20
I was going to add Lisp - but I was afraid of the wrath of the Lisp hackers if I described it as obscure! MIT have switched to python in 6.001

I agree about Python's lack of purity, but for a first language that could be a plus - you can type a single line and get a result. You don't need any "public static void main()" rubbish from Java.
Ruby is just as good, although some of it's built in variables are a bit Perl-ish.

There is a movement to teach kids Javascript as a replacement BASIC, it's built into every machine (well browser) and you can see the results instantly.
I have a terrible feeling we will see the results of that in college in a few years!
 
  • #21
By the way, some languages have interactive web sites that let you explore the language. Here is the one for http://tryruby.hobix.com/" (which I have not).
 
Last edited by a moderator:
  • #22
I recommend Smalltalk, it's fully OO without all the compromises that have been mentioned with regards to Java, Ruby, Python, etc...
 
  • #23
I would not recommend Smalltalk as one's first computer language.
 
  • #24
Vanadium 50 said:
Because you don't know any better. Learning to program and learning a programming language are two different - and perhaps even orthogonal skills. Given that, it's probably a good idea to avoid languages more likely to have you fall into that trap.

C++ is particularly bad, since it has many different ways of doing the same thing. You can write bad code that gives the expected result, which provides positive reinforcement.

jambaugh's suggestion of Python was also my first thought, which is why I suggested Ruby. Ruby is much like Python, and has all it's advantages, but is maybe a little easier for a beginner, as it has its own interactive environment. I'd argue that it's a little more "OO" than Python as well.

Ok, so what I gather is that programs like C, C++, Java have multiple ways to arrive at the same program, whether it be from unnecessary code, or just bad code. However, if the end program works, because I am learning the program, I wouldn't know that I have made a mistake, thus thinking what I did was ok. Since, I am learning on my own, I wouldn't have a teacher there to point out the mistakes.

You are saying I should go with Python or Ruby because I would be less likely to form those bad habits, meaning the programs are in general easier to learn. How does Visual Basic stack up against Python, Ruby, C, C++, and Java?
 
  • #25
The main problem with languages like C (and to a lesser extent C++,Java) is that you have to manage a lot of the details yourself.
Suppose you wanted to read a list of names from a text file, in Python or Ruby it would be as simple as
Code:
lines = open("sample.txt").readlines()
while in C it would take 10-20 lines of code and a lot of error checking.

When you are learning CS you should be more concerned with the algorithm or technique you are learning about than having to tell the computer where in memory to store each bit of data.
 
Last edited:
  • #26
Alright, well like I said, I need to figure out which route from the college to take. In the end my goal is Software Engineering so I need to find out which path is best for that field, whether it be CE or CS at the University of Arizona. However, I am not going back to school until Spring of 2010, so I figured this would be a good way to occupy some of my free time while benefiting me on the long run. Alright, well I think I will go with either Python or Ruby...now to figure out which one.
 
  • #28
I am prepared to buy a book for either programming language to help me out. While I am learning on my own, I would like to do the best learning I can...and feel a good book would help out.
 
  • #29
O'Reilly, Apress and Pragmatic Programmers all do excellent books on both languages.
The two free books I mentioned above are also available in dead tree form.

But both Ruby and Python work very well with a "type code and try things" approach.
 
  • #30
If you want to do software engineering...then you will definitely want to be a CS major rather than an ECE major at the UA.

Be aware that the Computer Science curriculum while consisting of various programming languages throughout is based primarily on the science of computers (data structures, algorithm analysis, etc), which does include a good deal of mathematics, and is not specific towards a particular language. You will learn Java during your introduction to programming class and OO class there at the UA, then you will take higher level classes in which you are almost always using C.

The UA also offers a comparative languages class which goes over various paradigms within programming and currently I think one of the languages they use is in there is Ruby.

I would recommend you also disregard that advice that you will develop bad habits if you learn from a book...if that's how you want to learn then you should by all means learn it that way.

As far as first languages are concerned, all the ones mentioned are decent enough...just flip a coin and then learn it.
 
  • #31
I always recommend Ada as a first language, it FORCES you to develop good habits but is at the same time quite easy to learn. It was used in programming courses at my university (although that was 13 years ago).
It is also a very robust language (there is a good reason for why it is still often used to write software for e.g control systems for aircraft).

However, it is not a very "fun" language and I would not really recommend it for any real world applications unless you are writing "critical" software (or have to use it because it is the standard language in your field, it is apparently still used in the military and by various defence contractors).

Also, note that once you've learned one language you can easily learn another in just a few days; I am not a very good programmer but by know I must have learned to write "useful" pieces of code in about 10 languages or so, although at the moment I seem to be using Python most of the time.
 
  • #32
Ok, well my next question is this: "Which is harder to learn: Python or Ruby?"
 
  • #33
I started with python and i didnt like it too much and just went to c++ and have been at it for a while now, I picked up a great book when i started which i could send you in a pdf, it is a university professor teaching an introductory c++ class to students but he documented it basically and wrote it in a book. Itll make you understand just about everything when it come to the basics from basic variables, to loops, functions, procedures, arrays, and and pointers. pm me if your interested.
 
  • #34
I also am waiting to enter college, albeit not for software engineering. However, I'm learning Scheme, and it is a fun language to use (I have also used Python and even C++ for a short time). Python is easy to use, however, if you wish to learn more about the fundamentals of programming, I would suggest reading Structure and Interpretation of Computer Programs, available http://mitpress.mit.edu/sicp/full-text/book/book.html" . This is based on Scheme, but there are books like it dealing with Python. Again, I'm partial to Scheme, so someone might be able to point out a better book in another language. I hear that How to Think Like a Computer Scientist is good for Python users, but I have never read it myself.Then again, this book looks at (from what I can tell) the fundamentals of Computer Science, so I'm not sure if this would help you or not. Specifically, I'm not sure if this book alone is enough allow one to avoid the bad programming practices Vanadium 50 mentioned.

I don't have a degree in Computer Science, so if I've said anything that would be detrimental to the correct way to learn software engineering, please let me know. I only took the advice I found http://norvig.com/21-days.html" .
 
Last edited by a moderator:
  • #35
Well, I still think my choice for a first language will be between Ruby and Python, depending on which one is more difficult.
 

Similar threads

  • STEM Academic Advising
Replies
12
Views
1K
  • STEM Academic Advising
2
Replies
50
Views
4K
  • STEM Academic Advising
Replies
4
Views
1K
Replies
2
Views
871
  • STEM Academic Advising
Replies
3
Views
938
  • STEM Academic Advising
Replies
5
Views
851
  • Programming and Computer Science
Replies
16
Views
1K
Replies
6
Views
926
  • STEM Academic Advising
Replies
5
Views
1K
  • STEM Academic Advising
Replies
3
Views
913
Back
Top