A note to the naturally not good programmers out there

Thread Starter

camerart

Joined Feb 25, 2013
3,829
Hi,
I'm not a good programmer, and need a lot of help from forums, where there are lots of good programmers, that may help you.
Along the way, there will be techniques that the good ones use, which is good practice, but make us none good ones struggle.

I have been working on a project for years, and try almost every day for hours. It's an interesting thing to do, if jigsaws and puzzles done't suit.
The good programmers got me to tidy up my methods, by adding INCLUDES, PROCEDURES and FUNCTIONS, which can be used multiple times in programs, as a library, in a similar way to the ARDUINO system
While tidying my programs, it has slowed me down a lot, so I'm going to UN-PROCEDURE some of the CODE, move forward, then RE-PROCEDURE it back later.
I hope this helps others like me.
Camerart
 
Last edited:

nsaspook

Joined Aug 27, 2009
16,251
Don't do that unless it's necessary for the code to function. Going from structured code with procedure blocks to monolith code blobs won't make you code work. It will make your code worse.
 

Ya’akov

Joined Jan 27, 2019
10,226
I can understand your frustration, I've been through that.

But to be honest, properly structured code is easier to write. You just can't write it as if it is a conversion of your previous methods. It's not, you have to think differently not translate.

Do you ever draw flowcharts or dataflow diagrams? If not, that might help you a lot. The nodes in those diagrams are often the procedures and functions you need to hook together to make a good, maintainable, debuggable, stable program.

Also, if you don't already, comment your code whenever you have to work at solving a problem. Make the comment about WHY not WHAT—the code already says what it does, the question you will have in the future is WHY you did it that way.

Do what you have to! Good luck!
 

BobTPH

Joined Jun 5, 2013
11,463
it has slowed me down a lot, so I'm going to UN-PROCEDURE some of the CODE, move forward, then RE-PROCEDURE it back later.
My guess is that you don’t really understand structuring a program into functions. It is not just something you do because someone tells you to. It should be the obvious natural way to structure the program. Once you understand this, it is the way you think about the program right from the start.

Perhaps you need to take a break for a couple of months and study a course in structured programming, to get the whole picture instead of seeing little vignettes supplied by people like us on a forum. It has been so long since I learned this that I don’t know know of a current book or online course you could use, but perhaps some others here could make recommendations.
 

MrChips

Joined Oct 2, 2009
34,628
I use top-down design. In other words, I think ahead of what functions will be needed and just use dummy names to get started. The names will get implemented as working functions later.
I have a working program from the get go.

I will use C or Arduino pseudo-syntax as an example.

main( )
{
initialize
loop
}
 

liaifat85

Joined Sep 12, 2023
200
Hi,
I'm not a good programmer, and need a lot of help from forums, where there are lots of good programmers, that may help you.
Along the way, there will be techniques that the good ones use, which is good practice, but make us none good ones struggle.

I have been working on a project for years, and try almost every day for hours. It's an interesting thing to do, if jigsaws and puzzles done't suit.
The good prgrammers got me to tidy up my methods, by adding INCLUDES, PROCEDURES and FUNCTIONS, which can be used multiple times in programs, as a library, in a similar way to the ARDUINO system
While tidying my programs, it has slowed me down a lot, so I'm going to UN-PROCEDURE some of the CODE, move forward, then RE-PROCEDURE it back later.
I hope this helps others like me.
Camerart
Thanks for sharing your experience. I think proper indentation also helps a lot to tidy codes.
 

Thread Starter

camerart

Joined Feb 25, 2013
3,829
Hi All,
Thanks for the replies.

I've been programming since the 80s, with my son's christmas present, and leart by just watching him.

It's not a natural thing for me, but it's a means to an end, and will result in something I want.

I use indenting, and commenting, plus notes on paper.
I tried flowcharts, but they just don't make sense to me. I change my mind as I'm working, kind of scatter brained, but with a good idea.

As for monolith verses procedures! If I explain, that procedures feel like reading a book, with all of the pages mixed up and read it by checking the page numbers, very uncomfortable.

I've tried all of the previous suggestions, and I am improving but time's running out :)
I was thinking about poor programmers, and trying to help them, not so much you good programmers
C.
 

nsaspook

Joined Aug 27, 2009
16,251
Hi All,
Thanks for the replies.

I've been programming since the 80s, with my son's christmas present, and leart by just watching him.

It's not a natural thing for me, but it's a means to an end, and will result in something I want.

I use indenting, and commenting, plus notes on paper.
I tried flowcharts, but they just don't make sense to me. I change my mind as I'm working, kind of scatter brained, but with a good idea.

As for monolith verses procedures! If I explain, that procedures feel like reading a book, with all of the pages mixed up and read it by checking the page numbers, very uncomfortable.

I've tried all of the previous suggestions, and I am improving but time's running out :)
I was thinking about poor programmers, and trying to help them, not so much you good programmers
C.
Look, you're giving bad advice to poor programmers in general. In your specific case, maybe it works for you to move forward a bit but in general the answer is NO, stick to structured programming.
IMO this is why BASIC is a poor teaching language. It tends to create a initial spaghetti, flat programming style that's hard to break.
It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration - Edsger W. Dijkstra
IMO Python is the new BASIC.
 

MrChips

Joined Oct 2, 2009
34,628
spook makes good points. I started out on my computer journey firstly learning Fortran and then BASIC. My first industrial application was writing a very complex control program in BASIC. I quickly learned that that was not the best way to program for control systems. I then taught myself Algol and then Pascal. There was no turning back. I cannot recall the last time I looked at BASIC programming.
 

techman-001

Joined Jan 13, 2021
8
Nasa-spook and Mrchips, ... you guys bring back old memories!

In the mid 80's I had to repair and modernize some Dynapert DIP PNP machines, so I made a cordless computer using a Intel 8047 mcu with preinstalled Basic in rom to interrogate the machines and figure out the protocols etc.

As a result Basic was the first HL programming language I learned after assembly on the 6800.

I finished the PNP job and a few years later I tried to learn C but couldn't grok it at all. Goto statements had broken my poor electronics tech brain and I kept hitting a mental brick wall.

After spending 12 months trying to unlearn Basic, I bought a "learning Pascal" book and worked thru the examples, loving the clean organized structure, it all seemed so obvious and logical. What a great learning language Pascal is.

A few months later I easily understood some C code ... my neurons had been rewired!

Thank you Niklaus Wirth!
 

Thread Starter

camerart

Joined Feb 25, 2013
3,829
Hi,
I agree for the most part with all of you, and if it was possible I would change, but there are certain things that I'm simply not good at. I'm thankful that I ever learnt BASIC, and have programmed lots of projects including a complete photo lab with it.
I have a long list of other things that I can do adequately, I'm also thanksful I can do them.
The part of my brain that needs re-wiring to do programing or maths is not as large as yours, so be happy you can program using the programs you like.
NOTE: I've changed the title, for others that will never be good at programming, but wish they could.
C.
 

Ian Rogers

Joined Dec 12, 2012
1,136
Hi C.
I have been watching you for over 10 years... I think Eric will agree with me. Your programming skills are above average now.
The only thing I would say is keep it going. You are doing this for you. That is a comfort for you. I bet you get a buzz when something clicks every now and then.

Other programs are less forgiving than basic. If you ever need to "try" something else you wouldn't be surprised to hear that there is a basic.. 1000 times better and free. no simulator but it programs on the fly. I have been playing with picoMite basic. a pico is around £6 Geoff Graham and Peter Mather have created something wonderous. All in basic using an interpreter runs like lightning and everything fits sooo smooth. Read here! Geoff's Projects - The Micromite Official WEB Page (geoffg.net)
 

Thread Starter

camerart

Joined Feb 25, 2013
3,829
Hi C.
I have been watching you for over 10 years... I think Eric will agree with me. Your programming skills are above average now.
The only thing I would say is keep it going. You are doing this for you. That is a comfort for you. I bet you get a buzz when something clicks every now and then.

Other programs are less forgiving than basic. If you ever need to "try" something else you wouldn't be surprised to hear that there is a basic.. 1000 times better and free. no simulator but it programs on the fly. I have been playing with picoMite basic. a pico is around £6 Geoff Graham and Peter Mather have created something wonderous. All in basic using an interpreter runs like lightning and everything fits sooo smooth. Read here! Geoff's Projects - The Micromite Official WEB Page (geoffg.net)
Morning I,
10 Years! and thanks for your support over that time.
On good days, I can keep the concentration up long enough to move forward, but basically, I'm more of a co-ordinator for all of the CODE that you and the other forum members supply. This itself is brilliant, and I sometimes sit back and do get a buzz at the whole project.
In this subject, I get told a thing, say HW v SW and I've noticed it takes a year or two to know what that means, but I do seem to get most of it given time.
Regarding the Micromite system. As you know my project has been developed over the years including PCB design. So for me and the mate who is helping me, we need 4xPCBs which takes time and not cheap, so for me to change is a too big step, once again. Also I rely on the Oshonsoft simulator, where I can step through and see the bits etc change.
Cheers, E.
 

Thread Starter

camerart

Joined Feb 25, 2013
3,829
Hi,
I said I have difficulty with PROCEDURES at the bottom of the CODE, and not in line! I have one that is called about 5 times, and I put it back 5x in line and commented out the CALLs.
I got what I've been trying to fix for almost a year, working, then proof read each of the CALLS, and found one of them had a single BIT that was wrong, so I've put all of the 'same' ones back into the PROCEDUE at the bottom of the CODE, for now, and will re-check the 'odd' one later.
Just an example of how I have to work.
Cheers, C.
 
Top