General > General Technical Chat
Want advice on learning programing language for electronics C or JAVA or Python
<< < (5/7) > >>
tggzzz:

--- Quote from: Sarvesaa on August 03, 2022, 10:37:08 am ---I have been studying and coding in JAVA from 9th grade to 12th grade as a part of school syllabus.
I did many programs that include fundamentals.For example
Scanner classes, Buffered readers, iterations, strings, arrays 2Dimensional 3Dimensional.
So I think C and other languages will be easy to learn.

--- End quote ---

Regrettably that is no longer the case. Arguably it hasn't been the case since the early 90s.

I presume that by "learn" you mean more than "no compilation errors".

The subtle details of what the language does not guarantee are problem for both the beginner and the experienced developer. Evidence:

* the existence of "language lawyers" that enjoy endlessly debating what a construct means and doesn't mean
* that increasing the level of compiler optimisation frequently changes the program's behaviour. When that happens it is defined to be "programmer error", which is the programming equivalent of "blaming the victim"
* the Linux kernel uses only -O2 optimisation, and -O4 optimisation is frequently forbidden by Torvalds. Make sure you understand why!
* what you can and can't guarantee depends on which version of the language you are using
* until recently it was impossible to implement threads as a C library.[1] Think about that. Many professionals didn't believe it, let alone understand it!
[1] http://hboehm.info/misc_slides/pldi05_threads.pdf http://www.hpl.hp.com/techreports/2004/HPL-2004-209.pdf
tggzzz:

--- Quote from: Zero999 on August 03, 2022, 10:49:06 am ---C is definitely the way to go for microcontrollers. Optimised compilers produce fast and light code and it's good for low level stuff such as accessing memory directly.

It's still good to familiarise yourself with assembly. I know it's not as important as it used to be, but it's still a good idea to know what's going on at a lower level.

--- End quote ---

See my previous post :(

Being able to read assembler is vital for embedded programming:

* when debugging
* when figuring out WTF the compiler has done now
Zero999:

--- Quote from: tggzzz on August 03, 2022, 11:54:13 am ---
--- Quote from: Zero999 on August 03, 2022, 10:49:06 am ---C is definitely the way to go for microcontrollers. Optimised compilers produce fast and light code and it's good for low level stuff such as accessing memory directly.

It's still good to familiarise yourself with assembly. I know it's not as important as it used to be, but it's still a good idea to know what's going on at a lower level.

--- End quote ---

See my previous post :(

Being able to read assembler is vital for embedded programming:

* when debugging
* when figuring out WTF the compiler has done now
--- End quote ---
Which post?

Did you ever post over on  Electro-Tech-Online? There was a moderator who would insist every beginner to microcontrollers should start with PICs and use assembly, not C, or any better architecture.  :palm:

Anyway, I got banned from there long ago, because a different moderator was too PC. He'd blame me and others for telling lazy students who signed up to get their homework done for them to bugger off.

I agree, it's good to know assembly language, but it's not worth using it to write entire programs in any more.
tggzzz:

--- Quote from: Zero999 on August 03, 2022, 12:31:18 pm ---
--- Quote from: tggzzz on August 03, 2022, 11:54:13 am ---
--- Quote from: Zero999 on August 03, 2022, 10:49:06 am ---C is definitely the way to go for microcontrollers. Optimised compilers produce fast and light code and it's good for low level stuff such as accessing memory directly.

It's still good to familiarise yourself with assembly. I know it's not as important as it used to be, but it's still a good idea to know what's going on at a lower level.

--- End quote ---

See my previous post :(

Being able to read assembler is vital for embedded programming:

* when debugging
* when figuring out WTF the compiler has done now
--- End quote ---
Which post?

--- End quote ---

My post was #21. My previous post was #20 :)


--- Quote ---Did you ever post over on  [urkl=https://www.electro-tech-online.com/]Electro-Tech-Online[/url]? There was a moderator who would insist every beginner to microcontrollers should start with PICs and use assembly, not C, or any better architecture.  :palm:

Anyway, I got banned from there long ago, because a different moderator was too PC. He'd blame me and others for telling lazy students who signed up to get their homework done for them to bugger off.

--- End quote ---

Never heard of it.

That mod sounds like a twat that insists "ontogeny recapitulates phylogeny".


--- Quote ---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 ---

Yup :)

Except for a trivial non-preemptive task scheduler which does little more than save/restore the condition codes, SP and PC :)
tom66:

--- Quote from: tggzzz on August 03, 2022, 11:54:13 am ---Being able to read assembler is vital for embedded programming:

* when debugging
* when figuring out WTF the compiler has done now
--- End quote ---

Add to it: when figuring out bugs in slightly obscure compilers... more so than just seeing implementation variations (where the compiler produces compliant but unexpected code.)

GCC is pretty bug free (in my experience) but I've found at least three code-breaking bugs in Microchip's XC8.

One fun one was that structures with more than 128 bytes size were not handled correctly on PIC18 because the offset-from-pointer instruction/register expected a signed 8 bit integer, but the compiler was treating this as an unsigned 8 bit integer.  Seeing the disassembly suddenly wrap around for high order members to negative pointer offsets was rather telling.
Navigation
Message Index
Next page
Previous page
There was an error while thanking
Thanking...

Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod