Learning a Programming Language

In summary, University has ended for the year and the speaker has free time to learn something new. They have a background in MATLAB and PHP, and are looking for suggestions on what programming language to learn. Suggestions include C++, Perl, and Python, with Python being recommended as a good starting point. The speaker is also considering Java, but some have mentioned that it may not have a strong future. It is suggested to start with a simpler language before moving on to more complex ones like C++. Resources for learning Python are recommended.
  • #1
danago
Gold Member
1,123
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.
 
Physics news on Phys.org
  • #2
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
eri said:
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
danago said:
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
twofish-quant said:
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
I think python is a very save choice for a first programming language. Java is a bit harder, but also more useful.
 
  • #7
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
micromass said:
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
danago said:
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
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 I am sure a few google searches will bring up more than i need :P
 
  • #11
danago said:
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 I am sure a few google searches will bring up more than i need :P

Official tutorial.
 
  • #13
Chewy0087 said:
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
micromass said:
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
micromass said:
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.

twofish-quant said:
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
micromass said:
Try http://www.swaroopch.com/notes/Python it's a good book, but it lacks exercises.
Also, http://openbookproject.net//thinkCSpy/ 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.

twofish-quant said:
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:

1. What is the best programming language to learn?

The best programming language to learn depends on your personal goals and interests. Some popular options include Python, Java, C++, and JavaScript. It's important to research and choose a language that aligns with your career goals and the type of programming you want to do.

2. How long does it take to learn a programming language?

The amount of time it takes to learn a programming language varies depending on the individual and the language itself. Generally, it takes several months to become proficient in a language, but it can take years to truly master it. Consistent practice and dedication are key to learning a programming language efficiently.

3. Can I learn a programming language on my own?

Yes, it is possible to learn a programming language on your own through online resources, books, and practice. However, it can be helpful to have guidance from a teacher or mentor, especially for more complex languages. Joining a coding community or taking a class can also provide valuable support and feedback.

4. Is it necessary to learn multiple programming languages?

It depends on your goals and interests. Some programmers specialize in one language, while others learn multiple to broaden their skill set and be more versatile in the job market. Learning multiple languages can also help you understand different programming concepts and approaches.

5. What is the best way to practice and improve my programming skills?

The best way to practice and improve your programming skills is to consistently work on projects and solve problems using the language you are learning. This can include building personal projects, participating in coding challenges, and collaborating with other programmers. Additionally, reading code written by others and seeking feedback can also help improve your skills.

Similar threads

  • STEM Academic Advising
Replies
12
Views
1K
  • STEM Academic Advising
Replies
10
Views
1K
Replies
6
Views
930
  • STEM Academic Advising
Replies
3
Views
831
Replies
40
Views
2K
  • STEM Academic Advising
2
Replies
50
Views
4K
Replies
2
Views
877
  • STEM Academic Advising
Replies
6
Views
1K
  • STEM Academic Advising
Replies
29
Views
553
Back
Top