General > General Technical Chat

Want advice on learning programing language for electronics C or JAVA or Python

<< < (6/7) > >>

rstofer:

--- Quote from: Zero999 on August 03, 2022, 12:31:18 pm ---I agree, it's good to know assembly language, but it's not worth using it to write entire programs in any more.

--- End quote ---
Even on modern ARM chips, the startup code is usually written in assembly code.  Just look for startup.S or crt0.S (sometimes lower case .s if the file doesn't need pre-processing) in the project.

https://github.com/MyEmbeddedWork/ARM7TDMI-LPC2148/blob/master/1.Docs/Codes/BUZZER/Startup.s

Sooner or later, you need to know this stuff.

nctnico:
The LPC2148 isn't a modern ARM microcontroller. The Cortex-Mx ARM controllers don't need any assembly to start or execute interrupts. You can use pure C to program these.

Personally I'm not sure whether knowing assembly is required nowadays. Mainstream compilers like GCC for mainstream platforms like ARM do generate correct code. If something does go wrong due to different optimisation levels, the problem is in the code and not the compiler. Knowing assembly has been handy for me but the times I use that knowledge become more rare.

Maybe it depends on what kind of projects a software engineer is working on. For low level stuff (hardware drivers) it can be handy but for higher level not so much. You can try to learn a million things but the trick is to learn only what is needed so you can spend more time on what really is important. All in all I'd concentrate on C and C++ for embedded development. A bit of Python for experimenting and maybe some embedded scripting could be handy.

tggzzz:

--- Quote from: nctnico on August 03, 2022, 05:49:47 pm ---Mainstream compilers like GCC for mainstream platforms like ARM do generate correct code. If something does go wrong due to different optimisation levels, the problem is in the code and not the compiler.

--- End quote ---

That's the traditional "victim blaming" attitude. Now it can be true that the core issue is PEBKAC, but IMNSHO there are so many instances of it with C (and especially C++) that the tools are part of the problem.

Why else was it necessary for Hans Boehm to point out to competent C programmers that you couldn't write threading libraries in C? Now that particular "surprising" deficiency may have been rectified in later versions of C. The excessive complexity and "feature interactions" which concealed that deficiency from professional programmers has only got worse.


--- Quote ---You can try to learn a million things but the trick is to learn only what is needed so you can spend more time on what really is important.

--- End quote ---

That's a very important point, and applying it has saved me countless hours of angst - notably avoiding C++ like the plague it is  >:D

I wonder whether Rust will diminish the appeal/necessity of C for embedded systems? That will become apparent over the next decade or so.

SiliconWizard:
While you can definitely write firmware for many projects without ever touching a line of assembly code, that is still a very valuable skill to have. It *will* come in handy at some point, whether it is for understanding or modifying some startup code when needed, or for debugging a tricky issue, especially if it's actually a compiler bug. And yes, you will occasionally run into one.

SiliconWizard:

--- Quote from: tggzzz on August 03, 2022, 07:22:21 pm ---I wonder whether Rust will diminish the appeal/necessity of C for embedded systems? That will become apparent over the next decade or so.

--- End quote ---

Uh yeah. I am now almost convinced that Rust is a lost cause. We'll see. ::)

Navigation

[0] Message Index

[#] Next page

[*] Previous page

There was an error while thanking
Thanking...
Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod