Question:
I use C, should I switch to C++?
Allen
2009-05-09 20:15:52 UTC
I'm 15 and am an intermediate C programmer. :D

In order to have an electrical engineer, what programming language do you recommend?

in order to become a well paid programmer for robots, or math stuff, statistics etc. what programming language should i specialize in?

i have all operating systems and am currently using Quincy as my C compiler because it's so lightweight and easy to use :D


sooooooo .... that's it :D i'm really good at math and science and statistics (for my age)
Seven answers:
jplatt39
2009-05-09 23:00:07 UTC
Bluntly, if your interests are electrical engineering and serious programming, I think you should worry more about math than you should about programming languages. People pay programmers to implement algorithms, that is you tell the computer exactly what it should be doing. Once you understand what the computer should be doing, how you implement it -- the programming language -- can be secondary.



C these days has a very comfortable niche, writing device drivers and embedded systems. If you want to work on another programming language I might suggest python or perl. Those are scripted languages which can give you some perspective, but you should understand the reasons C has that comfortable niche are 1. it generates fast and lightweight machine code because it is not exactly a high level language, as C++ is, though it is very sophisticated, and 2. it provides the ability to model logically any configuration of switches to run a device, easily. C++ can also handle 2. but it uses a larger memory footprint as a rule.



If you work on your math you will find that people are willing to give you a break on the language -- if the job is worth having. If they insist you must know C++/Java/Whatever either you are a very expendable member of the team or else they don't know what the heck they are doing (I insulted someone who asked a question here while using his experience as a team leader: he suggested that a subordinate appeared not to know what Java was, and my response was maybe he knew more about Java than he realized -- implying that Java was SO inappropriate for the task the subordinate was well advised to plead ignorance lest he encourage him).



I recommend learning more about C programming rather than learning C++.



EDIT: I feel like being insulting again. Not of D. I respectfully disagree with him about how "useless" math and statistics are to programmers. My sister was a programmer for about thirty years. Her Masters degree was in applied math. Her husband worked for IBM and Cogar and after her death taught Electrical Engineering in the New York Area. If you are going to do serious low-level programming, you need to understand algorithms and you will find that you learn the most about algorithms in math courses, not in programming classes. Programming classes can be very helpful, but they teach superficial things you can and sometimes have to pick up on the job. I'm not saying they aren't worth taking, they are if only because as in drawing classes you occasionally need a teacher to keep you honest, but they really shouldn't be as high a priority as other topics once you have what you need.



Anyone who has said anything REMOTELY similar to what I just said has gotten a thumbs down on this question. I can only assume it is the same person, and I can only assume that this person has NOT read your question. If it were just me, that would be one thing, but it's everyone on this list who says you might just work on a language which seems to meet your needs right now. That is called idiocy. It's called worse but Yahoo has a code of conduct.
2009-05-10 04:03:16 UTC
Well, you probably should learn C++. You can write anything you can write in C in it, and it shouldn't be much of a step up... (Hey, I'm 13 years old, and I already know quite a bit of C++. It's not that hard.) The main thing about C++ is that it introduces objects. This really isn't necessary for statistics or math, but for robots, games, and other real-time applications, object-oriented programming is amazing. Even if you end up not using it, you'll still have learned a very important programming language, and gained the basics of object-oriented programming.
2009-05-10 03:31:24 UTC
Most programmer use C++. Science and stats is really useless for programmers. Just saying. Either way I use and recomend C++. It's better the C in my opinion. But since you already know C it will help you learn C++ and knowing both lets you be more flexible.
Jeff Q
2009-05-10 04:20:25 UTC
C is probably still the workhorse of modern programming. Many open and extensible languages and products use C for extensions. A detailed knowledge of C will serve you well in learning most other procedural languages.



But there are other types of programming languages that are necessary to keep up with modern code development. C++ is a popular object-oriented programming (OOP) language, and it's mostly C already, so it's a good one to learn. It compiles efficient code, but it can be perplexing because of its hybrid origin. OOP languages built that way from the start are easier to use for modelling objects. Of those, Java is still quite popular, although it's taking a beating from so many new OOP languages.



It's good to learn some scripting languages like Bourne shell and its derivatives; Perl; JavaScript (especially for Web work); Python (often used with Linux software); PHP (for server-side scripting); and others. Web data and presentation languages like (X)HTML, XML, and all their cousins are necessary for working with browsers and web pages. Declarative languages like SQL (for databases) are important for dealing with large data collections. Logic programming languages like Prolog are often used in knowledge engineering.



All these can be useful, but what you should learn first really depends on what you want to accomplish. Focusing specifically on electrical engineering, you might look at SPICE circuit emulation, and some hardware description languages like Verilog and VHDL. Back in ancient times (around 1980), FORTRAN was still preferred for mathematics and scientific computation, and was used to create SPICE and its successors. As I said above, though, C seems to be the implementation language of modern SPICE software and is used for extensions, so your existing knowledge will do you well.



Frankly, you can use most languages to do mathematical and scientific work. I wrote a quicky BASIC program a couple of days ago to demonstrate how to model a probability problem. I usually just use whatever languages are available on whatever system I'm working on.



I suggest you grab a book or two from your local library or bookstore on engineering, scientific, or mathematical programming (probably easier to find in the math/science and engineering sections than the computer section, around 510-519 and 600-629 in Dewey-Decimal libraries). You might also visit nearby colleges or universities to see what kind of languages they use in their coursework. Some will let high school students borrow books with special borrower's cards. (I learned quite a bit of college math and science that way myself.) Good luck!



P.S. I've just read jplatt39's answer below, and he is exactly right that deep knowledge of mathematics and algorithms is FAR more important than which programming languages you know. Picking up any computer language once you've mastered C isn't very hard, but knowing how to apply higher math correctly to real-world problems is the essence of engineering, and there are probably dozens of great programmers for each great mathematician. In my humble opinion, he's given you the best answer so far.
?
2009-05-10 03:35:07 UTC
really, you should learn both of them, you have a better change of getting a job and getting the job done if you have more possible ways to write a program.



i highly recommend knowing both of them



also, nowadays must stuff is programmed in java. make sure to look into that too



hope that helps.
Sous
2009-05-10 03:23:51 UTC
Gratz.

Don't know either tho, but from what ive heard stick with C, its said to be more flexible.
2009-05-10 04:06:48 UTC
I would say C++, In C you dont have vectors,list, and you have to use pointers more directly than in C++


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...