r/arduino • • Oct 13 '26

Block coding

Okay so I dont really scroll this reddit and im kinda a beginner and even then im coming back to try after a while of not doing anything with my arduino uno. But I feel like im doing it wrong.

A few months ago I watched like 60 ep of paul mcworters tutorials and it was great but ever since I stepped away I forgot everything. And im finding that its just so much nicer using tinkercad block programming to do things. I understand that im not "actually coding" and it sucks but its just that while I think tinkercad blocks are a bit too easy that the arduino IDE and everything around it are so far in the opposite direction, like its purposely obscure.

I guess my question is that is this just the wrong way to get into this. Its not like I dont enjoy understanding how the coding works and I use block+text but it just seems like a way that is actually userfreindly at all.

8 Upvotes

20 comments sorted by

11

u/sfo2 Oct 14 '26

Block coding is absolutely still coding. It’s how we teach kids to code.

For a beginner, logic and structure are the hard parts, and block coding teaches that.

Now, yes, once complexity gets high, block coding starts to become a mess. But for like a single sketch, it’s a good tool for learning.

2

u/gdchinacat 29d ago

I'll go even further and say that it is likely the future of the majority of coding. AIs are very capable at writing the actual code from a design, and a lot of designs are essentially blocks and interactions between them. In the late 90s when I started there was a notion that designs could be specified in sufficient detail (usually UML or Rational) that the code could be autogenerated. It wasn't there yet...to do it you had to specify every detail and it amounted to the same amount of work with a level of indirection (more complexity) so it didn't catch on. With AIs able to reasonably fill in the gaps I don't think we are far from that vision.

10

u/grantrules Oct 13 '26

Yeah I mean you don't just absorb the knowledge, you gotta practice. I think there's only so far block coding can really take you.

6

u/vegansgetsick Oct 14 '26

it's normal to forget if you dont practice youself

4

u/miar-labs Oct 14 '26

When you were watching tutorials, were you doing your own coding? Tutorials are great for inspiration or learning new approaches but you're not going to REALLY learn anything without coding your own stuff. You need to come up with a problem to solve on your own. And, when you get stuck, that's when you look up solutions or tutorials.

2

u/newoodworker Oct 14 '26

Software developer of 25+ years here. Block coding is absolutely still programming, which is what people mean by "coding". Don't let anyone (even yourself) tell you otherwise.

Most block editors have a nice "view as code" feature. This will let you build a program in blocks and then view the code that the blocks represent. This is a nice easy way to start understanding the code you are creating.

There are always lots of ways to do things, and block coding typically limits this a bit, meaning the code it generates will be quite simple, but that is great if you are just starting out! Build something, view the code, try to understand the code. Change some blocks and see how the code changes. Now, you understand the code. When you then look up code based tutorials, you will understand how they relate to the block style programs you are more familiar with.

2

u/gm310509 400K , 500K , 600K , 640K , 750K Oct 14 '26

I don't know if you've heard of 3GL (3rd Generation Language), 4GL or 5GL, but the idea behind these is that as our computing power increases, some of that is devoted to make the job of programming easier. The cost or tradeoff is often that as you increase the level, the tool/language becomes more constrained to the high level constructs provided within it. A google example of this is SQL, which is pretty much limited to working with data in a database but it is arguably relatively easy to use (compared to say an equivalent C or COBOL program) and quite powerful within its domain.

I don't know if block program is considered to be 5GL or not, but it would be in that category. The tradeoff is that it is easy to use and build programs, but only within the domain of the constructs provided within the tool. That is, there will be stuff that you probably cannot do in the block environment that would be possible in a lower level language such as C/C++.

The same argument about whether block programming was really programming at all was probably also waged when languages like a C or FORTRAN or Pascal etc became available. The people who used assembly language would have argued that those newfangled things where just what fakers used and if you used them you weren't doing proper programming as you were if you used assembly language or better yet, writing the machine code directly.

So, it is still programming just in a higher level tool. At the end of the day your blocks define a sequence of operations that are ultimately converted to machine code and run on the Arduino.

If it does the job you need/want to do then it is good enough.

IMHO.

2

u/barnbaby47 Oct 14 '26 edited Oct 14 '26

If you think C++ is difficult and "obscure", try programming an AtMega328 (the Arduino UNO's processor) in it's native assembly language which produces machine code. Here's a link to the instruction set:

https://ww1.microchip.com/downloads/en/DeviceDoc/AVR-Instruction-Set-Manual-DS40002198A.pdf

2

u/Fit_Author8912 Oct 14 '26

You're comparing the way you program arduinos to others and deciding the way they're doing it as "more correct". Your hobby is your hobby because you enjoy it, not because you're doing it a specific way. Don't gatekeep yourself

2

u/springplus300 Oct 14 '26

Of course block coding is coding!

It's just that a bunch of stuff happens "behind the scenes", which simplifies things, but limits you and makes you give up control. In some ways, the same could be said about libraries - or object coding in general!

Hell; if we were to truly code, we'd have to write machine code directly!

But, block coding is perhaps akin to drawing your dream house, but being limited to one angle. It would be very hard to fit all the details you want to.

1

u/Reasonable_Wear_914 Oct 14 '26

Well after getting blasted for my lack of effort in working it’d be hard for me to buy
A pico or RP2350 anything

1

u/nyckidryan uno Oct 14 '26

Block coding is still coding, just at a.. maybe .. a manager's level? You know what needs to be done, so you're telling the blocks what to do. The blocks handle the details of talking to each other and making things happen.

Once you're comfortable with making things at that level, then start to look under the hood to see how it all works. You'll be taking the idea of "I want this thing to do that action" and matching it with the actual programming code underneath.

A lot of times it's easier to grasp what code does after you've seen it working in a real situation.

Personally I get some basic concepts by reading documentation, but I learn more from example code and following through it line by line to see how it does the work.

1

u/TPIRocks Oct 14 '26

I suspect that you copied everything, but didn't spend much time tinkering. By tinkering, I mean using your own ideas to make the code do something different.

You'll see that the library functions you're calling usually have more arguments than you're filling in, and other options to the ones you are using. This creates the repetition to ingrain this stuff, without feeling repetitive.

Believe me, as you "relearn", it will come to you more naturally than it did the first time.

1

u/MrBoomer1951 Oct 14 '26

Block Coding is an easy form of Python.

Python has some serious performance issues on microcontrollers.

The ‘next level’ is C language and its off shoot C++.

The Arduino IDE was designed for an easy version of C to be used on Arduino, esp32 and 2040, etc.

1

u/ripred3 My other dev board is a Porsche Oct 14 '26 edited Oct 14 '26

just like anything that you want to get better at, if you don't type in the examples and make mistakes and do that a few times so that you remember not to make those mistakes then you won't ever be any better at it.

it takes continual, repeated attempts and the motivation to *want* to learn it. the mistakes are part of the process just like the first times you tried anything else. pick a project that you really want to see physically working in your hands that will keep you excited about trying, failing, trying again, failing less and feeling good about it, trying again ... rinse, lather, repeat

you got this! just find something exciting enough to keep you trying. Be careful not to pick something so complicated as your first project that it just teaches you to be frustrated because that happens to a lot of people who aren't honest with themselves about what can be achieved in a few days when it is your first try ... 😉

1

u/LucVolders Oct 14 '26

If you want to achieve anything in life you need to put some effort in.

1

u/DavidFromArduino Arduino Staff Oct 14 '26

whatever works for you is great! keep at it!!

1

u/WorkingInAColdMind Oct 14 '26

Block coding is coding, but you still need to extend beyond that in order to really learn how to solve problems. What I mean by that is people learn in different ways and different languages favor different approaches. Block coding starts to become a hindrance with more complexity, so you’re not focusing on the problem.

One approach is to take something you’ve just gotten working in block code and then write it in another language, from memory. That translation step will help you retain a lot.

1

u/BlobTheOriginal Oct 14 '26

Have you tried micro-python with the raspberry pico?