HELP FOR NEWBIES. Have you heard of flow Charts?

While they're not all that common nowadays, software developers used to use paper and a writing implement to visualise the flow of their software.

You can do this as a 'big picture', or to draft individual functions.
It helps recognise scope, overlap and optimisation of your logic.
Of course it's not nearly as much fun as wasting hours, days or weeks - and pissing off forum regulars that answer exactly the same questions on a weekly basis.

The pen & paper flow diagram works in a similar way to the original word processor.
It doesn't need batteries, and includes NVRAM to store the most recent changes.

The pen & paper flow diagram works in a similar way to the original word processor.
It doesn't need batteries, and includes NVRAM to store the most recent changes.

More like OTP memory as it's bloody hard to make changes.

I can't stand flow charts, but I may have a job coming up that uses a product called Flowcode so I may have to get used to them :frowning:

Flowcharts are antiquated tools for those who lack the vision to admit that they haven't the slightest idea what they are doing and cannot see where they are going.

123Splat:
Flowcharts are antiquated tools for those who lack the vision to admit that they haven't the slightest idea what they are doing and cannot see where they are going.

And sadly, that describes around 80% of the posters here!
A bit of fundamental knowledge would help a lot.

I agree that flow charts in their traditional form - are almost useless with modern toolchains, but a basic understanding of the principles involved would help everyone writing something more complex than blinking two LEDs at a time.

Think... nested loops, switch(), break, and every other program flow element.

Just make sure to get a template. I still have mine.
Flowchart template

When I was in college a lot of the engineering professors where part time from General Dynamics. One mentioned he had a flow chart for missile control software that covered the wall of his office. I really don't see the point of that.

I think Top-Down is better.

I don't know if Flow Charts are the answer (I can't really remember what they are) but some mechanism that causes a newbie to think of a project as a collection of small parts (functions) would be useful.

There is also a different and additional thought process involved with seeing a program in the style needed for Blink Without Delay. I wonder if a Flow Chart might hinder than by creating the idea of a start-to-finish program rather than a round-and-round-until-we-get-tired program.

...R

Robin2:
I don’t know if Flow Charts are the answer (I can’t really remember what they are) but some mechanism that causes a newbie to think of a project as a collection of small parts (functions) would be useful.

…R

Which is what Top Down Programming does:

Step 1:

BakeCake()

Step 2:

BakeCake()
{
getIngredients();
turnOnOven();
mixIngredients();
pourIntoPan();
putIntoOven();

while (!isCakeDone());
removeFromOven();
eatCake();
}

step3:
Keep refining each function, breaking it apart as needed.

I was taught to use a Nassi Shneiderman Chart to develope my programmes

I have a saying on my dry erase board, used to have paper....

WE PUT ORDER INTO CONFUSION

I would offer a thrid approach.

list the inputs and outputs

input :
soil moisuture ( 4 plants)
temperature
humidity
water tank level

output :
pumps (4 pumps )

scope of what you want to in your words.
*** sense moisture and water plants.

this is gonna happen if you write it down or not. but it helps us to understand the scope,.
and you can pick one thing and get that done.

if water level is too low,
then turn on the main fill pump.

if plant 1 is too dry
turn on pump1

and then just add to the scope.

I do agree that there should be an introduction to how to post and I offered the moderators that there should be a simple test at the end of 'how to use this forum' in which the person has to do make a fake post and post code.

the subject line could not : be in all caps, could not contain newbie or help,
and the fake post would have to have code tags.
get that right you fill in a chatchka......

as for THIS thread, a simple introduciton to how to do the most basic program would be in order.

dave-in-nj:
That is great for documenting classes and functions, but does not lead you to a well structured program.

KeithRB:
Which is what Top Down Programming does:

That is the general approach in my Planning and Implementing a Program

But I don't really know whether that is consistent the use of a Flow Chart or not.

And I repeat, there is still the need to get across the idea that (for example) mixIngredients() should not be a blocking function.

...R

I believe the background principles in top-down style, and flow charts are virtually the same.

In either case, if your top level is 'combination lock()', and eventually drills down to 'release bolt()'.... it's no use if you don't understand how you got there.

Some newbie coders jump from straight the top to the bottom, then ask for help... 'why doesn't the keypad work?'... 'how can I make it ask for more than one digit?'

As for a wall-sized chart, that's simply a reflection of the complexity of the program architecture. Not all flow charts will fit on a single page of paper... but some functions() might. I recall a team of nuclear scientists I used to work with- that had a map of the early 'Dungeons and Dragons' on their entire wall... because it wouldn't fit on a small stone tablet!

KeithRB:
dave-in-nj:
That is great for documenting classes and functions, but does not lead you to a well structured program.

it is hard to un-know a thing.

to you, the basic concept of a write follows a read is so basic that you cannot think any other way.

to a newbie, the most fundamental, the most basic, is new. we see posts asking if they want to control 2 relays, how to connect two UNO’s… as if you need one uno for every output…

also, as you list your inputs, you might as well just start in with
analogRead this and digitalRead that…

a newbie does not have the most basic structure in their head.

Your point is valid, but I’m so frustrated with these pseudo tools like fritzing and processing that push learners down absolutely the wrong path, then stomp on their head to make sure they’re completely off the track of good design practices.

We can’t answer simple project questions if the OPs don’t understand the difference between analog, digital, pull-up or any other fundamental.

If they would actually spend half as much time as the helpers spend trying to address their questions - they’d be halfway there!
I don’t know which is worse, posters wanting a free walk handout, or those that are too lazy to use google or the help pages!

dave-in-nj:
a newbie does not have the most basic structure in their head.

+1

and add to that the fact that so much of what goes on in our own heads is hidden from us so that incredibly complex processes (like face recognition) appear to be trivially simple.

Learning to program means learning to see all the simple steps that are needed to achieve a complex processes.

...R