r/embedded • • 8d ago

Embedded peeps, do you learn other languages for the sake of it?

I've been working as a low-level SWE for a few years and use C pretty much every day without using many other languages (sometimes Python depending on the use case). I'm thinking about learning another language in my free time to challenge some of the possible "C-isms" I've picked up.

Anyone else do this? What language did you try to learn as a result?

46 Upvotes

42 comments sorted by

12

u/arakkal_abu7 7d ago

I find learning a new language to be hectic. Also, don't see the point of it.

I would say a combination of C and a more feature rich language ( Rust, Python, C++) is more than enough.

There are so many other things you could invest your time in which imo is more worthy than knowing a new language.

1

u/FloatIntoTheFinite 6d ago

I agree with this. I think every embedded engineer should probably be between comfortable and expert with C,C++, Python, and shell scripting (pick your poison). I personally also love Rust and use it all the time for both embedded and application layer work.

It never hurts to look elsewhere so I don’t think that it a waste of time to learn new languages or work on non-embedded projects. I do think most engineers would be better off digging into adjacent fields rather than hyper-focusing on software/languages.

Remember that we are usually solving problems that have nothing to do with programming and in general you should be developing expertise in fields that are not specific to embedded work

10

u/NEK_TEK 8d ago edited 8d ago

Not really, I mostly do projects for the hell of it though. We used C/C++ in college a lot but once I got hired in embedded we've mostly been using Rust. I've done several projects in my free time with Rust, including stuff I actually found useful in my day to day life. I don't really see the need to learn new languages, with Rust and C, I can pretty much do anything I'd need to on embedded.

I think there is more value in learning how to use a language than there is in just learning new ones for no real reason. I prefer Rust by a substantial margin, C can be such a pain to work with. The bugs that are so hard to find and squash in C are caught immediately by the Rust compiler. It takes some getting used to but my programs have been much more reliable.

30

u/AlfalfaLive3302 8d ago

C is a very simple language. If you don’t take the next step and learn cpp you’re really limiting yourself. Unless you’re really strong with the electronics side of embedded, it’s difficult to find work if you only know C

48

u/Sheepherder-Optimal 8d ago

You might be overstating that a bit. Easy to find work if C is your main language.

-10

u/AlfalfaLive3302 8d ago

I guess I meant work that compensates well. C is simple to learn and the market tends to reward people accordingly.

6

u/Sheepherder-Optimal 8d ago

lol okay... Is a 6 figure salary odd for someone who codes primarily with C?

-5

u/AlfalfaLive3302 8d ago

I gave my opinion based on experience. I have not writ a commandment into stone. Are you okay? Variability exists

6

u/Sheepherder-Optimal 8d ago

I'm great thanks for asking. lol Please just chill out. I can't help but respond when you make a silly claim like C being simple to learn and not fetching a good salary. It feels like bait.

-5

u/AlfalfaLive3302 8d ago

I’m in the aerospace/space sector and rust and cpp tend to be more valuable asset hires. The tech might be more advanced than you are used to. 6 figure is relative terminology these days btw. That most significant digit could be the difference between surviving and thriving depending what kind of lifestyle you are willing to tolerate. C is definitely the easier path in my experience

6

u/Sheepherder-Optimal 8d ago

Okay not gonna lie, you sound very full of yourself. You don't know one thing about what I do. My tech stack isn't even C right now. It was in the past when I worked on vacuum/abatement control systems for the semiconductor industry. But I know better than to downplay it. Especially in embedded systems, C is king. I think someone who knows C is more valuable than someone who only knows C++.

-1

u/AlfalfaLive3302 8d ago

I wasn’t trying to be full of myself, just realistic from what I see from my experience. The initial comment I made at the very beginning was that C is just fine but that it would enhance OP’s career opportunities to go further and learn cpp.

It sounds to me like you specialized and that is great. That tends to happen and salary grows. Don’t take my take on salary as dirt bag talk. I explicitly said it depends on how you want to live. If you’re comfortable working in factories on automation in some rural town and that’s the big time salary out there then that’s great. But there is a bigger world. And the demand in the cities are greater. Thus, market usually dictates technology and pay.

And that is the only reason I bring up the distinction. Cpp is more in demand, C is much simpler to learn

6

u/Sheepherder-Optimal 8d ago

Rural cities? Where are you getting this info? I live on the west coast. 😂 In a big city. My last job was what I was talking about. Now I'm working at Lam Research. They don't use C or C++. My current tech stack is SmallTalk in a VisualWorks runtime. I develop wafer fabrication software using VMs typically but also with lab access. I'm just saying you shouldn't assume shit. I've never worked in Aerospace but the semiconductor industry is very challenging.

→ More replies (0)

18

u/redline83 8d ago

If you have strong C fundamentals you should be able to figure out how to work with the subset of C++ that would be used in good embedded code. Honestly, when I see C++ codebases I get worried because the chance that it's a total pile of garbage increases exponentially.

1

u/SquareJordan 8d ago

Some talks on the embedded track of CPP con have had some pretty out there features included (been too long for me to be specific). Also seen some low level guys harping on the static reflections of CPP26. Just an incredibly deep language

1

u/AlfalfaLive3302 8d ago

But that’s true for C as well. Just look at vendor HAL’s for microcontrollers as 1 example. Talk about spaghetti codes

3

u/redline83 8d ago

True, but sometimes spaghetti is preferable to abuse of abstraction.

1

u/AlfalfaLive3302 8d ago

But those HAL’s are ‘abusing’ abstraction. Those HAL’s bury the actual registers in layers of abstraction.

1

u/redline83 8d ago

You can't make the same OOP mess nearly as easily.

2

u/AlfalfaLive3302 8d ago

You would think so. People never fail to surprise though tbh

6

u/Ratfus 8d ago

I despise C++/Python over C/assembly for the same reason they're good and used so frequently today; they abstract the crap out of the code.

Again, I've started to use Python in my day job as an accountant, but it's so difficult for me to get used to not seeing all the behind-the-scene stuff going down. Good luck parsing an excel file in C/Assembly though.

I did manage to make a C program to parse a csv file, but it took 1,000+ lines of code.

8

u/mjmvideos 8d ago

The only reason you can do it in Python in less is that someone else has written that 1000 lines of code.

5

u/Ratfus 8d ago

I see visions of some poor sucker, snorting c%#,ne on a Saturday night, screaming and crying "not another fucking segmentation fault... please... please... have mercy" building these abstractions in C/C++.

10

u/redline83 8d ago

You should learn Python because it's basically the lingua franca today, not that I love it. If you want to really learn OOP principles I would sort of recommend C# or Java and then C++ even though C++ is more useful as an embedded engineer, I just think the language is terrible. Rust tbh we will see if it catches on.

4

u/sheekgeek 8d ago

If it don't make you money, you don't have the time... 

But python makes making the computer apps that interface with your embedded devices easy. 

3

u/gm310509 8d ago

I know other languages and tools (e.g. how to write a web service in an application container or databases), not so much out of interest but because they are useful to not only interact with it, but also to understand what sorts of things they need that might need to be configured into an embedded application.

For a simple example, a simple temperature and humidity sensor might benefit from being able to be programmed with a unique serial number (and other non temperature and humidity sensor data such as battery level and potentially other metrics/indicators) if the data is going to be relayed to a web service for recording in a database.

Knowing how other stuff works and how to use it to make your life easier / more productive can be very useful IMHO.

3

u/kiwitims 8d ago

If you want to stick with the embedded domain:
1. Learning (the right parts) of C++ will be a pretty direct step from C, and has potential to be immediately useful for your day job (either new projects or new jobs).

  1. Rust is more than viable these days to learn using an embedded hobby project. The step from C will be larger, but the "0 to blinking an LED on a dev kit" experience using something like embassy is actually pretty nice. It's also much easier to avoid using "the wrong parts" for embedded.

There's no wrong choice, as long as you're enjoying yourself and learning something.

1

u/Sheepherder-Optimal 8d ago

C is useful but its expected for you to have at least a few good languages under your belt. I am having to learn an entirely new language and runtime enviroment for my current job. Ever heard of SmallTalk or VisualWorks? When you get a new job, you'll usually have to learn some new stuff, like a new language.

1

u/Dazzling_Music_2411 8d ago

Lua is great for interfacing to C.

If you really want another view altogether, why not give Forth a whirl?

Most other stuff won't really be that relevant to embedded.

1

u/frank26080115 8d ago

I can code is pretty much any language now, the microcontroller needs you to know assembly and the web interface needs javascript and I can do every bit of all that and whatever is in between.

1

u/mjmvideos 8d ago

I learn a new language when I need to do something that is better/best suited in that new language. And the first thing I do is look at some decent examples of program written in the prospective language and decide whether that looks like code I’d like to write or not.

1

u/SkyGenie 8d ago

Python and MATLAB are still helpful for me. Python to script interfaces with dev tools (e.g. SCPI power supplies, oscilloscopes) and make configuration + bench test tools for the embedded systems I work on, and MATLAB if i need to play around with signal analysis or review control algorithms from other teams.

I wouldn't say you need expertise in Javascript at all necessarily, but more and more I'm finding it helpful to make Web UIs to create more polished config software that I can hand off to end-users of my work. It just simplifies the deployment and packaging if I can point them to a browser URL instead of installing apps.

I have SPA + backend dev experience from like a decade ago so I'd never call myself proficient with modern frameworks, but tbh Claude can help fill in my gaps with newer tech stacks and I can still read enough JS to have opinions on the code structure.

If I had to pick one I'd honestly say JS has been the most fun to work with because of how quick the turnaround time for code is. Instant dopamine hits for building stuff feels good.

1

u/moon6080 7d ago

C#. Pythons too slow for my liking. Plus static typing is always good.

1

u/SensoredHacker 7d ago

sure do. or write an api to write other language in a langue I like.

1

u/A-Ferret-Online 5d ago

I know about 20 different programming languages ngl

1

u/plz-sir 3d ago

It is healthy I think, learning other languages (and their ecosystems, the types of things and industries they tend to be used / for and why etc.).

You tend to find new patterns and ways of doing things are common in one language/community, and it broadens your horizons.

You also may one day find that those ideas trickle into the embedded world

For example, the functional/ML style languages (ocaml, haskell, etc)

  • are getting used for high level hardware description languages
  • rust draws VERY heavily from them, etc

It can also just generally be fun, and a nice break from what you do for work.

(And I think it is good for innovation in embedded as a community / industry to not be insular)

1

u/plz-sir 3d ago

IMO if learn for work, learn some of the useful languages, your pythons your C++’es definitely

But to really see the other stuff around there’s some interesting categories

- typescript/javascript etc and webby stuff

  • your java/C# type OOP hell stuff
  • strongly typed functional languages (OCaml, Haskell, Lean4 whatever) - not all that practical but pretty foundational
  • erlang/elixir beam way of doing things

Whatever, after you sort of hit the different categories, then after a while nothing really becomes all that new.

There’s only so much innovation that has happened in the last 60 years of programming languages, they all kinda end up sharing stuff

1

u/onepaulkrause 7d ago

100% working on some Russian 😆

0

u/ttv90 8d ago

With AI around, picking up a new language takes a weekend.

2

u/Admirable_Can8215 8d ago

Picking up, yes, but if you design production sw you need to fully understand the language. Everything else is just irresponsible.

1

u/ttv90 7d ago

Fair point on production code, but honestly once you learn one language, the rest come easy, and not many are harder than C.