What is a good programming language to learn for Mech E ?


by Saladsamurai
Tags: language, learn, mech, programming
Saladsamurai
Saladsamurai is online now
#1
Aug3-08, 08:06 PM
Saladsamurai's Avatar
P: 3,012
Like it says. I am studying Mechanical engineering and I would like to get familiar with so programming language. I was thinking of Java or C++. I am leaning more towards the latter. However, I have heard that they are both a little outdated. I am of the opinion that if I learned C++, regardless of what's current, it would be helpful.

Are most languages similar? That is, am I correct to say that if a learned C++, I could pick up another language without much difficulty?


Also, of I do go with C++, is anyone familiar with this text. http://www.amazon.com/Sams-Teach-You.../dp/0672324482

Thanks!!!
Phys.Org News Partner Science news on Phys.org
Cougars' diverse diet helped them survive the Pleistocene mass extinction
Cyber risks can cause disruption on scale of 2008 crisis, study says
Mantis shrimp stronger than airplanes
Physics1
Physics1 is offline
#2
Aug3-08, 08:14 PM
P: 22
C++!!! However, Java is replacing niches that C++ once held like in financial engineering. I don't think it'll replace really anything in engineering any time soon.

BTW, I hate computer science. That field moves really fast!
WarPhalange
WarPhalange is offline
#3
Aug3-08, 08:33 PM
P: 343
Quote Quote by Saladsamurai View Post
Are most languages similar? That is, am I correct to say that if a learned C++, I could pick up another language without much difficulty?
Yup. Once you learn one, others are really easy to pick up. The same concepts apply, and you just have to learn the quirks of the language and their syntax (what their commands are, basically).

Either of these will work fine for a first language.

C++ is by far more powerful than Java, but Java is definitely easier to pickup and both are popular enough that it's a personal decision which to learn first.

So it depends on how much time you want to spend on learning it. If it's just a tool to make you more employable, go for Java. You might have to learn C++ later anyway, but by then they'll probably be paying for you to get up to speed. ;)

Saladsamurai
Saladsamurai is online now
#4
Aug3-08, 08:39 PM
Saladsamurai's Avatar
P: 3,012

What is a good programming language to learn for Mech E ?


Thanks people!

Any thoughts on the Sams book?
shoehorn
shoehorn is offline
#5
Aug3-08, 09:32 PM
P: 448
Quote Quote by Physics1 View Post
Java is replacing niches that C++ once held like in financial engineering.
Not even remotely close to being plausible, never mind true.
will.c
will.c is offline
#6
Aug3-08, 10:06 PM
P: 374
Matlab?

By the way, anything involving large scale simulations (Computational science, engineering, computational finance) requires performance. Java is easy to learn and easy to write (so is C++, imo) but it's an absolute sloth. C++ will not be replaced in these areas any time in the foreseeable future, and it certainly won't be by Java. Hell, FORTRAN is still popular among these folks!
Saladsamurai
Saladsamurai is online now
#7
Aug3-08, 10:09 PM
Saladsamurai's Avatar
P: 3,012
What is the difference between Matlab and C++ ? I mean, I see the name Matlab and naturally I think MATH. What can C++ be used for that isn't math?

That may be a silly question
mrb
mrb is offline
#8
Aug3-08, 10:17 PM
P: 101
I can throw in my ramblings as a reasonably experienced programmer who does not know mech e. Maybe this is irrelevant to you, so disregard if you wish.

C++ is an absolute mess of a language. However it is widely used and if for whatever reason your field extensively uses it, well, then you have no choice. In any case, though, I would most definitely NOT recommend it as a first language if possible.

Java was initially conceived as a cleaned up version of C++. Personally I think it would be a much better place to start than C++ (although not ideal). The best thing about Java is not the language itself, it's the platform. Do you need to write a program that runs on Windows, Mac OS X, and Linux, that communicates over a network, that has a graphical interface, and that uses a database? In Java, no problem, libraries to help you do those things are built in. In C++?... Good luck.

I don't approve of the "Learn X in 21 Days" type of books. Writing code is a serious endeavor. Unfortunately there are a lot of people writing awful code and a lot of awful programming books out there. If a superficial understanding can get you by for what you need, then so be it, but I don't like to do things halfway.

The poster above says languages are easy to pick up once you know one. I mostly agree. For instance, an experienced C++ programmer is not going to have a problem learning Java. However, some languages, especially non-mainstream languages, have different paradigms that can be hard for users of other languages to wrap their heads around. When object oriented stuff first started getting popular, a lot of people had a really hard time understanding what it was all about. Some people never did.

As far as being "outdated"... Some of this has more to do with what's trendy than anything else. Java was extremely fashionable a few years ago; much less so now, although still widely used. But its technical merits haven't really changed. It's a mundane object oriented language with extensive libraries, 8 years ago and today. The people who were saying it was the greatest thing ever a few years ago now look stupid, as do the people today saying everyone should stop using Java immediately.

To throw in my last little tidbit... I think all these mainstream languages are crap. There are some really, really amazing languages that 95% of programmers just ignore because they won't help you get a job. ML, Haskell, and especially Lisp. There is a great little Lisp dialect called Clojure which I love to death and which is built on the Java JVM, so you have access to all the Java libraries. Unfortunately your language decision likely has more to do with what language your colleagues will be using than its technical merits, so do what you must.

Book recommendations:

*** C++

Unfortunately many C++ books teach a style of C++ from before C++ was standardized 10 years ago. These are good ones:

Accelerated C++ by Koenig and Moo. Teaches modern C++ for a beginner.

Effective C++/More Effective C++/Effective STL by Meyers. C++ has a LOT of pitfalls. These will help you avoid them. I consider Effective C++ pretty much essential. (These will NOT teach you the language, though.)

Exceptional C++/Exceptional C++ Style/More Exceptional C++ by Sutter. These are basically more advanced versions of the above. Read after you have a little experience.

The C++ Programming Language by Stroustrup. The definitive book by the creator of C++. Not appropriate for a beginner though.

*** Java

Unfortunately I don't know a good beginner's Java book. I'm sure there are some out there but there are tons of garbage ones also. I have:

The Java Programming Language by Gosling.

Effective Java by Bloch. Analogous to Effective C++ above. Do not attempt to write serious Java code without having read this book.

*** Other

If you have time to devote to this and actually want to become good at it, I strongly recommend Structure and Interpretation of Computer Programs by Abelson and Sussman. It's actually available for free online from MIT: http://mitpress.mit.edu/sicp/ It is supposed to be for a complete beginner, although it doesn't provide as gentle an introduction as I would think ideal.
ice109
ice109 is offline
#9
Aug3-08, 10:17 PM
P: 1,705
i vote matlab. cas systems are fast enough. computer are cheap, matlab has parallel processing packages etc etc. if you spend the amount of time learning to use c++ that it requires you will have wasted a great amount of time that could've been spent studying engineering. leave the computer science to the computer scientitsts.

matlab stands from matrix laboratory. there are so many useful things in matlab that i guarantee if you devoted as much time to learning it as you would need to devote to c++ you will be a much more capable engineer.

i would compare solving a problem in c++ and matlab like digging a trench with a shovel versus an excavator. yes the shovel can get into corners and is neater but yea... no one digs trench with shovels now that we have excavators.
mrb
mrb is offline
#10
Aug3-08, 10:22 PM
P: 101
Quote Quote by Saladsamurai View Post
What is the difference between Matlab and C++ ? I mean, I see the name Matlab and naturally I think MATH. What can C++ be used for that isn't math?

That may be a silly question
Matlab is a language and computing environment geared towards math. C++ is a general purpose language. Your web browser was probably written in C++. Microsoft Office is written in C++. Many computer games are written in C++. etc.

EDIT: sorry, ice109, didn't mean to step on your toes with my response; it hadn't appeared when I began my reply. And I would have to agree that a specialized environment like Matlab is probably best IF it can actually do everything you need it to.
ice109
ice109 is offline
#11
Aug4-08, 12:27 AM
P: 1,705
lol you didn't cause your post didn't show when i started writing mine either
Saladsamurai
Saladsamurai is online now
#12
Aug4-08, 11:10 AM
Saladsamurai's Avatar
P: 3,012
Okay guys. Thanks!! I already bought a Matlab book before I started this thread so I guess I'll just stick to that!

On the same token, do you think if become 'fluent' in Matlab, wouldn't C++ be a little easier to pick up?
ice109
ice109 is offline
#13
Aug5-08, 07:55 PM
P: 1,705
Quote Quote by Saladsamurai View Post
Okay guys. Thanks!! I already bought a Matlab book before I started this thread so I guess I'll just stick to that!

On the same token, do you think if become 'fluent' in Matlab, wouldn't C++ be a little easier to pick up?
yes it would since programming concepts are pretty much universal
Topher925
Topher925 is offline
#14
Aug5-08, 08:12 PM
Topher925's Avatar
P: 1,672
I'm an ME and code frequently, like four hours on an average work day. My first choice would be Matlab. Its basically an industry standard for scientific computing. While ya it is based off of C, it is a bit different. And about 8,000^67,000 times more powerful then just C++.

My second choice would by Visual Basic (Applications). Why? Its simple, easy, used in all Office applications including Excel, and will do everything as well as C++ can but keep it neat. Since computers are getting pretty cheap and powerful these days, efficient code isn't such a big issue anymore.
hubris
hubris is offline
#15
Aug5-08, 08:30 PM
P: 29
I would vote Matlab, too.
However, I think that learning proper and clean coding is more important than any language, i.e., learning OOP etc.

Languages and software are what you make them.
VBA is aesthetically repellent to me, but sometimes that is all you have. I would wait until you are forced, if ever to learn.

Keep in mind this is not from an ME perspective, in fact they never seemed that interested in programming.
Saladsamurai
Saladsamurai is online now
#16
Aug5-08, 09:03 PM
Saladsamurai's Avatar
P: 3,012
Thanks for the replies guys!


Register to reply

Related Discussions
Which new language should i learn? Social Sciences 29
what language should i learn Academic Guidance 22
Which programming language to learn??? Computing & Technology 18
any good programming challenge using the c language. Programming & Computer Science 12
What language to learn? Academic Guidance 50