Ask coding questions

← Back to all posts
How do you plan your code?
xolyon (339)

While I am quite the lucrative programmer, I sometimes know I can solve an issue or error but just don't know how - and I find it difficult to plan efficiently

so please tell me how do you plan for long or complex projects

btw I do plan by using a Flowchart or Psuedo code (depending on the situation but as I said I feel like I am doing it inefficiently

Commentshotnewtop
MrEconomical (2236)

I dont plan for long complex projects I just do it

EmrePython (7)

First I try to understand the problem. Spend adequate time to really understand the problem...Solve it in your mind first.

Then, break it into smaller problems, if the problem is a big one to solve. Slice the problem into smaller problems. diffucult = Easy + Easy + Easy

And using a flowchart is really helpful to visualise the problem and choosing the right path and forming the algoryhtm .

There are some good and free flawchart programs and services to use..

RafaelH_us (1)

@EmrePython this is what I do I am glad to see that I am not out of my mind. Doing a light walk through a complex problem helps to asses the workflow. I feel that for every one hour I plan I save four when building out.

EmrePython (7)

@RafaelH_us Exactly dear friend. And it is what Einstein suggested. Yes, he actually suggested to spend adequate time to understand the problem...Only then act..Spend 55minutes, 5 minutes for the Action:)..It was something he said. So we should follow the genius recommendation..otherwise, all languages and tech are just tools...First we need to understand and solve the problem in our head, and not just copy/paste codes. Also thinking the Big O Notion is another thing we ned to think beforehand..Not unnecessary codes...Also writing comments for even our code is a good practice because we may even have difficulty to figure out what we really tried to do once:), if it is a complicated code of course.

What you do is the logical thing in my opinion as well. Good practice. Greetings dear Rafael

[deleted]

I don't plan, I copy and paste from w3schools

AlexanderTarn (270)
  1. Think about something to code (You will encounter stupid ideas)
  2. Break down ideas into smaller ideas
  3. Code everything you know
  4. go do 10 ask posts and wait 2 days for answers
  5. complete code and get 10 upvotes
    That's what I do.
Vandesm14 (2437)

I use Dynalist for larger projects. Once I get a good idea of the structure and plan, I move over to Clickup for the task management (I prefer Clickup over Trello for all of my projects).

RogueHalo (400)

Wait, you guys plan?

PaoloAmoroso (143)

I start by writing some simple code or a minimal prototype to quickly experiment with the problem and learn about the domain, then use it as a base for planning how to evolve the system.

Kognise (414)

For complex projects I usually start with a "spec" document that outlines all the parts and exactly what they do. Then I jump into visual design.

JacobMacLeod (11)

I usually just think of the first thing I need to do and go from there. I have done a list of things I need to do and the time it will take once or twice, but not as a common practice. When I encounter any issues I usually try to plough through it. If that fails, I use a flowchart to thing of the logical steps the code will take to get the desired output. At that point, I will have broken it down enough to be able to implement each step in the flowchart. I don’t use pseudo code as it doesn’t really help me.
Sometimes I also search the internet about how to do a specific task, but I prefer to do it myself

code5 (15)

While it is good to sit down and plan your project, you won't always have the time for that. Some projects don't need to be very well thought of. In fact, if you're a beginner and not quite advanced enough to do things like AI learning and building a neural network then you don't need to sit down and write step for step, or try to problem solve, your code at all.

Literally all you should do is think of something you want to make, you may have to do some research if you're using some modules that are new to you, but for the most part, as a beginner, the best thing to do to advance further and beyond in the CODING experience is not take time out of your day to sit down, write on a piece of paper. To me, anyway, the best you can do is just get straight into it. Learn from your mistakes. Go in empty handed, see in what parts you could use notes in, and you'll learn from your mistakes. Have fun, don't feel stressed over needing to write on a piece of paper steps to a solution. GET THOSE HANDS DIRTY. But overall, it is your choice. To me, it is easier to just get straight into the code because I enjoy learning without needing to write it down. I am just like that.
But yeah, if you wanna split it into smaller pieces and work on a certain part of it a day then you can do that. If you want to write it on a piece of paper, which I am sure no project is going to be advanced and complex enough to be planned on a paper, then get a good feel on it.
What do I recommend? I recommend that you think very clearly of what you want. Think of what you want your project to do, what you want it to affect etc, and I assure you when you get into that terminal, the code will already exist in your head. Yes, you will run into errors every now and then, but I again assure you, if you sit for a good 10 minutes and think about what you want to build, what you want the project to do, what you want it to affect, etc, then you can do some research on the imports you are using, or you can get straight into it, and the code will be right there in your brain ready to pour out into the console. P.S: I am sorry if I am saying module in this, I am a Python developer which deals with great amount of researching time, and a great deal of modules to get the project you want.

Giothecoder (132)

I make a lot of pictures. Like I don’t just draw one pic, I draw like three. Maybe that’s just me trashing bad ideas? Anyways I do that and I also do a bunch of pseudo code, making sure to split stuff up and calling 'functions' that aren’t implemented yet but I can clearly understand what they are supposed to do. Once I have all this pseudo code I start from where I can find the first thing(fake function) that has absolutely none of the (other) fake functions and I implement it and move on from there. The only way I can think to describe it is like promises in js or future in c++: I have a bunch of stuff I promise to do, but instead of doing it, I pretend I did it and do all the easy stuff first. It’s speeds things up a bit. Like async lol.(no. Just. Just no.)

Edit: added clarifying words.

xie21 (28)

First write down what your plan is, then think about how your going to do it.
Personally, I just roll with it from there, but you can use a flowchart to plan everything if you like.

ArjunSS1 (108)

I ussually set up my system and decide what each part of the code is going to do. I write my classes and functions without adding any other code. After I finish that I put in what each function is going to do and test everything individually making sure that each part works. At the end I just connect everything together and do my final debugging and testing

theangryepicbanana (1651)

Generally I'll write stuff out first or make a working prototype in something like Rebol/Red (since it is very simple and almost looks like pseudo-code)

ChezCoder (1557)

I will be using an example, hosting thanksgiving party:

Now the task is much more manageable. Breaking it down always helps. Remember, if you need help with any big project, never be afraid to ask or search the internet!

@ChezCoder