Have you ever had a really complex programming issue? An issue where you can probably write out the logic, but you aren't quite sure of the syntax ...
For further actions, you may consider blocking this person and/or reporting abuse
I usually write pseudo code first, then I code around it. The pseudo code becomes basic comments for my actual code.
I also make a simplified version with checkboxes that I put on our task manager for my superiors to see. They can then understand where I'm going with this task.
Great article !
Can share some example?
I love reading your posts. I'm newer to programming and I appreciate how you cover a lot of things that aren't brought up in tutorials. I think pseudo-code is something I need to get in the habit of doing more. Especially if I step away from a project for awhile and come back to it.
As mentioned in another comment, I write my pseudo code as comments in my script / program and fill it in Afterwards.
So you know what you thought at this moment even a few years later.
And another people will understand what you did too :)
Thanks! I'm glad my posts are actually useful! 😊
I've been coding for about a year and a half, and today I bumped into a really complex task at work, which involved (as usual) reading another coworker's code. Luckily, I had read this post on my lunch time, and it really helped me to better understand the existing codebase (since I was able to grasp the logic behind the problem by using pseudo code). Thank you for sharing!
I'm just new to coding and I love this approach. Thank you for this post!
Thank you! I'm glad it's helpful.
I also think the academic pseudo-code is interesting
Pseudo-code is a great tool for working with large code bases that you didnt write in the first place, especially if they are complex. Or your own, 6 months later after you've moved on! As a senior I'll often tell younger devs to pseudo-code a task and bring it back to me before writing code; if their pseudo-code is correct I know they understand the problem and have much higher confidence they will write correct code.
Yeah, but why not let them write real code and do a code review soon. It might cause a bit more work for you but it is safer and the junior will probably learn more. Coding is not like building a house. Code can easily be modified. Version management tools exist. Refactoring exists.
Different level of abstraction which allows for ultra efficient communication and review of logic.
I completely disagree.
Pseudocode might have made sense in the age of assembler, FORTRAN and C programming but nowadays the two main reasons for using it are probably:
Not mastering your programming language.
Not knowing about refactoring - nobody gets a non trivial task right at the first try. Code is not something you write once and never change it afterwards. But that's not a bad thing: Changing code is cheap if the code is clean.
Maybe there are some rare occasions where pseudocode does make sense but in most cases there are better tools to use when you are not yet ready to code: Draw diagrams write specification documents, talk to people, build a prototype, write unit tests (TDD).
What sucks most about pseudocode is that it will not provide any feedback.
Why does this matter to me after all? Because I think that it is much more helpful in the long run to put your energy into the real code.
Hi, nice article but I'm a beginner and I know I should nail this habit in now. I'm doing a bootcamp and the exercises are getting a bit more challenging, when I try to write pseudo code, I get trapped by 2 things. 1) I come from a more academic background, lots of essay writing, and so my pseudo code never comes out in simple digestible chunks and 2) sometimes I am not even sure how I will need to do what I need to do and so I end up just jumping right in and playing around, I never go back to writing pseudo code and if I made any attempts if offers me no guidance, because I'm like learning on the go about what works and doesn't. Any advice on how to improve on this?
Why did you bother posting academic pseudo code? It ruins the opportunity to share the article to someone who is learning
It's just there as another example of what pseudo-code can look like and just how complex it can be if you need it. 🙂
I see both sides here.
I appreciate seeing the more complex side, but complex pseudo-code isn’t the focus of the article, and presenting it as the first example makes the reader think the complex stuff is what pseudo-code -really- is— and that the simpler example is just “dumbed down”.
Maybe it would help if the examples were used in a different way? Like, “pseudo-code can be simple [example] or complex [example], but it’s overall goal is to...”
Thanks for the article! It answered a few questions I had 😊
I can barely remember the last time I had to write pseudo-code. Usually I did, when I had to write something really difficult to just imagine in my mind. Nowadays, the stuff I code are pretty simple
Yes, Pseudo-codes are exactly necessary initially as it would allow the team(s) to brainstorm broadly as opposed to jumping straight into code.....
Love it. Clearly is the best way to approach an algorithmic problem
What makes you think so? Does real code really suck that much? If yes, shouldn't we better find out why that is so and try to do something against it?
I am a student learning pseudocode in my computer class, this article really helped!! :)