Here's some advice on how you should go about designing a program before you sit down and actually start writing code. (Or how you should design changes before coding them.)
I'm a great advocate of going through some kind of design process before writing code, instead of opening your editor or IDE and typing stuff in, hoping it'll work.
The specific design process is up to you. I'm going to describe one such process that I use in hopes that it might be useful to someone. Each of us has our own way of putting things on paper; it's the putting things on paper part that I want to emphasize.
In another thread here ("Moving things around the screen w/GDI" in the Windows Graphics Programming subforum below this one) I posted several versions of a demo program. The last version solved a tricky problem, which was what state the program should be in according to what the user did with the mouse.
I solved the problem--easily--by diagramming the actions of the user and the resulting responses of the program on paper. Once I worked through my diagram and saw that it was correct, I proceeded to write the code based on it. And it worked right off the bat, without having to tweak it by trying this and trying that.
Here's the diagram:
Moving stuff around FSA.gif
This is one of my favorite types of diagram. It might look complicated at first but it really isn't. Technically this shows what's called a "finite state automaton" or FSA. It's a set of nodes (the circles), with actions in rectangles. For each action at a node it tells you what state it should go to. For example, if we're at the "idle" node (S0) and the user presses the left button, then we should go to the "selected" node (S1), where we'll draw a selection box around whatever was clicked on. (That's assuming that we get a "hit" on that something.) If we're at node S1 and the user starts moving the mouse, then we go to the "start move" node, S3, and start moving the object on screen.
Once you can draw a diagram like this, the code practically writes itself.
I first drew this on paper, then decided to pretty it up by drawing it with CorelDraw. Obviously, you don't have to go to that length; a sketch on a piece of scrap paper will do fine.
Since someone here (Zedd) wrote that they'd prefer different actions for this program when the user releases the mouse (left button up), they could come up with a new diagram based on that behavior, and the program would work the way they want it to.
There are lots of other places where you can use this general idea: something I end up sketching a lot is memory organization when I'm moving data around. Putting it down on paper is a big help to see what has to be moved where, and in calculating offsets, move distances and such.
The main point I want to get across is this: if you're working on any kind of programming problem that isn't completely obvious to you (maybe you've done it a thousand times already), get out paper and pencil and draw it out until it makes sense to you; that's your guide to coding.
Of course, if you're some kind of frickin' genius, then you probably don't need to do this. But for the rest of us mere mortals, this is a great way to save time and frustration.
A flow chart ?
A project management skills are useful and needed for developing groups.
MS Project is for that.
Quote from: TimoVJL on April 30, 2025, 10:02:57 AMA flow chart ?
Yes, flowcharts are good. I still use them.
QuoteA project management skills are useful and needed for developing groups.
MS Project is for that.
Project management skills are useful ...
Learn to write proper English, Timo.
Quote from: NoCforMe on April 30, 2025, 10:11:20 AMYes, flowcharts are good. I still use them.
Quote from: NoCforMe on April 30, 2025, 10:11:20 AMLearn to write proper English, Timo.
Wow, a compliment followed by an insult :rolleyes:
Are you bipolar?
Maybe English is Timo's second language? Not sure about you, but I don't speak a second language, so "me 'ats orf to 'im".
Quote from: sinsi on April 30, 2025, 10:35:14 AMMaybe English is Timo's second language? Not sure about you, but I don't speak a second language, so "me 'ats orf to 'im".
I'm sure it is his second language.
All I know is that if I was going to post in a forum in [whatever Timo's native language is], I'd sure as hell try to learn it at least well enough to not sound like an idiot.
https://www.projectmanager.com/blog/project-management-skills (https://www.projectmanager.com/blog/project-management-skills)
Quote from: NoCforMe on April 30, 2025, 10:45:20 AMAll I know is that if I was going to post in a forum in [whatever Timo's native language is], I'd sure as hell try to learn it at least well enough to not sound like an idiot.
Ackshooly you do it here fairly often,
amiright?
Or does this mean that English is your second language? :badgrin:
Pretty sure Timo is from Finland, known for their brevity of speech (as evidenced by his posts here) :biggrin:
QuoteLearn to write proper English, Timo.
Gee David,.. whilst (with reference to your many previous discussions and errr 'suggestions' to myself) and therefore understanding your English/Punctuation "Soup NAZI" attitude,.. I seriously think that initial response to Timio, is completely Uncalled for !!
In my review of the many posts by the many members here over time, there were (and still are), members with FAR worse command and use of the English language than Timo !!
QuoteI'm sure it is his second language.
Yes, it is !!
QuoteAll I know is that if I was going to post in a forum in [whatever Timo's native language is]
Interesting perhaps that after all these years, you are still unaware :rolleyes:
QuoteI'd sure as hell try to learn it at least well enough to not sound like an idiot.
Really ?? Would you now ?? ... Well Best of Luck with that,.. and ... with respect, I think you may find Learning 'His' Native language, so as NOT to sound like and 'Idiot' (another seriously unnecessary & unwarranted Slur btw), slightly harder than your arguably inflated Language mastery might find.
Please correct me if I am Wrong, (and I'm Sure you will lol) but from my understanding, Finnish is considered to be a seriously Challenging language to learn, especially for English speakers.
The Finnish forum members might applaud you for trying but unless you spent an awfully long time learning the complex Grammer, an 'Idiot' might very well be what you sounded like too and considering the amount of time it would take to Learn the language well enough to competently formulate a coherent sentence to ask the question, it may very well be easier to simply ask the Finns the question in English,.. invariably a language they would have been taught at school and use at worst, well enough to be understood :smiley:
I honestly don't believe criticizing people's use of English and calling them Idiots because of same is appropriate behaviour in Pleasant 'Civil' society,.. or this Forum.
Quote from: sinsi on April 30, 2025, 11:27:55 AMQuote from: NoCforMe on April 30, 2025, 10:45:20 AM... learn it at least well enough to not sound like an idiot.
Ackshooly you do it here fairly often, amiright?
Or does this mean that English is your second language?
:joking: :rofl:
I was going to mind my own business, but that was too funny.
Quote from: sinsi on April 30, 2025, 11:27:55 AMAckshooly you do it here fairly often, amiright?
Or does this mean that English is your second language? :badgrin:
So I take it you're completely unfamiliar with the idea of irony, and of using colloquialisms in informal language.
Quote from: stoo23 on April 30, 2025, 11:32:40 AMQuoteLearn to write proper English, Timo.
Gee David,.. whilst (with reference to your many previous discussions and errr 'suggestions' to myself) and therefore understanding your English/Punctuation "Soup NAZI" attitude,.. I seriously think that initial response to Timio, is completely Uncalled for !!
And you; when are you Going to Stop with the completely Weird and Nonstandard capitalization that You insist On? Seems like some kind of uncontrollable tic with you, like Tourettes?
I sometimes use simple sketch apo on my android tablet to make flow charts and concept art for grsphics
Its kinda kids simple drawing app,not photoshop touch
I disagree,in this forum x86 masm is our native language :)
Quote from: NoCforMe on April 30, 2025, 11:45:18 AMSo I take it you're completely unfamiliar with the idea of irony, and of using colloquialisms in informal language
I know what irony is and I don't ackshooly* see any here. Nor any colloqialisms.
*
see what I did there?
QuoteAnd you; when are you Going to Stop with the completely Weird and Nonstandard capitalization that You insist On?
When I damned well feel like it !! ..... Perhaps .....
As explained previously, I use it correctly or incorrectly, as a form of Delineation and/or Emphasis.
I am quite happy to be both aware of and appreciate it's incorrectness and also seriously hope it doesn't overtly annoy anyone other than yourself,....
My random Capitalization aside,.. I do not criticize peoples English or call them Idiots in general intercourse on the forum,.. because of it.
As stated a number of times before with yourself, there are many more things occurring in this world,.... especially atm to worry about and general Rudeness, is uncalled for and with reference to the forum rules, Respect of other members is suggested.
I honestly don't think that is inordinate or too much to ask for, let alone .... Expect :smiley:
Quote from: stoo23 on April 30, 2025, 12:10:05 PMQuoteAnd you; when are you Going to Stop with the completely Weird and Nonstandard capitalization that You insist On?
When I damned well feel like it !! ..... Perhaps .....
As explained previously, I use it correctly or incorrectly, as a form of Delineation and/or Emphasis.
I am quite happy to be both aware of and appreciate it's incorrectness and also seriously hope it doesn't overtly annoy anyone other than yourself,....
Then I assume you're OK with my occasional use of "ackshooly", yes? Then it's a deal.
(Which anyone familiar with English will recognize as an
intentional misspledding.)
I did Not comment on that,.. I was ONLY concerned about you calling Timo an idiot and telling him to learn to write proper English.
Although, that said,.. I DO find your use of words/phrases like that odd (as do others I would note) :wink2:
Quote from: NoCforMe on April 30, 2025, 12:41:30 PMThen I assume you're OK with my occasional use of "ackshooly", yes?
No problem at all, it's when you complain about others for a minor error.
As for Timo's "A project management skills" are you complaining about the "A"?
QuoteFinnish doesn't use articles like "the" or "a," which can be confusing for English speakers who are used to articles
He possibly thinks that the subject is "project" as a noun.
Of course, as an aussie, I can't talk about the English language :biggrin:
My family know what a pedant I can be and continually try to trigger me.
Of course I can't resist :biggrin:
Quote from: sinsi on April 30, 2025, 01:22:53 PMQuote from: NoCforMe on April 30, 2025, 12:41:30 PMThen I assume you're OK with my occasional use of "ackshooly", yes?
No problem at all, it's when you complain about others for a minor error.
As for Timo's "A project management skills" are you complaining about the "A"?
QuoteFinnish doesn't use articles like "the" or "a," which can be confusing for English speakers who are used to articles
He possibly thinks that the subject is "project" as a noun.
Yes. But we're communicating in English here, not Finnish.
With that said, and I'm sure this little side trip into language and such has been immensely enlightening and suitably entertaining, perhaps we can get back to the topic on hand?
Well, I agree with Timo, a project management skills are useful.
Quote from: sinsi on April 30, 2025, 02:15:51 PMWell, I agree with Timo, a project management skills are useful.
Perhaps, but what I'm trying to get across here is that we have much simpler, more direct and more personal tools we can use to help guide our coding. Simple things like paper and pencil. Even in a project-managed project, these things have their place.
(Or in daydreamer's case. a tablet computer.)
Quote from: NoCforMe on April 30, 2025, 02:30:13 PMQuote from: sinsi on April 30, 2025, 02:15:51 PMWell, I agree with Timo, a project management skills are useful.
Perhaps, but what I'm trying to get across here is that we have much simpler, more direct and more personal tools we can use to help guide our coding. Simple things like paper and pencil. Even in a project-managed project, these things have their place.
(Or in daydreamer's case. a tablet computer.)
Pros with waterproof tablet,you can use it outside sunny day,but too windy for paper
It doesnt get destroyed if it suddenly starts to rain like paper does
Pros with paper,you can reuse ,used newspaoers,ad papers from stored its free
Good to keep pen with you
And making sketch backups are easier in tablets than from paper.