In my opinion, good code is like a Brita filter. It does its job, will one day need to be replaced, and it should be easy to replace. More importantly: metaphors are not a healthy way to understand an idea. Ideas are more nuanced than a metaphor could possibly account for. Abstaining from metaphors might not make for a catchy headline though.
Good code is like a love letter to the next developer who will maintain it
61–70 of 274 posts
Re: Good code is like a love letter to the next developer who will maintain it
#62Sorry next developer, I'm on a tight deadline, used to love this craft, now I just do what the product people tell me to get a nice paycheck.
You can have beautiful code and garbage product, and great code and a garbage product.
If your PM is pushing bad products, that's on them. Your job is to deliver good product, not good code.
Re: Good code is like a love letter to the next developer who will maintain it
#63Truth. Years ago a wise man told me "The compiler is not your customer. The next person who maintains this code is your customer. It might be you."
Re: Good code is like a love letter to the next developer who will maintain it
#64And remember, the next maintainer could very well be you.
When I do personal projects for myself, I try to comment them really well for this exact reason. Just today in fact I was trying to update some code I wrote two years ago because one of the underlying tools broke. I was very happy with past me for commenting the workflow of that tool so I could easily work around it.
Re: Good code is like a love letter to the next developer who will maintain it
#65Good code is not like art, such as good books or paintings. No matter the quality of your code, if the product or service is not a good market fit. It will be retired. No one will stumble upon it or pick it up after it's gone. Knowing this, the only reason for putting effort into it is to make it easier for myself.
This applies to artistic endevours like books and paintings as well (especially those two, since markets for them are very oversaturated). Your technique might be masterful, but if your art doesn't align with current trends (along with a number of other factors), it'll drown in the endless barrage of other art, and nobody will stumble upon it or pick it up, even if it's still available.
Re: Good code is like a love letter to the next developer who will maintain it
#66As someone who has gone back and read my old code as well as a lot of others old code, there is no such thing as good code. IMHO, the problem is one of cultural context which is often not shared between generations of coders. Languages and best practices can change so violently that best-practices one decade are often anti-patterns in the next. As a codebase outlives its best-practices, do you stick with them and ext…
Something could be written using Java 1.4 idioms with good organization and factoring, or using the latest functional hoohas with everything all mashed together. Or the inverse, of course.
If the structure of the code matches the structure of the problem, the implementation style is a much smaller deal.
Re: Good code is like a love letter to the next developer who will maintain it
#67In my opinion, good code is like a Brita filter. It does its job, will one day need to be replaced, and it should be easy to replace. More importantly: metaphors are not a healthy way to understand an idea. Ideas are more nuanced than a metaphor could possibly account for. Abstaining from metaphors might not make for a catchy headline though.
Metaphors are also ways of communicating ideas. A good metaphor is as simple or as complicated as it needs to be in illustrating a new concept
Re: Good code is like a love letter to the next developer who will maintain it
#68As someone who has gone back and read my old code as well as a lot of others old code, there is no such thing as good code. IMHO, the problem is one of cultural context which is often not shared between generations of coders. Languages and best practices can change so violently that best-practices one decade are often anti-patterns in the next. As a codebase outlives its best-practices, do you stick with them and ext…
* Modern, where the language's features and idioms reflect the best way we know to write good, clean code today.
* Compatible, where code written in the language years ago continues to run the same as when first written.
* Simple, where the language has relatively few concepts that compose in clean ways and where there are few ways to accomplish the same goal.
But you only get to pick two.
Re: Good code is like a love letter to the next developer who will maintain it
#69Re: Good code is like a love letter to the next developer who will maintain it
#70As someone who has gone back and read my old code as well as a lot of others old code, there is no such thing as good code. IMHO, the problem is one of cultural context which is often not shared between generations of coders. Languages and best practices can change so violently that best-practices one decade are often anti-patterns in the next. As a codebase outlives its best-practices, do you stick with them and ext…
definitely not true. this is good code:
https://github.com/torvalds/linux/blob/master/fs/file.c
this is good code:
https://github.com/golang/go/blob/master/src/strconv/atoc.go
its formatted, commented, direct. the fact that you struggle with writing time tested code does not mean that everyone does.