DEV Community

Cover image for Care about your code, like an artist about their painting

Care about your code, like an artist about their painting

Keff on August 13, 2022

Hey there πŸ‘‹ I'm back with another little rant! The other day I was thinking about what makes good code good. Or better said, the variables that ma...
Collapse
 
bcosynot profile image
Vivek Ranjan

Great post! The "iteration" and "observation" point really stuck out to me mostly because I think code is means to an end - to serve our end users and the business. It's important to not get bogged down towards making it perfect from the get go, or to stick to your metaphor, in trying to create a masterpiece with every program or code fragment you write

Collapse
 
nombrekeff profile image
Keff

Thanks!

Yup, you should do it the best you can at a given moment, and continuously analyze and improve it. Masterpieces take time and effort

Collapse
 
jmfayard profile image
Jean-Michel πŸ•΅πŸ»β€β™‚οΈ Fayard

Days of coding can save you hours of planning...

I feel triggered because that a variant of this is in my bio :)

This sentence is funny because it's not true. Planning can save you hours of coding.

But that's precisely what the quote says!
Only that it says it ironically to poke fun of the "planning is overrated" people.

Collapse
 
nombrekeff profile image
Keff

Hahahahah I know it's a joke, just modified it a bit to better fit the post... Hope it did not trigger you too much xD

Collapse
 
jmfayard profile image
Jean-Michel πŸ•΅πŸ»β€β™‚οΈ Fayard

Regarding your (good !) point on consistency, in my case I would put it under "refactoring", because I'm just unable to start with something consistent and coherent first.

So

  1. I start with what Anne Lamott would call a shitty first draft
  2. Later I notice the inconsistencies
  3. Then I refactor it to sanity - JetBrains IDE do wonder here
  4. Then I write unit tests ensuring that my naming conventions stay coherent forever
Collapse
 
nombrekeff profile image
Keff

Not a bad point at all. I separated them because I feel we must think of consistency on it's own and refactoring encapsulated a lot more than just this. But I agree, first make it work, then make it good. But, if you can make it decent from early on, it will be easier to do so.

Collapse
 
thomashighbaugh profile image
Thomas Leon Highbaugh

Good post. My snarky one liner is as follows:

I do care about my code like an artist cares about their painting, but that doesn't mean anyone else cares about it.

Collapse
 
nombrekeff profile image
Keff

Good way of looking at it!

Collapse
 
gersondias profile image
Gerson Dias

But artists are paid after the thing is done, we're paid to solve problems with help of computers... How to find a balance?

Collapse
 
nombrekeff profile image
Keff

I'd say it's mostly the same, only the medium changes. I would even say that it's more important for us to take care of our code bases as we will be working on them for a long time.

Collapse
 
emrich profile image
Leonardo Emrich • Edited

Eu vejo o CΓ³digo como um livro que escrevo. Cada detalhe do mundo que escolhi influenciar ou resolver um problema deve ser simplificado claramente em cΓ³digo.