Learning a Programming Language

  • Thread starter danago
  • Start date
  • #1
danago
Gold Member
1,122
4
University has finished for me this year until late February of next year, so i currently have plenty of spare time (and loving it) :smile: Normally over the summer holidays i like to just have a break from uni study, but i am still always keen to learn something--something that i want to learn because i want to know more, not because i need it to pass exams :yuck: Last set of holidays i taught myself to cook pretty well!

Anyway i am studying chemical engineering and finance so have never really had much of a chance to take computer science classes and learn a programming language. At the moment i am not completely sure if i want to pursue a career in engineering or finance, but either way i appreciate that being fluent in computer programming is a useful skill.

I don't have a very strong background in programming, however i have had some exposure to it; for many of my engineering classes i have made use of MATLAB to write simple programs. I also used to be OK in developing dynamic websites with php (I went through a phase where i was trying to make money online, haven't used it for a long time though :P), so i guess i do understand the importance of proper syntax and structure.

Given my brief background, what would be a good suggestion as a programming language to learn? I see C++ thrown around a lot, would this be a good starting place? I am open to all suggestions. I would also appreciate any suggestions for books or resources that may be useful.

Thanks in advance,
Dan.
 

Answers and Replies

  • #2
eri
1,034
20
Every field seems to have it's own preferred language, but if you learn one then you can easily pick up another just by learning more syntax - the important part is to learn how the computer 'thinks'. I started with Basic and C, then moved into IDL and didn't leave. But C++, Perl, or Python might be useful for you to learn - and I know there are a lot of Python 'getting started' websites out there.
 
  • #3
danago
Gold Member
1,122
4
Every field seems to have it's own preferred language, but if you learn one then you can easily pick up another just by learning more syntax - the important part is to learn how the computer 'thinks'. I started with Basic and C, then moved into IDL and didn't leave. But C++, Perl, or Python might be useful for you to learn - and I know there are a lot of Python 'getting started' websites out there.
Thanks for the suggestions, i will definitely look into those.

Another suggestion that people have made is Java. What is your opinion on this, in terms of its difficulty to learn as a first language and its usefulness?
 
  • #4
6,814
15
Another suggestion that people have made is Java. What is your opinion on this, in terms of its difficulty to learn as a first language and its usefulness?
It's a great language as an intro to OOP, but I don't see any future in that language. The problem is not with the language, but with the fact that Oracle maintains the language and Microsoft is trying to kill it, so I don't see that language going anywhere.
 
  • #5
370
0
It's a great language as an intro to OOP, but I don't see any future in that language. The problem is not with the language, but with the fact that Oracle maintains the language and Microsoft is trying to kill it, so I don't see that language going anywhere.
Sorry for hi-jacking the thread a bit - but what program would be preferable for mathematical modelling in finance? I'm learning C++ now but it really seems so complicated compared to how C looked...
 
  • #6
22,089
3,289
I think python is a very save choice for a first programming language. Java is a bit harder, but also more useful.
 
  • #7
danago
Gold Member
1,122
4
No worries Chewy, i am interested to find out the answer too :)

I have been doing a bit of reading and it seems that C++ is one of the most widely used and powerful languages, however most sources that i have read have indicated that it is also fairly difficult. If i decided to learn C++ before anything else, would i be setting myself up for failure?
 
  • #8
danago
Gold Member
1,122
4
I think python is a very save choice for a first programming language. Java is a bit harder, but also more useful.
Yea i am considering looking more into Python; it seems like a fairly simple language based on the small snippets of code i have looked at.
 
  • #9
22,089
3,289
I have been doing a bit of reading and it seems that C++ is one of the most widely used and powerful languages, however most sources that i have read have indicated that it is also fairly difficult. If i decided to learn C++ before anything else, would i be setting myself up for failure?
If you want a widely used language, then java is the best choice, it looks very much like C++ but it is less complicated. But C++ is more powerful.

The reason why C++ is more powerful is because you can do really complicated stuff with pointers and allocating memory. If you've never really programmed, then this will be a bit over your head. I suggest starting with a less complicated language to learn the tricks and the tools. Once you mastered those, you can do some real programming.

When you start of in computer science, you'll first learn some easy (but useful!) language like python, lisp, perl,... It is only in your second year, that the more complicated C++ shows up. I suggest you follow the same parcour, that is starting easy :smile:
 
  • #10
danago
Gold Member
1,122
4
I think i may give Python a shot :smile: Are there any particular resources that you know of that stand out as good learning tools? Or else im sure a few google searches will bring up more than i need :P
 
  • #11
277
0
I think i may give Python a shot :smile: Are there any particular resources that you know of that stand out as good learning tools? Or else im sure a few google searches will bring up more than i need :P
Official tutorial.
 
  • #12
22,089
3,289
Last edited by a moderator:
  • #13
6,814
15
Sorry for hi-jacking the thread a bit - but what program would be preferable for mathematical modelling in finance? I'm learning C++ now but it really seems so complicated compared to how C looked...
It depends on the type of modeling. Most people in finance tend to use python, matlab, and even visual basic in excel to get work done. But usually, you have these systems calling C++ libraries that do the heavy computing.

One thing that will help you a lot with C++ is not to try to learn all of it. I don't think that there is any single person that understands all of C++, just like that there is anyone that understands all of English. I've been programming in C++ for two decades, and I'm still learning new stuff about it.

The powerful thing about C++ is that if you need to program like C, you can write C++ that looks like C. If you need to program something that looks like Java, you can write C++ that looks like Java. If you need to problem something that looks like Common Lisp, then you can write C++ that looks like Common Lisp.

Now if you have a system in which part of it looks like C, and Java, and Fortran, and Common Lisp, you can do it with C++. And if there is some new cool language that people need that's part of C++ that isn't in there, then people will add it.
 
  • #14
6,814
15
I suggest starting with a less complicated language to learn the tricks and the tools. Once you mastered those, you can do some real programming.
Also, I think most programming courses spend too much effort trying to teach *writing* programs, when you learn a lot *reading* programs. In particular, if you have a good programmer, then you can dive in the middle of their code, quickly figure out what they were trying to do, and then fix it. Reading junk code is also useful because it teaches you what not to do.

You can start by going to the libreoffice site, downloading the code, and then trying to get a word processor built. It will take you two to three weeks to give get the thing to compile, but that teaches you "real world" programming. Most programming courses have you write 500 line programs, whereas most read world programming involves dealing with systems with several million lines of code.

Finally, don't learn *a* programming language. Learn several. If you are a good programmer, you'll be expected to sit down in front of a machine with code written in some language that you've never seen before, and expected to figure out what to do with it.
 
  • #15
jtbell
Mentor
15,659
3,729
The reason why C++ is more powerful is because you can do really complicated stuff with pointers and allocating memory.
There's no difference between C++ and plain old C in that respect. Where C++ is different is that it has features that let you avoid mucking around with pointers and dynamic memory allocation.

One thing that will help you a lot with C++ is not to try to learn all of it.
I think that for most programmers, the most important thing to learn about C++ (beyond the basics of input/output, control statements, and functions, that you have to learn with any language) is not the object-oriented stuff (how to design classes, use inheritance, etc.), but rather the "container" data types that are defined in the C++ standard library: vectors, strings, lists, maps, etc. Learn how to use these effectively, and you will need to use explicit pointers and dynamic memory allocation only very rarely. The containers take care of all those messy details for you.
 
  • #16
danago
Gold Member
1,122
4
Try http://www.swaroopch.com/notes/Python it's a good book, but it lacks exercises.
Also, http://openbookproject.net//thinkCSpy/ [Broken] is quite nice.
Thanks for the links. I have actually been working through the second link and am finding it very easy so far. I think the exposure i have had to MATLAB and php has been very helpful; although there are some slight differences in syntax, the ideas and concepts seem to cross over.

Also, I think most programming courses spend too much effort trying to teach *writing* programs, when you learn a lot *reading* programs. In particular, if you have a good programmer, then you can dive in the middle of their code, quickly figure out what they were trying to do, and then fix it. Reading junk code is also useful because it teaches you what not to do.

You can start by going to the libreoffice site, downloading the code, and then trying to get a word processor built. It will take you two to three weeks to give get the thing to compile, but that teaches you "real world" programming. Most programming courses have you write 500 line programs, whereas most read world programming involves dealing with systems with several million lines of code.

Finally, don't learn *a* programming language. Learn several. If you are a good programmer, you'll be expected to sit down in front of a machine with code written in some language that you've never seen before, and expected to figure out what to do with it.
I think that is a great tip. I am far from being an expert, but so far i have found it very helpful to read through example scripts and try to predict the output by following the "flow" of the code.

Eventually i would like to be proficient in more than one language, but ill take it one step at a time :smile:

Thanks everyone for the input!
 
Last edited by a moderator:

Related Threads on Learning a Programming Language

  • Last Post
2
Replies
44
Views
7K
Replies
7
Views
6K
Replies
27
Views
14K
Replies
15
Views
11K
Replies
4
Views
3K
  • Last Post
Replies
6
Views
900
  • Last Post
2
Replies
35
Views
5K
  • Last Post
3
Replies
50
Views
8K
  • Last Post
Replies
13
Views
2K
Top