Programs Mechanical Engineering or CS Degree

So I was talking to one of my friends who is a huge programmer, and he said that you don't even need a computer science degree to work in software. He said that companies would rather teach a mechanical engineer how to program, than a computer science grad how to problem solve, and that out of the 15 programmers his company has, only 2 have CS degrees.

Is this actually true?

I am currently pursuing an associate degree in Mechanical Engineering, and have been thinking about switching to CS because it seems like something that I would like. Hearing this is making me reconsider though, as I very much enjoy mechanical engineering as well.

I hope to go into management at some point, and I want to work on something that has to deal with robotics. I honestly think the programming side of robotics is what I'm interested in the most, which is why I was thinking about switching to CS.

It is true that companies looking for programmers are often more interested in programming skills than credentials. However, it is also true that people who have not gone through formal classes think their programming skills are better than they are. (CS majors may not be any better, but they usually know what they don't know)

Speaking as a CS graduated here. Learn how to code is one thing. Learn how to code right is another. And learn how to think in a programming manner is even another.

Sure you can learn how to code, this is easy. It is like learning a new language (though much more logical). Pick a language and learn its commands. This, however, only allows you to do the more simpler stuff on the programming market. I know a handful of coders that have nice Jobs, but all they do is to write a bunch of boring codes (very repetitive, simple, not much logic and usually very bounded to a specific technology - like Microsoft C#, for example).

To code right is to know, for example, complexity theory and the more fundamental stuff (as in What type of operations are faster, how to avoid cache miss, disk access, use pointers if you are in low level). All that is hard to just make a training and learn at once. It takes time, and it takes time of the company because untill you start making optmized code, for example, it will be a long road. Most people I know working on the core algorithms running inside top softwares are CS guys, or math or physics with CS MSc or Phd.

To think in a programming manner is to know how to tackle problems using the known structures that are already available (and a lot of times proved correct). For example, to know the best data structures for each situation, graphs. How to know if a given problem is P, or NP-Complete, and not to waste time trying to create an exact algorithm that wont scale, when you should really be going for an heuristic. Also there is the knowledge on concurrent systems, avoiding deadlocks, starvation which are all simple, but you gotta have the knowledge built from some long road, you dont learn in one day. And all that lack of knowledge can have big costs to the company. For most top level jobs in programming, where you almost dont code, but rather think on how others will code, basically everyone I know today is from CS, or CE.

TL;DR : Yes, you can learn how to code, and most companies do teach that. But they wont teach you things that sometimes are needed to work on more top systems or core system, like critical.

EDIT: Just to be clear, I'm not saying you can't learn that stuff. I'm just saying that a company won't teach you most of that. And when they need this knowledge they will likely rire a CS guy. I have been tô a Google interview and they covered lots of knowledge specific to the CS degree.

Also, CS is not a big school on programming. In fact I had only two classes during the entire course that actually thaught me how to code.

Yes, but as you point out, it is often more important to know what to code.

Oh indeed. I was just making the point that CS is not about coding stronger.

On another note about the problem solving skills. I think that all math related courses develop their own set of problem solving skills. I know a lot of people from engineering that are very good at their fields (civil, mechanic, chemestry) but have trouble coding, and usually come to me for aid. CS does prepare you with solving skill, is just that they are directed at CS problems, which are usually very abstract.

If the OP wants to work with robotics, specially the programming side, I would suggest going for a CS degree, or completing the ME and going for a CS MSc and Phd. In my university the robotics center is in the CS departament. They work with all the software and hardware side. They work, for example, with AI applied to robotics, and for that one should be familiarized with the main algorithms and techniques existing in AI.

If the OP is interested in robotics, I strongly urge him/her to stay with the ME studies. This will teach much more about WHAT is needed, and as has be pointed out, it is no great trick to learn to write computer code. The robotics person needs to understand more about kinematics and dynamics, as well as forces, so that he/she will know what calculations are needed.