DEV Community

Ben Halpern
Ben Halpern

Posted on

What are your worst coding habits?

Is it bad commit messages, getting distracted by social media, commenting out tests?

Let’s hear it all.

Oldest comments (164)

Collapse
 
alanmbarr profile image
Alan Barr

Never taking the time to learn hotkeys. Not reaching out to a second set of eyes before spending too much time on something. Not doing enough design up front.

Collapse
 
ben profile image
Ben Halpern

Are you me?

Collapse
 
jonathanspeek profile image
Jonathan Speek

This is super relatable.

Collapse
 
glaaki profile image
Sean Porter

I use vim for basically everything & I can't remember how to do macros without looking it up. I think just generalize this to "not learning your tools effectively" & I totally agree.

Collapse
 
briankephart profile image
Brian Kephart

Not using feature branches.

Collapse
 
ben profile image
Ben Halpern

This was me until I worked with folks who set great examples. I eventually learned better habits.

Collapse
 
stearm profile image
Stefano Armenes

You should try git flow :)

Collapse
 
htphuongse profile image
Phuong Huynh

haha, you should try to fix it soon

Collapse
 
kayis profile image
K

Trunk based devlopment ftw.

Collapse
 
glaaki profile image
Sean Porter

Not sure I'd agree with this one, depends on what you're trying to accomplish.

Committing directly to trunk has its benefits, everyone gets the changes immediately but you just need to make sure that the changes are self-contained enough to not break anything.

I used to think this was the way to go too until I read Continuous Delivery
all the way through.

Collapse
 
alexantra profile image
Alex Antra

I rewrite other people’s code to my extremely high standard so I can understand it. Such a time waste.

Collapse
 
ben profile image
Ben Halpern

I’m sure this thread will contain much worse habits than that! 😂

Collapse
 
helenanders26 profile image
Helen Anderson

Haha! you are far more patient than I am!

Collapse
 
noreading profile image
Dominik

I know this far too well. There is this strong feeling of „You can’t leave it like it is, when you know it.“ but in the end ... it would most likely run for ages without any issues if we wouldn’t rewrite it. And maybe nobody would ever touch it again. :-)

Collapse
 
helenanders26 profile image
Helen Anderson

Being too lazy to turn off 'helpful' system settings, like the one that autocompletes a closing bracket. I used to end up adding a closing bracket myself and then having too many so had to hit backspace to get rid of one.

Now that that has become muscle memory, whenever I'm not using that tool I hit backspace on autopilot even though there is no 'helpful' closing bracket to get rid of.

Collapse
 
ben profile image
Ben Halpern

Ah yes, been there.

Collapse
 
moopet profile image
Ben Sinclair

I do this all the time!
It's all muscle memory now.

The other way the IDE gets in my way is when I want to add a closing bracket or parenthesis but my cursor is already immediately before one and the editor treats it as if they're the same - so I think I've added enough, but oh no.

Collapse
 
helenanders26 profile image
Helen Anderson

Ugh. Instant rage quit.

There are also some strange moments when the cursor just vanishes completely and I don't know where I am anymore.

Collapse
 
andrewbrown profile image
Andrew Brown 🇨🇦

When I need to use search, instead of searching in VIM, I launch sublime and search in there.

Collapse
 
rhymes profile image
rhymes

ripgrep needs to become your friend 😂

Collapse
 
foresthoffman profile image
Forest Hoffman

o.0 this is a thing?! That's awesome! Definitely going to grab that as soon as I can.

Thread Thread
 
rhymes profile image
rhymes

It's also the tool that Visual Studio Code uses to search :D

Collapse
 
dance2die profile image
Sung M. Kim • Edited

Confession:
TFS (Team foundation) lets you commit your code without a message. I sometimes commit without a message...

And I reformat others' code.

The worst offender is always Googling for simple tasks such adding simple HTML elements such as adding CSS link tags and script tags... (I wonder if it's just me not knowing how to add them out of memory 🤔)

Collapse
 
ben profile image
Ben Halpern

No commit message is such an odd thing to me.

I also always good css link tags 😂

Collapse
 
dance2die profile image
Sung M. Kim

git way of forcing a message should be how all VCS should be IMHO.

I also always good css link tags 😂
😂 👊

Collapse
 
t4rzsan profile image
Jakob Christensen

We moved all our code from TFVC to TFS Git which I can highly recommend. You get the best of both worlds (TFS backlog and project control together with Git version control). And you will never commit without a message again 😉

Collapse
 
dance2die profile image
Sung M. Kim

Wow 😮
Thanks, Jacob.
I wasn't aware it was possible to migrate to TFS Git and keep all the history.

I will check it out~

Collapse
 
ddhogan profile image
Donna Hogan
  • git push --force on a regular basis
  • using VSC to open dot files and not taking the time to learn vim or nano, etc
Collapse
 
ben profile image
Ben Halpern

I don’t think the second is a bad habit. There’s no special reason one needs to be using bin or nano imo.

Collapse
 
ericcurtin profile image
Eric Curtin

I think all Unix/Linux developers should know vim. Because vi or vim is almost always installed on these variants. Sure for local development a UI is great, a very useful tool! But for editing files on remote machines, the ability to ssh to a remote machine and make a quick change is very important.

Collapse
 
selbekk profile image
selbekk • Edited

My git alias for that command is git fush 😄

Collapse
 
colorcodedcode profile image
Robert Schaap

I need that in my life. I'm an obsessive compulsive interactive rebaser.

Collapse
 
yashints profile image
Yaser Adel Mehraban

Not reading enough docs, whether it's a framework or API

Collapse
 
reddyaravind178 profile image
aravind_reddy

Totally relatable

Collapse
 
highcenburg profile image
Vicente G. Reyes

Stare at my editor -> search for help in duckduckgo -> open social media -> change music on spotify😂

Collapse
 
bhupesh profile image
Bhupesh Varshney 👾

That's literally me every single day 😂😂

Collapse
 
crongm profile image
Carlos Garcia ★

Same. ❤

Collapse
 
boseriko profile image
Bos Eriko Reyes

Using Facebook's messenger when I'm coding. I can't let go of this one. I think it's because I isolate myself too much. I don't go out. Not at all. I don't use Facebook (I only use messenger, I don't have a Facebook). I use Twitter to see Feed related to coding as well. So I just can't let go of messenger. I need to talk to people. But I consider it a bad habit because I keep it open while coding. It will probably be healthier to just use Messenger when I'm not coding.

Collapse
 
titivermeesch profile image
PlayBossWar

I'm feeling this too. I talk to people but I think it's a huge waste of time. Like serious I'm coding 12h a day at a regular base but I'm feeling like I could do the 12h work in 6h if I close social media

Collapse
 
itmayziii profile image
Tommy May III • Edited

Never doing the bandaid solution and always engineering things to a fault. This doesn't sound like too bad of a thing but trust me it's okay to put on the bandaid sometimes. I would have saved many hours if I would have put the bandaid solution on some features that my project owners didn't even want a few weeks / months later.

Collapse
 
steelwolf180 profile image
Max Ong Zong Bao • Edited

Hmmm.. using git add wrongly that commit all my ignore files for the project I'm working on.

Collapse
 
nickytonline profile image
Nick Taylor

My git alias, pf,is just for that, alias.pf push --force-with-lease. More here 😉

Collapse
 
selbekk profile image
selbekk

I write git status at least 4000 times a day, for no reason whatsoever.

Collapse
 
bhupesh profile image
Bhupesh Varshney 👾

Been there
😂😭

Collapse
 
learnbyexample profile image
Sundeep

how about ls and clear

Collapse
 
titivermeesch profile image
PlayBossWar

Doing this all day long when I'm working for no reason, I don't know why actually

Collapse
 
huyduy profile image
Huy Duy

You can use Ctrl + L instead.

Collapse
 
jcoelho profile image
José Coelho

Yep that's me. I even write git status after committing just to make sure 😅

Collapse
 
learnbyexample profile image
Sundeep

That has actually helped me once, I'd forgotten to git add some files

Collapse
 
glyphcat profile image
GlyphCat

And also git branch after git checkout just to make sure I'm on the right branch… 😂

Thread Thread
 
kaddkaka profile image
kaddkaka

My prompt reflects which branch I'm on, super helpful!

Collapse
 
highcenburg profile image
Vicente G. Reyes

This sounds like a good practice😂

Collapse
 
khoahuynhdev profile image
Khoa Huỳnh

Underrated

Collapse
 
glaaki profile image
Sean Porter

at least alias it to gst!

also: me too

Collapse
 
cjbrooks12 profile image
Casey Brooks

With as much as I check git status, I don't have time for a 3-letter alias! gs is all I can afford 😜

Thread Thread
 
a0s profile image
Anton Osenenko

And gpr for git pull --rebase

Collapse
 
pmsuntuwarg profile image
Mahesh Sunuwar

Most of the time, git log follows git status in my case. :P

Collapse
 
kaddkaka profile image
kaddkaka

tig gives me more information, more concisely. Try it out :)

Collapse
 
kiro112 profile image
Jairo Malanay

Is it bad ?
Im also guilty of this one + ls and clear

Collapse
 
haqqer profile image
ahmad_haqqer

me too dude

Collapse
 
chiangs profile image
Stephen Chiang

I get debug/Refactor/develop creep. Often I'm working on one thing and I notice something that can be fixed rewritten or moved somewhere so that it can be reused... Or I suddenly decide to stub out something for later later. Sure, it's stuff that had to be done at some point, but hard to explain or justify when you list hours to tasks for a single component and for some reason a component was finished, plus 2 stubbed, plus one refactored, and a new service was created. 🤪