DEV Community

Cover image for What Are Your Worst Coding Habits?
dev.to staff for The DEV Team

Posted on with Erin A Olinick

What Are Your Worst Coding Habits?

We all have coding habits that we know we need to break - from not documenting code properly, not using version control, or hardcoding values instead of using variables or constants. 👀

Confess: what are your worst coding habits? And how do you overcome them?


Join the conversation and follow the DEV Team for more thought-provoking discussions!

Image by macrovector on Freepik

Top comments (12)

Collapse
 
aratinau profile image
Aymeric Ratinaud

Image description

Collapse
 
mateomateohudson1112 profile image
mateomateohudson

Writing code without proper documentation makes it harder for other developers to understand and maintain your code.Hard-coding values in your code, instead of using constants or configuration Couple of the Day files, makes your code less flexible and harder to maintain.

Collapse
 
ervin_szilagyi profile image
Ervin Szilagyi

I'm doing to much refactoring making the code seem "beautiful".
Sometimes I try to prematurely optimize.

Collapse
 
mistval profile image
Randall

My git commits are horrible. I do git commit -am "stuff" so often I should make an alias for it. I justify this by telling myself it doesn't matter because I'm just going to squash them when I merge them anyway, and can give the squash commit a good message.

Collapse
 
syxaxis profile image
George Johnson

Sometimes spending too long coding a quick bespoke func only to realise the language often has it covered in the stdlib already, or even 1-2 built-in methods I can chain. I was just in too much of a rush to RTFM!

Collapse
 
thecheapaudiophile profile image
Griff Polk

this is how it ALWAYS is for me…

Collapse
 
hi_iam_chris profile image
Kristijan Pajtasev

Well might sound weird, but probably being silent. Sometimes i go into my own world and just code, and forget to update the team. But when you are working in the team, they need to know what is happening. Solution: Sticky note on the screen to remind myself to update everyone one the status and decisions :)

Collapse
 
envoy_ profile image
Vedant Chainani

I often try to make things more catchy, sometimes basic and clean is the best choice. Like for example I made this button to recreate a discord animation, it was fun but maybe not necessary 😅
Discord Animation

Collapse
 
stalwartcoder profile image
Abhishek Mishra • Edited
  1. Thinking to write the "perfect clean code" (resultd in pre-optimization and end up wating time, pre-optimization is evil)
  2. Unwanted git status on every change 🤷
Collapse
 
mergerg profile image
Raphael

I get so excited about niche ways to do things concisely, I end up looking at them later and having to spend many seconds to figure out what it's even doing 😅 and considering it's my own code, I'm willing to bet other people (especially beginners) would have an even harder time
I've gotten better about this lately, but it's still a lot of fun so it's hard to convince myself not to do it

Collapse
 
darkterminal profile image
Imam Ali Mustofa

I think it's not worst!... cz am coding while dancing! 😎