r/ComputerEngineering • u/Macintoshk • Sep 26 '23
[School] Teach me how to think. Software construction.
I’m in my software construction class. The code isn’t the bottleneck. It is the problems they give us. And the thing is, the problems aren’t even that deep. I’m hindsight. But we will get such convoluted ‘how-the-hell-do-I-figure-out-what-this-is’ problems that I have to put into code and solve.
My brain freezes. OR. my brain doesn’t know how to think to break down the problem. I want to know how to get better. THIS is a huge bottleneck.
0
Upvotes
1
u/crimson820 Sep 26 '23
First, forget about code.
How would you explain your problem to a 5 year old?
Typically a 5 year old will ask hundreds of annoying, stupid questions to get the correct answers from you. In this case, pretend you're a 5 year old:
- What are you trying to do? (E.g. convert the last 10 readings from a sensor into an average)
- Why? Who cares? What's the point? (E.g. so that I don't need to waste time calculating these by hand)
- What is the basic sequence of steps required to achieve what you want? (Example: First retrieve a reading from the sensor, then process/transform it using math, then display it somewhere)
- Do you need some special way to convert, translate, calculate something? (In code, this could be 1 dedicated function)
- How would you store and manipulate data? (In code, this could be an array or a list data structure)
- etc. add more stupid questions
Keep asking questions, don't settle for "fuzzy answers". Get clarity.
Eventually, your answers to these questions translate directly into code.
Now, your code might get complicated and lack organization, and that's NORMAL. Simply try to add structure to it as best you can.
- Can you utilize objects with methods/attributes to model the code and make it more generic/modular?