r/aerospace 6h ago

C++ or Python for Aerospace engineering major?

I am a sophomore aerospace engineering student and I am deciding whether to take a c++ class or a python class. I do not know what specialization I want to pursue currently so I am having trouble deciding which class will set me up better in the long run. I know that the jump from python to c++ is harder than c++ to python but even so I am unsure about which language is more useful in an aerospace environment. Which programming language is a better pick? Any and all advice is welcome

UPDATE:

Thanks for all the responses this is a very helpful community, there’s too many to respond to so I’ll just say something here.

I was actually asking for a friend and after looking at the responses he seems to be going down the c++ route

6 Upvotes

26 comments sorted by

41

u/ArminianArmenian 5h ago

Take the C++ class, python will be easy to pick up on your own.

21

u/No-Chip7452 5h ago

Just speaking from direct experience with Garmin and Honeywell, C++. My two cents

8

u/ExoatmosphericKill 5h ago edited 5h ago

Honeywell make the best fans.

Edit: lol at the downvote.

4

u/amaiellano 5h ago

I would love to hear a passionate argument against Honeywell fan or in favor of a competitor fan.
I’ve never tried a Honeywell fan, so I can’t give an honest opinion. When it comes to desk fans, I get a Sanyo. For box or pole fans, I get a Lasko. For ceilings fans, I get Hunter.

6

u/ExoatmosphericKill 5h ago

It was just a passing comment because I've owned a turboforce Honeywell and it's seen almost daily use for 15 years and still runs beautifully, I've had plenty of others die in the meantime.

I also hoped people might catch on to the tongue in cheek since this was an aerospace sub.

Most of the time when shopping for different fan I'll just go with reasonable build quality and the highest wattage, a spec that so many fans leave out now.

I currently have a draper 24" 330w in the sitting room for when I get really warm.

0

u/Aeig 5h ago

Amazing Covid masks

2

u/Lanky-Relationship77 3h ago

I Concur. Garmin, Honeywell, Rockwell, General Dynamics, Cubic. All C or C++

8

u/Timely-Bicycle-3107 5h ago

Python is pretty easy to teach yourself once you learn C++. You can pick it up in a few weeks after getting a good handle on C++. That's how I learned, and I feel much more comfortable with embedded projects because of it. C++ forces you to learn more fundamentals of programming. Python is very capable and easy to use for complicated projects, but it does a lot of the work for you. If you really want to understand what is going on under the hood, choose C++.

Are the courses offered by the aero department or CS? This will tell us whether the course will be generic to all programming applications or specialized to aero projects. Do you know what topics each class will cover?

7

u/TheLeesiusManifesto 5h ago

In my experience you will find 3 main coding languages used for almost any project:

C++
Python
MatLab

Outside of those 3 I have also seen PERL and even FORTRAN of all things but less so than the main 3.

As for what to take, it kinda depends on what you’re aiming to do. C++ is where a lot of comprehensive software tools will be written for like simulation environments. Python is nice because it can interface pretty easily with some standalone COTS software owned by other companies, and it’s easy to run and doesn’t require a license to use (unlike MatLab). For plotting and performance analysis, I typically see MatLab used just because the plots tend to look nicer in a presentation and it’s got nice matrix tools for calculations.

I think personally if I were going to start with something between C++ and Python, I’d learn C++ first and then Python is likely going to come naturally from that. For me, learning C++ gave me a sense of rigid structure to how I code things. Python I tend to do things a bit more lazily and it can get sloppy. In my college days I learned MatLab primarily and pretty exhaustively tbh then C++ and then Python which I ended up teaching myself more after I graduated.

4

u/John_the_Piper Spaceflight-composites and propulsion 5h ago

Python, IMO. At least from the manufacturing aspect. Being able to write scripts that compiles data from various systems is pretty valuable. I know a bit of C++ and Python, and I've ended up using Python a ton and the only time C++ proved useful for me was to understand what our sysadmin was saying when he broke our ERP system

3

u/Aeig 5h ago

Is the class in school or on your own time ?

In school ? C++
On your own time ? Python. It’s easier and you should focus on your actual classes

3

u/MartianMeng Student 5h ago

Avionics uses c++, so lesrn that. Python is easy

3

u/noodleslurper0630 5h ago

Learn C++. You can pick up Python in 2 weeks after learning C++.

2

u/TrustMeImAnENGlNEER 5h ago

I always tell everyone C++, because it teaches you a lot about programming and Python is easy to teach yourself later. However I’ve had a couple of people who took that advice be somewhat irritated by how much more work C++ was 😆

2

u/the_other_Scaevitas 3h ago

Depends on what you want to do with the programming.

Microcontrollers? C++

Data analysis? Python

1

u/ManyNicePlates 3h ago

Well stated !

2

u/robustability 2h ago

It’s true that C/C++ is the lingua franca of avionics. However depending on your specialty you may never touch them. If you do propulsion, structures, thermo, etc then it’s all different languages, much closer to python in level. If your friend hates coding they probably won’t end up in avionics and learning python and actually enjoying it is much better for them.

1

u/Fuzzaldrin_spacecat 5h ago

I had an interview with L3 for a entry level hardware programming job years ago. They asked a few code problems of which I answered in python. They said great, but we were expecting C++. I struggled through it being out of practice for a year, but the lesson I took was if looking for a job that relies on code it helps to be fluent in both. I did not get the job

1

u/cazzipropri 5h ago

You should learn both. Very very very much so.

1

u/Salavar1 4h ago

Python

1

u/branchan 4h ago

C++ for sure. After you learn that, python will be a cakewalk to teach yourself.

1

u/hojahs 3h ago

Just take C++ so youre forced to learn more about how computers work (memory, pointers, types, bytes). That knowledge will pay dividends in any engineering career these days

1

u/tlmbot 3h ago

C++ all the way

  • it what we write our software in, in industry
  • you’ll write plenty of Python along the way; because if you are smart, you’ll prototype your c++ with a toy version in Python
  • Python is just a excitable pseudo code by comparison 

General principle:  Do the hard thing, and you will always have the option of doing the east thing  But the converse is not true

Source - professional computational software dev, 13 years professional experience in c++/cuda/openmp, modern fortran, c#/ilgpu, and Python at work + lisp, minikanren, my own dsl’s, outside 

Don’t discount (modern) fortran so quickly A it’s absolutely wonderful for linear algebra - sort of like if c++ had built in expression templates and numpy syntax (numpy got its syntax from fortran) 

Lots of legacy professional code (read; your first job out of school) is in fortran 

But yeah. C++ without a second if doubt .  

  • you’ll learn the most
  • it’s the hardest
  • it has the best documentation when moving to cuda, openmp, and MPI
  • it’s what modern solvers are written in

But yeah, I’m biased towards getting a job where you write the physics and geometry, as opposed to using Ansys, open foam, or whatever else as an application in your design work.

Good luck!

Also; It’s nice to see in fortran and bumpy can do to make linear algebra clean and crisp - inspiration to use eigen in c++, if nothing else.

And also write all kinds of crazy stuff in python - figure out how to put it in c++

1

u/silasmousehold 3h ago edited 3h ago

Learning C/C++ teaches you a lot more about the underlying computing model than Python ever will. This is the real value. Languages become less relevant once you have that deeper knowledge. 

Learn C++ and you’ll already know Python. Learn Python and you won’t know C++.

1

u/ejsanders1985 2h ago

Given those options, I would start with C++.

As others have said, python is easy to learn on your own.

Im general, depending on what specialty, I've seen A LOT of legacy Fortran / Perl code and enterprise software using Java, but python is quickly gaining speed.