<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix"><br>
*if* you want to do C++, here are some pointers:<br>
<a class="moz-txt-link-freetext" href="https://www.artima.com/shop/effective_cpp_in_an_embedded_environment">https://www.artima.com/shop/effective_cpp_in_an_embedded_environment</a><br>
<br>
I once found those presentation slides freely downloadable
somewhere, and it didn't seem fishy... (maybe this offer is fishy,
or terms changed)<br>
perhaps you might, too.<br>
(Scott Meyers... knows C++)<br>
<br>
<br>
If you want to "make stuff", soon, and you learned C, 10 years
ago, and will almost exclusively program things for STM32 and
similar,<br>
then perhaps you might want to try a while gaining/refreshing some
experience with C programming first, though.<br>
<br>
C++ always was a complex beast with lots of opportunities, even
subtle ones, to really dig yourself into the dirt.<br>
But this hasn't exactly improved, in that regard, in recent years.
The amount of stuff you need to understand, and think about next
to your actual task at hand, to get anything done is not small -
especially if one of your aims is to do it "properly".<br>
While some of C++ newer versions' aspects can also help for
embedded development (off the top of my mind, you can do complex
stuff at compile time more easily, elegantly, understandably - and
what's done at compile time doesn't need to be done at run-time),<br>
I'd say the majority of additions help make C++ more competitive
with newer, higher level languages to do stuff on embedded
platforms.<br>
<br>
There are some nice things about even the "procedural" subset of
C++ doing things differently that C in some ways that annoy be
about C.<br>
Then again, in C99 and C11 has some things that make some typical
embedded stuff nicer (look for free documents explaining what
C99/11 got new vs. C89 / ANSI, to get an idea.)<br>
E.g. assigning of const arrays in an explicitly indexed way, or in
similar vein, assigning structs (or arrays of such) qualified with
member names.<br>
So if you want to make const data structures that get put into
program memory, which is usually much more plentiful than RAM on
such devices, you can do so, right in the code, without any
external fumblings (or ugly macro trickery) assign things in a
manner that's very readable and not so likely to be wrong - like
it can get if your initialization depends on the order of
something else and must remain in sync with it during
development/maintenance, to avoid making more complex/wasteful
structures that would also prevent this problem.<br>
<br>
I will now list some not free resources, i.e. books.<br>
You might be able to get them used and cheaper than the listed
prices here.<br>
<br>
If you (also) want to use C:<br>
<br>
One way to get an idea of how to craft programs which are not an
infinitely intertwined mess is - to keep things *testable*.<br>
Here is one book that demonstrates how to do that in C.<br>
Although it promotes the "write tests first, then the
implementation" way, which weirds out some people - nobody forces
you to do that. May still be interesting.<br>
<a class="moz-txt-link-freetext" href="https://www.amazon.com/Driven-Development-Embedded-Pragmatic-Programmers-ebook/dp/B01D3TWF5M">https://www.amazon.com/Driven-Development-Embedded-Pragmatic-Programmers-ebook/dp/B01D3TWF5M</a><br>
<br>
<br>
A more general classic:<br>
<a class="moz-txt-link-freetext" href="https://www.amazon.com/Code-Complete-Developer-Best-Practices-ebook/dp/B00JDMPOSY">https://www.amazon.com/Code-Complete-Developer-Best-Practices-ebook/dp/B00JDMPOSY</a><br>
<br>
<br>
This might be useful if you're not very experienced. Just in case.<br>
<a class="moz-txt-link-freetext" href="https://www.amazon.com/Debug-Repair-Prevent-Pragmatic-Programmers/dp/193435628X">https://www.amazon.com/Debug-Repair-Prevent-Pragmatic-Programmers/dp/193435628X</a><br>
<br>
<br>
----------<br>
I saw this while looking for the links - don't know this one, but
ratings look good?<br>
(note that libopencm3 has GPL license, IIRC, in case that matters)<br>
<a class="moz-txt-link-freetext" href="https://www.amazon.com/Beginning-STM32-Developing-FreeRTOS-libopencm3-ebook/dp/B07DGGHZN6">https://www.amazon.com/Beginning-STM32-Developing-FreeRTOS-libopencm3-ebook/dp/B07DGGHZN6</a><br>
<br>
<br>
- Steve<br>
<br>
<br>
Spiros Makris wrote:<br>
</div>
<blockquote
cite="mid:CAGbpyRdfE4ATacKa6v7s+fX3y7=6u54y3eP2NLkwrAO13GZPsw@mail.gmail.com"
type="cite">
<div dir="ltr">Hello list, <br>
<div>I want to improve my coding habits so that my results will
stay maintainable and easy to mod/reuse in the future. The
scope of my applications (thus far) is sequencing and other
similar low frequency control/real time devices. I use the
arduino platform a lot for it's incredible simplicity and
driver availability (I love you Teensy) but I'm trying to
transition to STM32 eventually, seeing it as a more "serious"
and professional platform. In both cases I use C/C++.</div>
<div>I was officially taught C while studying in the university
but that was 10 years ago and I've only picked up programming
again in the past two or three. I understand digital hardware
and the core C concepts, however, I don't have the opportunity
to work alongside an experienced colleague to learn how I
should write my code to be up to "industry standards" (= not
be an unmaintainable mess etc) and I'm looking for something
to refer to, other than my own trial and error.</div>
<div>Example topics include anything from structuring headers to
using globals or structuring function calls- especially under
the prism of embedded applications. I would appreciate any
suggestions on online resources or books.</div>
<div><br>
</div>
<div>Regards,</div>
<div>Spiros</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Synth-diy mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Synth-diy@synth-diy.org">Synth-diy@synth-diy.org</a>
<a class="moz-txt-link-freetext" href="http://synth-diy.org/mailman/listinfo/synth-diy">http://synth-diy.org/mailman/listinfo/synth-diy</a>
</pre>
</blockquote>
<p><br>
</p>
</body>
</html>