Perfection is a modern heresy
abe-winter.github.io
abe-winter.github.io
> "...deliver something, anything...", no need to make it good, "teams make things better," anyway.
No, no, and no. If you want to scale a team you have to deliver quality code.
The cowboy coder spews out code, screams "see it works!", and then moves on to produce more diarrhea for "the team" behind him to clean up, "make better"...
When one realizes they do not yet have a skill (such as producing quality code), it is tempting to scream "quality/perfection is a heresy" because this is much, much easier to say than the labor it takes to develop the skill.
> It’s hard to see more than a week out because anything that takes more than a week to build involves R&D.
Wrong, wrong, and wrong. MOST of what we do as practitioners (for those that have been doing it for at least some time) is NOT novel. Estimation is a skill. Estimates can be extremely accurate for those of us that have developed that skill.
It is much easier to say "estimation is worthless" when it is a skill that you have not yet developed. Because it is only developed through (often frustrating) practice.
Record the time it takes to do your work. Notice the patterns of problems that you face and how often they repeat themselves.
---
Perfection per se has its hazards but in no way should that truth get us off the hook from developing ourselves and doing our work well.
This post is nothing but dangerous to the nascent programmer-practitioner as it attempts to lull them away from what is possible and the work it takes to get there.
Perfection is not attainable, but if we chase perfection we can catch excellence. -- Vince Lombardi
Unfortunately, some people who dispense advice pick one of those "directions" and argue strongly for it, rather than trying to describe how to recognise when you've got the balance right.
If your code is to be thrown away in one week, why make it perfect? If you have to maintain it for years, why make it a pile of shit? Funnily enough you can't often predict the lifetime of code.
http://slatestarcodex.com/2013/06/09/all-debates-are-bravery...
How is such a condition even possible? This seems to be equivalent to describing, say, a libc, as "way more bug-free than can possibly be healthy".
EDIT: there is no way that someone could be combing through days-old posts just to downvote something within an hour of being posted. >:|
This resonates with me, and I hope I'm better than that. I don't know if I am. Some metrics might suggest so, but who knows.
Over the last couple of years, I've been working with a repeating pattern. Teammates have a problem, but the problem can be split into 20% - 40% hard / algorithmic / architectural issues, and something between 60% and 120% other detail-work once the hard parts and a couple of easy parts as examples are done.
So, I've grown to tackle and solve the hard parts, and give people a small chunk of software so they can solve their problem on their own, as long as I help them a little along the way. This is powerful if you have a strong understanding of the problem to solve, and a couple of open-minded team-mates. And it helps everyone to grow on a technical level, making further problems easy.
However, this requires care, communication, a strong understanding of the issue, support for the solution... By now, people ask me for to handle the hard parts, and I can just dump them a repository with a README and a rough solution. But that was a long way, and giving less support, less care to do the right thing, and doing less to build trust with the team will lead to a catastrophe. And interestingly enough - oversupporting would also lead to problems.
Sometimes the cowboy will linger around to try keep the unshippable code as-is. :( I do not understand why.
If you think you're documenting way too much then it's about right. The people picking up your source years after you've left the company will need that much documentation. Documentation also breeds more documentation. When someone goes in and changes something they're far more likely to document it if their change makes existing documentation/comments incorrect.
I see both code and comments as a three-way conversation between myself, the person reading the code (who may be future-me or someone else), and the compiler.
People who learn a second human language often fall back on a crutch known as "code switching". With code switching, when you don't know how to express something in the language you are learning, you switch back to your native language. This can often help people develop more fluency because they don't sit around concentrating on trying to find the correct term. They can say the parts that are difficult in their native language and then move on to the rest of the conversation.
However, code switching ultimately slows down your progress as a language learner. If you don't know how to express what you want with the correct grammar or vocabulary, it's usually better to try to find a different way to say it. By doing this you exercise your ability to be flexible in your speech. The code switcher tends to hit a ceiling very quickly and never becomes able to express themselves in the new language -- because they never have to. Finding alternate ways to express yourself is often frustrating, slow and embarrassing, but will help you in the long run.
Comments are like code switching. It's really helpful when you've written some code and you think, "I'm not sure that people will be able to understand what this means". It helps you get unstuck from your current position and to move on to the next thing, safe in the knowledge that you have expressed what you need to express.
However, you can also look at the situation differently. If you write comments, then you do not have to express yourself clearly in the programming language. It's easy to fall into the trap of thinking that it is unimportant to express yourself clearly because 1) you have comments (which are easy to write) 2) expressing yourself in code is hard 3) it will take a lot of time to learn how to do it well 4) you might fail and end up with difficult to read code.
These are all seemingly excellent reasons for writing comments, but they will also hold you back from being a better programmer IMHO. I prefer to avoid comments, using them as a technique of last resort. However, if someone says, "I don't understand your code" you have to take it pretty seriously and find a way to express yourself more clearly.
As a side note, this is one of those areas where reasonable people can differ. Of the issues that can cause conflict on a team, I find this to be one of the biggest. No matter what your personal opinion is, it's important to work as a team and do your best to please your teammates. Code is not for the writer -- it's for the reader.
There is often back-story that needs to be explained. Something as obvious as input sensitization may have a more specific meaning behind the specific implementation, for example a legacy Orcale DB client that chokes on certain special characters. A comment in a case like that can prevent you from getting woken up at 1am because a well meaning attempt to apply the same naming rules to schemas as you do to everything broke things.
If someone says they "don't understand your code" then either they suck at understanding code, you suck at writing it or both.
Comments are a tool to increase the speed and accuracy with which someone else can understand your code.
The code you're using to escape those specific characters should ideally be written in such a way that its intent is obvious even to a novice reading it. For the novice, then, the question shifts from "WTF does this do?" to "why is this here?", which would be a great example what to actually write comments for: context.
Imagine you're writing some very math-heavy library. Ideally, I shouldn't be a language expert to be able to see what your code does. This still doesn't help me if I don't understand the underlying math, however. Even hints like "this operation is called XY and can be used to Z" may be very helpful if someone wants to get a hold of what it does. With that, you can look up literature for this specific part.
I dont have a mentor, so this has helped tremendously.
But I agree entirely. I go back to things I did even a year ago and desperately wish I had documented more.
Now I'm left wondering if that makes a point for or against the OP's arguments. ;-)
OTOH for side-projects, especially for people who have trouble finishing things without external motivation, it can be more useful to just get something done. Without the get-it-done mentality it's possible to obsess over the architecture, libraries, tech stack, deployment, test automation ad infinitum until you've lost enthusiasm for the project. It's great that you learned a lot of new tech but also slightly sad that the world will never see the idea you were so excited about 3 weeks ago.
This is the strategy that I prefer. I aim to deliver version 1 of my side projects within 3-4 weeks. After working on it for too long without delivering, I lose interest. I fix the time and budget of the version, not the scope. Unfinished features are cut out of the version 1. I focus on the core features. There will always be time to add extra features in the future.
Most people are afraid of launching because they don't want to be judged. That's why they delay the launch. I prefer giving my software to a handful of real users as soon as possible. So that they can test and give me feedback. There will always be bugs in software. Show me a popular software product and I will give you a list of over 10,000 bugs which were reported in its lifetime. What matters is the speed in which you fix them. If you created version 1 of the product, you wouldn't waste more than a day fixing all bugs reported on first day.
'Great artists ship' - Steve Jobs.
Sometimes it makes sense to rapidly spew out brittle code. Other times it makes sense to delay until you get it right.
What's important is being in control of the situation. Know what you're doing and why. Know the tradeoffs and commit to them.
You can never be confident making changes to a program like this, because you don't have a coherent understanding of how each change will affect the system as a whole: all you know is how it will change the behavior when the system is run in a particular way. You don't have to be a perfectionist to understand this!
Funnily enough, "quick & dirty" code also often seems to ignore obvious easy solutions to any given problem and instead pursuits more cryptic/unmaintainable ones.
That's the thing that bothers me the most when I'm encountering that sort of thing: It isn't just "a bit ugly" - more often than not it's hacked together using methods that merely almost work when there's a perfectly viable option that has been there since the 70s. And - on top of that - it usually even locks you in on those horrible decisions.
Example: You have to configure a piece of software. The configuration is highly critical and must be maintainable and synchronizable between systems.
There are tools that put their entire configuration in a database and sell it as a feature. To sum up:
- You can't properly version said database
- You can't diff said database
- You can't grep said database
- Reading the config takes ages if you can't use a different shoddy tool
- Writing it manually is nigh on impossible
- Errors get very obscure since you have to provide tables and IDs as references
...then why the hell aren't we just using text files for that? You could even insert the text verbatim into a table record and be better off.
The tug of war is more often between putting unfinished things into production and some random deadline set by a person who knows nothing about the required amount of work to have a correct result. (Much less decent or maintainable.) Not negotiable or adjustable too.
Even the sc(r)um approach of cutting features has limitations. At some point the customer will just be unhappy.
Excessive focus on unimportant details is a real problem. Everybody probably naturally focuses either too much on details or too little, and this person recently ran into some teams that focused on them too much, preferring to polish features the customer didn't care about rather than finishing the product.
The tool didn't work any better if the accuracy was better than specified, so trying to make it better was considered a waste of time.
It helped that the required accuracy was usually part of the specification, while software quality is mostly a subjective thing.
Of course, this is all highly dependent of the nature of your work and length of development cycles. But if you're shipping in weeks, I'd wager you should be planning for hours at a time, not days.
Getting it out there sooner can be appealing if time is a factor. Spending extra time perfecting it is appealing if time is not a factor. It's just two poles between which you set a cutoff point, and in team efforts everyone will not only have different ideas about whether time or quality is more important, but they will have different perceptions about what it even means to be closer to one pole.
You're always compromising something in engineering, no matter which pole exerts a stronger pull on you. Putting a flawed product out early might kill the product; you should've put the development time cutoff point closer to the 'perfection' pole.
On the other hand, spending extra weeks or months or years polishing something that ends up not being not quite what anyone wanted is also bad, because if you had just gotten something out there sooner, you could've spent the same amount of time iterating on it in response to feedback. Lots of extra time spent on something often also translates into getting locked into technical choices that can be more difficult to back out of later if necessary. So there's definitely something to be said for putting a simpler and less-polished product out sooner to get feedback and test your initial assumptions vs. reality.
I think these conversations never cease in part because so many people who argue about this stuff are treating it as a binary choice. They're not picking a cutoff point between two poles, they're picking a pole and going all in on it. In reality, they see different sets of pros and cons and weight them differently and see risk differently. The solution is better communication between people so that there is at least a shared set of known pros and cons. People might still not agree, but they can at least have the same conversation when weighing compromises.
People who get into binary thinking patterns about situations which no one person fully grasps are being rational in their own way; they just don't understand that they are compromising something else. In my experience, people rarely see things in black and white once they understand how the opposing side views the situation. Both sides are rational, they just have disjoints areas of knowledge and thus priorities.
This.
Perfection has its uses.
[1] https://sourceware.org/bugzilla/buglist.cgi?bug_status=__ope...
I've observed with user interface design that there is often a stark threshold between "usable " and "unusable", and that it takes a perfectionist mindset to reach it.
I mean, look at Duke Nukem Forever. The game spent 15 years in development because the creators were never happy with it, constantly felt it needed to be better than the competition and always fretted about what engine might be the 'best possible choice' for the title.
That wasted millions of dollars, years of people's lives and all manner of resources for a game that would have been better released after three or four years with a couple of sequels down the line.
And lots of non game examples exist there too. I'm sure you can name amazing systems that took so in development due to 'doing everything properly no matter the cost' that their nimbler competitors ate them for lunch.
At the same time, you can also likely remember many examples where products got released without enough care and attention put into the coding site (or quality control in general) and it just slaughtered their reputation and long term popularity.
It's a fine line you have to wander, and one that can sink a product or service if you go too far off track.
Modern heresy is applying anecdotal solutions to situations as learnings for all problems.
Then later they could define & hit their tolerances for orbital mechanics, fuel budgets, system redundancy.
Same deal with faraday / maxwell / einstein. The experimenter (faraday) measured & applied new phenomena, then maxwell came up with general laws, then einstein figured out their implications.
I guess this isn't meant to be a serious work of scholarship anyway, with footnotes like, "For the life of me I can’t remember where I read this."
By my reading the old definition of 'perfect' is "fulfills the important criteria of being done".
For a boat that meant "didn't sink" (so done is like completed, while perfect is 'completed and useful').
A witty saying proves nothing -- Voltaire.