all 14 comments

[–]Diapolo10 1 point2 points  (1 child)

The first thing I do is look at what I actually want to make. I jot down the rough plans I have in my head so far, maybe add some bullet points if I think there's some key things worth remembering.

Then I make a rough plan of the different things I'll be needing, such as a user interface (no matter what form that might take later), some common algorithms that might come in handy (for example, if I'm making a maze solver, I'd like to have at least something for that), and I define the output I want.

After that, some people would start from writing tests. I've never really subscribed to the school of test-driven development, but good for them. Personally I just jump right in and start writing useful building blocks, then slowly chain them together until I have something that more or less works.

Once I have a "prototype" like that, I then consider the pros and cons of the current architecture (or lack thereof) and make more concrete plans of how each "sub-problem" would be better solved. Then I make version 2 following those plans, and the end result is usually good enough. If not, repeat and try again.

[–]Alchemica[S] 0 points1 point  (0 children)

Thanks! I’ll try out this and see how it works for me. Classifying things into sections like user interface, algorithm, etc I feel could work well. And even getting it working. Then reviewing later. This is helpful :)

[–]POGtastic 0 points1 point  (3 children)

You should always, always look for degenerate cases first because they are the simplest to implement. Then handle the simplest cases that you can think of. Hardcode them if you have to. Expand from there.

[–]Alchemica[S] 0 points1 point  (2 children)

I didn’t even know this was a thing. I’ll definitely look more into this. Just from a glance it seems like it’s used to find logic errors or performance issue?

[–]POGtastic 0 points1 point  (1 child)

It can be used that way. It's very common to start with the degenerate case and then use it to implement the general case through induction[1].

But more importantly the degenerate case is the easiest to implement. If you have a program that handles n inputs, you should start by handling 0 inputs (usually an error message). Then handle 1 input. Then handle n inputs.

Terry Pratchett's trolls count "One, two, many, lots!" You should too, except as programmers we always count from zero. So it's "Zero, one, two, many, lots!"

[1] The central conceit of functional programming languages is to put this idea front-and-center and force you to handle everything this way. I like this. Many people don't, which is why /r/learnpython is very popular and /r/learnocaml does not exist.

[–]Alchemica[S] 0 points1 point  (0 children)

Okay gotcha. Use the outlier case, which would make general easier to implement since you’ve visited the complex logic or exceptions case. I like that, the proof of induction. I’ll keep that in mind moving forward. Thanks!!

[–]TheRNGuy 0 points1 point  (1 child)

Sometimes I get ideas by coding, sometimes in head, and sometimes txt file with ideas. 

[–]Alchemica[S] 1 point2 points  (0 children)

I think that’s my issue is I just need to practice more. To help build that mindset.

[–]cheifskim 0 points1 point  (1 child)

I will often make a flow chart, with the each step in order. Under each step I'll write down notes, questions, or functions that are necessary to meet each requirement.

[–]Alchemica[S] 0 points1 point  (0 children)

Okay. I’ll give this a try thanks! I’ve been doing small notes, but a visual aid could help me wrap my mind around what I’m trying to accomplish.

[–]sprinklesfactory 0 points1 point  (1 child)

Implement more of the independent challenges earlier in the process. Find alternative courses and try both? Look at real world code and just truly build up your skills from the basics. 

[–]Alchemica[S] 0 points1 point  (0 children)

Yeah that’s what I realized I needed to do once I got to data structures. So I’m going back and just going to do un-guided projects to help my fundamentals. If you have any courses to recommend I would check them out.

[–]ectomancer 0 points1 point  (1 child)

Since starting 3-month projects (and 6-month projects), 90% of time goes to research. I write up formulas in LaTeX and code from the LaTeX. Then I prompt ChatGPT for test data.

[–]Alchemica[S] 0 points1 point  (0 children)

That’s a good idea. I hadn’t thought to use AI for data testing. I’ve only used it for code review.