Play Home Contribute Github Join Us! Discourse Staff Members Github Contribution Guides Team

Let's talk about good and bad programming habits


I was talking with one of my friend yesterday, I had trouble with some problems both in codecombat and hackerrank.

My friend just said thatIi had a bad habit of not using pseudo-code for complex problems and it makes everything very hard to read.

separating the problem in many parts will definely help solving it.

So I was wondering what do you think is a bad programming habit and what are good habits?

1 Like

What exactly is pseudo-code? Just proper spacing in your code? Also how is hackerrank? Never heard of it before. My cousin keeps bugging me to try out an engine and I keep telling him after I’m finished this game =P

1 Like

pseudo-code is separating your problem in steps
writing what you want to do with normal text in comment
Code combat already write a lot of pseudo-code to help people with the problems. But we don’t really learn to do it ourselves

For example if I want my hero to get the coin that has the most value compared to distance I could separate my problem in many steps. It might look silly for easy problem but as stuff get more complex I believe it is important to do.

The thing is when you write down code, you don’t really want to go back and write all over what was already done

1st step: # Find all the coins
some code here.

2st step # get all the coin value and divide it by the distance to get a new value:
some code here

3st step # compare the the rating to get the best coin
some code here

4st step # get the coin

Hackerrank is a website that give problems and you have to solve them, each problems give you points and you get on a leaderboard. Even though I find most of the problems are quite hard.

And yeah I think doing stuff with an IDE is something important too. Codecombat is good at making you learn the language but at some points you will have to learn how to import modules and libraries and work with what was already done. Meaning you’ll have to read documentation.

1 Like

Ah gothca, thank you Gabriel =)


I think a bad programming habit is when you be lazy and you think about doing it tomorrow, then the next day thinking about doing it the next week, then the next week thinking about doing it next month, etc, etc.

A good habit would be to try to learn some coding, and when you fail, try to do it again, make some mistakes, but not purposely, and get frustrated that it’s not working, but trying and trying again.

Also this reply is making me a hypocrite.


I don’t follow pseudo-code. Does it even matters if the logic is correct?


In my opinion the logic is extremely important, especially when faced with a very very tricky problem.

1 Like

For Very Complex problem you will have no choice but to just write down what you want exactly because though you know how to code. Coding right away those problem won’t help you at all. It will actually work against you. The computer will not understand magically what you want to do. It’s you to understand the problem first.

When you learn it is easy to just not separate coding language and problem solving but at some point you will have to do that separation.

There is many problem I did I had to take a sheet of paper and write what I want to do.
If a problem must be resolved with like 50-60 different if-else you obviously want to do pseudo-code, to make sure you make blocs that you won’t have to recode later.

Also taking the time to do pseudo-code is an efficient way to separate softwares in modules. (I prefer to call them Blocks)

Making lot of small modules is an effective way to get compatibility for the future.
Lot of programmers can code and make something work. But a good programmer will not only code and make a sofware work, he will also make sure the software will be used for a long time. Compatiblity is important, because there will be improvement on everything over time. So it is better to make a Block that will be the base of a future Block, instead of recoding the whole pyramid.