Which programming language is best for an aspiring engineer?

  • Thread starter Astroman
  • Start date
  • Tags
    Programming
In summary: MathewIn summary, a beginner programmer should learn C++ because it is a more difficult language, but it has a powerful standard library.
  • #1
Astroman
13
0
I have no programming experience and I have decided that it will be beneficial to my (future) career in engineering to become a proficient programmer. I was thinking about starting with C or C++. Is this a good idea, and if so, which of the two should I learn? I have heard that the main difference between the two is that C is a procedural language whilst C++ is an object-oriented language. However, I don't know what the implications of this are for a beginning programmer. My plan was to go as follows:

C or C++
Matlab/Mathematica
Java
Python (if necessary?)
Learn to use UNIX/Linux
 
Physics news on Phys.org
  • #2
Matlab/Mathematica - if you want to get the answer
python+numby - if you want to get the answer without paying
C++ - if you want to get a job in software
Java - if you want to get a dead end job in software
Fortran - if you want to continue working on that 300,000 line model your superviser started in the 60s.
 
  • #3
As regards C versus C++, a better way to state the difference is that C++ is based on C, but adds features for object-oriented programming, along with a powerful standard library for dealing with character strings and various kinds of collections of data. For example, a C++ vector is sort of an "array on steroids." You can use a vector for the same kinds of things that you would use a C-style array for, but vectors are more convenient to use in many ways.

I would favor starting out with C++ over C even if you don't do any object-oriented programming, because of the C++ standard library. But make sure you get a book that actually uses the standard library consistently, and isn't a C-style book that simply tacks on a chapter about the standard library at the end.
 
  • #4
Any decent engineering program requires an introductory programming course, usually in either C/C++ or Java. The best choice for beginners is hotly debated among programmers, but any of these three will be a good practical place to start. C is going to be a little easier to pick up, since it doesn't have any OOP concepts to master, but you'll eventually want to pick up those skills.

As an engineer, Matlab/Mathmatica are vital skills, but the packages you'd need for practice are very expensive. I would wait until you get to school so that you can use the pre-installed versions on campus for free. There's clone packages out there, but I haven't found any I'm particularly fond of.
 
  • #5
Thanks for the advice so far. I think I will try to learn C++ first. [References to software piracy removed] What specific features of Matlab are you referring to?
 
Last edited by a moderator:
  • #6
C++ is a language of nuance. In other words, there are many ways to screw up a C++ program in subtle, hard-to-debug ways. It's also very syntactically burdensome. It's not an easy language.

Of all the languages you mentioned, MATLAB and Python will probably be the most immediately useful to you. C++ is one of those languages that most people should be familiar with simply because of its ubiquity, but I wouldn't learn it first unless you have a pressing reason to do so.

Ignore Java, it's dying (and rightly so). It's also so similar to C++ that there's really very little to gain from learning it.

- Warren
 
  • #7
This was a very valuable thread for me to read.
I'm a sophomore aiming for Civil/Environmental, but I'm hoping to learn control systems on my own time. My University uses Java throughout the EE program, but I think I will learn C++ instead. I did take a Programming theory course using VB.Net that took me up through Arrays and Some basic file storage/retrieval code, but I want to take my skills to the next level.

I also used Mathematica in my Physics I & II w/Calculus courses to help solve problems assigned to us that were beyond Calculus II. I'm hoping to pick up the student edition soon (It's about $120 I believe).

Are there any books or software packages that people here recommend for learning C++?
 
  • #8
chroot said:
Ignore Java, it's dying (and rightly so).
- Warren

Hmm, I hear this for the first time (this might be because I have not been very interested in Java or its future during the last years). Could you elaborate on this a little bit ?
 
  • #9
Nick M said:
Are there any books or software packages that people here recommend for learning C++?

I liked "Accelerated C++": https://www.amazon.com/dp/020170353X/?tag=pfamazon01-20

But if you have not much programming experience in general, you might want to start with a book that is a bit easier. Still it might be usefull as your 2nd C++ book.
 
Last edited by a moderator:
  • #10
I would start with an object-oriented language. C++, Java or C#, it doesn't matter: the concepts are the same for all three languages. C++ might be more difficult to learn as it's more low-level (pointers is a difficult concept when you've just started programming). Java or C# doesn't matter although you may choose Java for it's platform independence (when you choose C# you're bound to Microsoft).
When you know either of these languages, you can pick up another language very easily. As long as you grasp the concepts.
 
  • #11
Oberst Villa said:
Hmm, I hear this for the first time (this might be because I have not been very interested in Java or its future during the last years). Could you elaborate on this a little bit ?

Java is still the most popular language in the world, but it is rapidly losing mindshare. Various websites keep track of usage statistics; do some googling.

- Warren
 
  • #12
I am looking at Accelerated C++: Programming By Example, and I am concerned about one thing. A couple of reviews say that there are a lot of errata, but then one person replied that the latest printing (16th printing) has corrected all the errors. However, Amazon and everywhere else I am looking only has the edition from the year 2000. Would the print edition be updated even though the text is still from 2000? I don't want to purchase the book if it has a lot of errors in it.
 
  • #13
Learn C++ along with learning how to use linux. Doing them at the same time is very complimentary, since you don't need to know anything about programming to use linux (but the more you learn about linux the more ideas you'll have for things to program), nor do you need to know anything about linux to program (but the more programming you learn, the more you'll want to explore your system).
 
  • #14
I'm using C++ How to Program by Deitel & Deitel, though not the latest edition of the book. I find it really helpful and informative, though if you already have a background in C, you'll probably want to skip the first 5 chapters or so, referencing it only if the programming style in later chapters is not clear to you.

I own Accelerated C++ as well, but I find the Deitel textbook a lot easier to understand, though it's noticeably thicker than the former.
 
  • #15
Sorry to bump this thread, but I really want to find a good C++ book that is

1. Up-to-Date (I hear libraries change frequently?)
2. Free of errors (As a beginner, I would likely not know when I came across an error)

So if as many people could list what, in their opinion, is the best C++ book I would greatly appreciate it.

As I stated above, "I am looking at Accelerated C++: Programming By Example, and I am concerned about one thing. A couple of reviews say that there are a lot of errata, but then one person replied that the latest printing (16th printing) has corrected all the errors. However, Amazon and everywhere else I am looking only has the edition from the year 2000. Would the print edition be updated even though the text is still from 2000? I don't want to purchase the book if it has a lot of errors in it. "

I've also read poor reviews for Deitel's book
 
  • #16
I wouldn't worry so much either about a few poor reviews or libraries changing. Math changes all the time, but you can still learn calculus out of a centuries old textbook!

The great thing about learning to program is that it's an experimental process. A good programming textbook is one that introduces the syntax and then starts filling your toolbox, but even if there's typos you should never be copying anything out of it verbatim.
 
  • #17
Astroman said:
(I hear libraries change frequently?)

The C++ standard (including the definition of the standard library) has not changed significantly since 1998, as far as I know. The standard library that comes with a particular compiler may change, but this should be in the direction of better conformance with the standard. Of course, non-standard libraries may be another matter.

As I stated above, "I am looking at Accelerated C++: Programming By Example, and I am concerned about one thing. A couple of reviews say that there are a lot of errata, but then one person replied that the latest printing (16th printing) has corrected all the errors. However, Amazon and everywhere else I am looking only has the edition from the year 2000.

"Printings" are different from "editions." New printings fix errata. New editions have major additions, changes or reorganizations of the text. I'd expect Amazon to provide the lastest printing of the book. The C++ standard has not changed significantly since the "Accelerated C++" first appeared, so there should be no problem with that book being up to date.
 
  • #18
Recommend Python and Matlab. Very nice, very useful. C/C++ are ugly languages, why put yourself through that pain?

I also recommend you learn a functional programming language - scheme, for example. You might never use it again, but just knowing it will make you a much better programmer with any other language.

Also, a note on Matlab. Matlab is all about arrays and vectorization, and if you use it right you can produce very efficient, minimal, and readable code. However the developers have put in standard methods from other languages such as for loops, as a crutch when vectorization just can't be used. Unfortunately, this causes many people to not bother learning about vectorization in the first place, and use Matlab like a non-vectorized language. This is a big mistake. Learn vectorization.
 
  • #19
Nick M said:
This was a very valuable thread for me to read.
I'm a sophomore aiming for Civil/Environmental, but I'm hoping to learn control systems on my own time. My University uses Java throughout the EE program, but I think I will learn C++ instead. I did take a Programming theory course using VB.Net that took me up through Arrays and Some basic file storage/retrieval code, but I want to take my skills to the next level.

I also used Mathematica in my Physics I & II w/Calculus courses to help solve problems assigned to us that were beyond Calculus II. I'm hoping to pick up the student edition soon (It's about $120 I believe).

Are there any books or software packages that people here recommend for learning C++?

Buy Control Systems Engineering by NISE, and if you have any questions ask me. Use MATLAB for controls, not c++
 
  • #20
jtbell said:
..."Printings" are different from "editions." New printings fix errata. New editions have major additions, changes or reorganizations of the text. I'd expect Amazon to provide the lastest printing of the book...

Astroman: Just in case you receive an old printing, here is a list of the errors they corrected, so even in this case not all is lost: http://www.acceleratedcpp.com/details/errata.html

(quite a huge number for such a small book, but at least they cared enough to correct them...)
 
  • #21
Thank you, Oberst Villa.
 
  • #22
electronics engineering

i want to know that which are the most useful programming languages for a electronics and communication engineer,
right now i m in second year
i have respectable knowledge of c++
i don't know any other language
can u suggest me some programming languages which will be useful for ma carrer
and their order in which shud i learn them
 
  • #23


robo lover said:
i want to know that which are the most useful programming languages for a electronics and communication engineer,
right now i m in second year
i have respectable knowledge of c++
i don't know any other language
can u suggest me some programming languages which will be useful for ma carrer
and their order in which shud i learn them
English. Learn English. While it may not be your native language, it is the lingua franca of the technical world -- and it is the language of this site (you did read our rules when you signed up, didn't you)?
 
  • #24
sorry sir ,i will remember this thing in future
i will use standard english
now please give answer to my question
thanking you
 
  • #25
Ada 95 and FORTRAN are still used in military applications (avionics, etc.). This is due to the languages' abilities to be "crash free" for the most part.
 

1. What is the most popular programming language for engineers?

The most popular programming language for engineers is currently Python. Its versatility, readability, and abundance of libraries make it a top choice for engineers in various fields.

2. Is it better to learn one programming language in-depth or multiple languages?

It is generally better to learn one programming language in-depth rather than multiple languages superficially. This allows for a deeper understanding of the language and its applications, which can be applied to other languages in the future.

3. Which programming language is best for data analysis and visualization?

R is considered the best programming language for data analysis and visualization. It has powerful statistical analysis capabilities and a variety of visualization tools, making it a top choice for engineers working with large datasets.

4. Should I learn a programming language specific to my field or a more general language?

It is beneficial to learn a programming language specific to your field, as it will be more relevant to your work. However, it can also be useful to learn a more general language such as Python or Java, as they have a wide range of applications and can be easily transferable to different industries.

5. Are there any programming languages that are particularly challenging for beginners?

Some programming languages, such as C++ and Assembly, are known to be more challenging for beginners due to their syntax and low-level nature. However, with dedication and practice, any language can be learned by aspiring engineers.

Similar threads

  • STEM Academic Advising
Replies
12
Views
1K
  • STEM Academic Advising
Replies
3
Views
918
Replies
10
Views
2K
  • Programming and Computer Science
Replies
22
Views
2K
  • STEM Academic Advising
Replies
4
Views
984
  • Programming and Computer Science
Replies
16
Views
1K
Replies
8
Views
2K
  • STEM Academic Advising
Replies
3
Views
755
  • Programming and Computer Science
Replies
8
Views
878
  • STEM Academic Advising
Replies
4
Views
2K
Back
Top