Libraries and learning

I think there's a form of Dunning Kreuger that goes "whatever I don't know about Must Be Difficult".

1 Like

And yet, you answered it :wink:

not sure what you want to adress

don't knowing:

  • serial input basics
    or
  • SafeString-library
    or
  • something different?

my grandfather was inclined to say in such cases:

"Man kann sich die Hose auch mit einer Kneifzange anziehen".

the difference in coding is - transferred back to the trouser-example:
there is a robot available that can lift you up in 2 seconds pull on your trousers and doing a short massage at the same time to make you feel comfortable and relaxed.

learning all the basics transferred back to the trouser-example is
learn how to

  • thread spins
  • Weaving denim fabric
  • tailors a pair of trousers

this list can be expanded down to

  • Growing Cotton from Seeds
  • planting cotton
  • Plant protection for cotton
  • harvest cotton
  • processing cotton
  • iron extraction
  • sewing needle manufacture
  • scissors manufacturing
  • etc. etc.

The limit of how deep you want to understand all this is simply drawn at different points

This point can also be:
Very easy to customize code. This is only a gradual difference not a principal difference

best regards Stefan

People's "reasons" to not learn whatever and end up using black box code that adds unknowns and pushes the coder even farther from what they're writing.

Because no one needs a bridge to cross a wet floor, that's how "deep" c strings ARE.
What's next, special libraries to deal with the simplest array manipulations as well?

1 Like

This is true. But the human race developped a level of scientific knowledge that can't be hold by a single person. This point that a single person can hold all relevant knowledge is centuries in the past.

To me there is no principal difference between SafeString and FastLED, or LiquidChrystal, Wire.

You all take these libraries like FastLED, or LiquidChrystal, or Wire, or grafic-LCD-drivers for totally common without recommending learn the basics of:

  • serial bitshifting,
  • I²C-basics,
  • and higher-level I²C-communication like with an I²C-LCD or a graphic LCD-display

So please can you explain to me what is the real difference between SafeString and Wire?
except Wire is really low level (oh I guess this is really too complicated for newcomers) but Serial input is not too complicated.

If somebody is interested in how it works she/he will dig in regardless of what it is.
Even making transistors in the kitchen

This is a complete NON-POINT that has NO BEARING ON WHAT I WROTE.
I'm not gonna bother with the rest after that diversion.

The POINT is that simple, basic knowledge of the language you code in is NOT beyond learning in class or from books and practice. Nobody is being asked about microbiology here, or any other arcane subject. PERHAPS C WAS EASIER TO LEARN BEFORE C++ WAS INVENTED.

I get the feeling that you prefer the crutches.

1 Like

That's really OK. How about writing more easier to understand tutorials about the real basics?
Or at least a link-collection of existing tutorials that explain the real basics in a really easy to uderstand way.

The reference with this super-short example codes is the opposite of easy to understand.

Well what is seen as "crutches" is a question of definition and habits.

Is it a "crutch" to use the Arduino-IDE?

Yes Arduino-IDE is a crutch. Everybody should build up the tool-chain from scratch!

YES ! People should only use compilers if they have written three compilers on their own! Because there might be a very rare bug they can only discover if they have personal experience in writing compilers and know what to search for it in the compiler-logs.

Oh no no no ! Using microcontrollers is a crutch. Everybody should build their own microcontroller from scratch using logic gates!
How shall they ever understand how the internals of a hardware-timer works without that?!

Oh no no no ! Using logic gates is a crutch. Everybody should build logic gates from self-fabricated transistors!

This is all gradual and not principal.

We have different opinions and haven't convinced each other to change it.
So let's go back to direct answering questions. Some responses short worded giving keywords for googling some responses with demo-codes.

best regards Stefan

The ones I can find complete with a simple web search?

Please save me your overblown, past any real point RHETORIC!

amen

What did I miss?
How is readUntil() or parseInt() not blocking?

A post was merged into an existing topic: Finite state machine on arduino with Serial Interrupts

I've split this from https://forum.arduino.cc/t/a-post-in-finite-state-machine-on-arduino-with-serial-interrupts-requires-staff-attention/1004114 as it was way off topic. If someone wants to suggest a different title I'm happy to change it.

Thanks,

Hi Perry,

very good that you splitted it of. Indeed offtopic.

my 2cts

Introducing a very complex set of libraries that has no wide spread usage (even in the Arduino ecosystem) to replace something that is so entrenched in the language that its name (cStrings) shows it has been there from the start and prevent the user from acquiring infinitely reusable skills about arrays and size management is a complete no go for a tutorial... Or the tutorial title should be "How to use the over bloated SafeString related libraries do to XYZ taking the less traveled path"

The other point is that using the SafeString library does free you from testing for overflow - which is (to me) where the fallacy in the name is. it's not safe unless you test for overflow anyway : sure the code won't crash because of the overflow but you need to catch that error anyway, in the same way you would with cStrings.

So if you need that skill of handling overflow, why not start with the basics and arrays in your learning path ? then you gained something you can apply to any array not just cStrings.

Very good idea. Write the tutorial for it.
No fun writing the tutorial? Then the less traveled path will become the more traveled path over time.

speak French ? ➜ Introduction à la mémoire et aux pointeurs sur Arduino

any C or C++ book will discuss cStrings otherwise and it's so entrenched in the language that there is a common library documented everywhere

https://cplusplus.com/reference/cstring/

(which is used by the SafeString library)

indeed a good explanation of basics. Though it arises the question

How much tayloring knowledge do I need to wear a jeans?
If I would like to be able to repair the jeans myself in case a trouser-button gets loose
I will need it this part of the taylor-knowledge.

While learning about the rough outline of how something works is an important skill in many regards, using third-party libraries to abstract the exact details of that away is a programming technique that goes back to at least the days of BASIC, and which every professional programmer does.

As a full-stack web developer, I could not possibly understand every detail of

  • the x64 CPU my server side code runs on
  • the variety of CPU architectures my client side code could run on
  • the Linux kernel
  • the internal architecture and query language of my database system
  • the entire JVM instruction set (admittedly fairly small)
  • the various JavaScript engines my code will run on
  • the Linux virtualization stack
  • Docker
  • the HTTP protocol

and a variety of other things my software relies on. Heck, I barely even understand how a BJT works. Even if I did, manually dealing with all of those things would mean that even implementing a basic REST API for CRUD operations on a single resource would be a matter of a lifetime. So I don't - I use libraries who abstract those things away, and preferably do so in a matter that allows me to write code which concisely communicates my intent rather than rolls every layer of my stack into a big ball.

Admittedly there generally are far fewer layers between user code and the silicon in Arduino, and every one of those layers is a lot simpler, but still: Using libaries which only require the user to understand how the libraries work is a more productive way to develop software than insisting on doing things on foot, and it results on more readable, more maintainable code as long as the libraries in question are well-designed.

StefanL38 has already made this point fairly well, but we don't tell people to learn how to deal with I/O registers in AVR assembly on a breadboard before we graciously allow them to buy an Arduino Uno and use digitalRead/digitalWrite/analogRead etc., and for good reason.

Of course, you still need to learn how your programming language and the libraries you use actually work, and troubleshooting will often require you to jump into the libraries.

1 Like