468

This has been troubling me for some time, and I'd really appreciate the input of other professionals.

Short background: I started programming when my parents bought me my first computer in 1988 (at age 14, I'm 39 now). I followed a couple of other career paths before finally becoming a professional programmer in 1997. Late bloomer, perhaps, but that's how it was. I'm still happy with my choice, I love programming, and I consider myself good at what I do.

Lately, I've been noticing that the more experience I gain, the longer it takes me to complete projects, or certain tasks in a project. I'm not going senile yet. It's just that I've seen so many different ways in which things can go wrong. And the potential pitfalls and gotchas that I know about and remember are just getting more and more.

Trivial example: it used to be just "okay, write a file here". Now I'm worrying about permissions, locking, concurrency, atomic operations, indirection/frameworks, different file systems, number of files in a directory, predictable temp file names, the quality of randomness in my PRNG, power shortages in the middle of any operation, an understandable API for what I'm doing, proper documentation, etc etc etc.

In short, the problems have long since moved from "how do I do this" to "what's the best/safest way of doing it".

The upshot is that it takes me longer to finish a project than a novice. My version may be rock solid, and as impenetrable as I know how to make it, but it takes longer.

The "create file" example above was just that, an example. Real tasks are obviously more complex, but less suited for a generic question like this one. I hope you understand where I'm going with this. I have no problem coming up with efficient algorithms, I love math, I enjoy complex subjects, I have no difficulties with concentration. I think I do have a problem with experience, and consequently with a fear of errors (intrinsic or extrinsic).

I spend almost two hours a day reading up on new developments, new techniques, languages, platforms, security vulnerabilities, and so on. The conundrum is that the more knowledge I gain, the slower I am in completing projects.

How do you deal with this?

Telastyn
  • 108,850
  • 29
  • 239
  • 365
Zilk
  • 351
  • 4
  • 5
  • 7
  • 132
    The key lesson is: _stick to requirements, not more_. That way you won't try to implement features that are not needed. – mouviciel Oct 08 '13 at 06:55
  • 21
    You consider Agile Methodology of development instead of waterfall model. Deliver big things first and iteratively deliver the rest. This is new concept but helps reduce risk and cost. – Satish Oct 08 '13 at 07:44
  • 25
    Summarizing viewpoints and adding mine (in case you miss): You should consider projects that are more mission-critical (business-wise, not safety-wise), or have higher requirements for quality (low-defect) over the richness of features. In other words, look for projects where your best skills are most highly valued. – rwong Oct 08 '13 at 10:58
  • 3
    A second suggestion is mental - [according to NLP folks](http://en.wikipedia.org/wiki/Neuro-linguistic_programming) the word "worry" might actually cause you to feel worry about edge cases, with negative impact on emotion. Try to find a positive word / description for your *thoughtfulness* in your handling of edge cases. – rwong Oct 08 '13 at 11:01
  • 14
    When you read any of the books about code quality the one resounding theme is while it may cost more to create good code in the first place it will cost less in the long run once you factor in maintenance. – James Snell Oct 08 '13 at 11:43
  • 3
    Try to work on problems that other people simply can not solve. Work for a company that needs these problems solved, and solved correctly the first time. The value of fixing the problem needs to outweigh the value of how long it takes. If you are taking to long to fix problems someone else could do at half the cost, and there are a lot of people who can fix it, then you've pick the wrong field to specialize in. – Reactgular Oct 08 '13 at 19:15
  • 1
    As MANY posters have said, it is OK for them to generate cr@p and no big deal. That may be fine and expected for their industries. For others, having that plane fall from the sky because it was too much effort to add a little error handling is not really an option. It depends on the industry. For most everyone else, it's somewhere in between the extremes. Even then, good developers will consider the problems and handle the ones they are likely to see. They don't leave their garbage for someone else to debug or make it to the customer to find. Some people have no shame. Are you one of them? – Dunk Oct 08 '13 at 19:20
  • 1
    _"It's just that I've seen so many different ways in which things can go wrong"_. What happened when things went wrong? Who was blamed for it, who was paying to solve them? What did it do to you? Did you feel you had failed whenever a bug was discovered? In my opinion, many of the habits of programmers depend on their characters. You can very easily find a standard, best practice or whatever that fits your feelings about what's right. Maybe this way of looking at it might help you. – R. Schreurs Oct 08 '13 at 19:40
  • @Dunk - You are correct in that every industry has its own constraints. Usually this is reflected in their requirements. Error handling is such big part of aerospace systems that it has its own function, named [FDIR](http://www.esa.int/TEC/Software_engineering_and_standardisation/TEC4WBUXBQE_0.html) (Fault Detection, Isolation and Recovery). – mouviciel Oct 09 '13 at 07:01
  • 6
    "Do the simplest thing that could possibly work." Once you've done that, then you decide if you need to worry about anything else. – Wayne Werner Oct 09 '13 at 13:49
  • 3
    wtf? How is this "career advice"? This is something that many programmers will run into over time, and will apply to professionals and non-professionals alike. You could _maybe_ argue that it could apply to many non-programmers as well, but I think we would be far better off letting _good_ questions help users of the site even if they're slightly offtopic or slightly subjective. – Telastyn Oct 09 '13 at 14:00
  • All of the replies and comments have been tremendously helpful, thank you! Just to clarify a point that was asked: much of the code I'm currently writing is responsible for creating invoices totaling around 2M € per year, so an error in that part obviously can have severe consequences. A few years ago, something went wrong with the financial code, and my client lost a couple thousand €. They fixed it themselves, and didn't even tell me until years later. But I've been noticing the same hesitation/fear/slowness with other code, even in relatively unimportant private projects. – Zilk Oct 09 '13 at 20:52
  • Despite not being as experienced as you are, I am facing a very familiar situation. Are you sure the stuff you have to do is very well defined? Are you certain you understand why they need it? I used to work in agile environments, now I am at a bigger company that waterfalls, and to say I dislike it would be an underestatement. Situations like these when you feel you have many 'moving/adjustable' parts of your task means you do not understand well enough WHY do they need this task done. It is not your fault though. – George Oct 10 '13 at 08:57
  • @George: Too much to say for a comment, so here's my short version. There's a happy medium. If you were experienced 'AND SKILLED' in waterfall-like development before you went to an agile one, then you would probably hate the agile environment. Different mindsets and drastically different skillsets are required. I did the reverse from you and hated the agile world. It sucks that nobody has the big picture view beyond some vague cloud in their head; interfaces change out from under you all too frequently. I just felt like I was back in high school with everyone hacking away. – Dunk Oct 10 '13 at 14:34
  • I think the only answer is to find customers willing to pay for the quality you want to deliver. I haven't found them yet. Since I'd rather die than waste my life producing crap, I'm currently offering all that quality for free. Unlike you though, I'm still incredibly fast because I picked the right approach to software development and fully capitalize on all past work. – Morg. Oct 11 '13 at 07:05
  • @Morg:If you want to find customers who are willing to pay for high quality software then you need to get customers who are building products where failures can have high costs. Good developers that can build highly reliable software and have the mindset to be able to do it are extremely rare. – Dunk Oct 15 '13 at 18:16
  • This is one the best questions over the years. Good job! – Saeed Neamati Oct 18 '13 at 16:29
  • 1
    Is anyone complaining about you taking too much time? Or are you just trying to optimize your performance? If no one is complaining, then sort of by definition, you're doing it right. – sea-rob Mar 28 '14 at 22:12
  • I have some code and concepts, that I always carry with me, that are geared toward solving reoccurring problems so that I'm not worrying about the problems I've already solved. That's not to say that my understanding of all of the complexity of all of those problems doesn't stop me from starting some projects ;) – Resist Design Mar 29 '14 at 18:07
  • I have exactly the same problem. And I try to solve it by just coding without thinking, if I can solve problem without thinking about concepts etc... then I know this, else this thing is not in my brain and I can't say that I know it. – Dmytro Apr 07 '14 at 11:16
  • before thinking about a problem, just ask yourself. Is it required here? If the answer is no, just ignore it. If the answer is yes, consider implementing it (or talk to clients about it). This way you won't over-think and would develop a rock-solid piece of software. – Mohit Kanwar Aug 13 '15 at 12:27
  • I've been in several car accidents, but I still drive as fast as I need to. If you have trauma over past mistakes, see a therapist. –  May 01 '17 at 16:02

21 Answers21

278

You're not any slower in completing projects. Previously, you thought your novice projects were done when they really were not. You should sell this quality to clients.

"This company might get it done faster and cheaper, but is it really done? Or will you be hunting bugs for years?"

Beyond that, you need to know and accept the old idiom: "Perfect is the enemy of good."

Telastyn
  • 108,850
  • 29
  • 239
  • 365
  • 120
    reminds me of 'good, fast, cheap, pick two' - when you knew less you were sacrificing on the 'good', and now that you know more, you're sacrificing on the 'fast'. – sevenseacat Oct 08 '13 at 04:55
  • This is the answer. Projects were done faster because they were not made with quality in mind(by the skills at the time). I know. I've been there too and I am now. – lukas.pukenis Oct 08 '13 at 07:46
  • @weston Don't look for implications in that statement. Take it that if you go for good and cheap then you *don't* get fast :) – Reinstate Monica Cellio Oct 08 '13 at 08:18
  • @sevenseacat, I had always heard it was "Bug-free, fast, cheap. Pick two." – Neil Oct 08 '13 at 08:22
  • 10
    @Neil nothing can be bug free. There will always be a issue, they just get smaller, or more complex. Ideally the OP should find a mark where he is completing fast *enough* and leaving few *enough* bugs to be happy with his quality, and keep the client happy with cost and time –  Oct 08 '13 at 09:23
  • 11
    @Neil "On time. On budget. On Mars. Pick two." – Dan Is Fiddling By Firelight Oct 08 '13 at 13:21
  • @RhysW I'm not disagreeing with you. I simply had heard it was "Bug-free, fast, cheap. Pick two." If you don't like that expression, take it up with the person who said it. – Neil Oct 08 '13 at 13:28
  • @Neil apologies, I did not intend it as a dig at you, i merely used it as an opportunity to express my views on what the OP should do that just happened to fit in with your comment –  Oct 08 '13 at 14:01
  • @RhysW No offense taken, no harm done. :) – Neil Oct 08 '13 at 14:08
  • actually the saying goes "good is the enemy of perfect" (you see, when people see "good" they stop trying to make "perfect") – Leonardo Oct 09 '13 at 04:06
  • 6
    @Leonardo : no, Telastyn's form is correct (and it's a [quite old saying](http://books.google.com/ngrams/graph?content=is+the+enemy+of+good%2Cis+the+enemy+of+perfect&year_start=1700&year_end=2008&corpus=15&smoothing=5&share=). See also *YAGNI* and "if it works, don't fix it". – mikołak Oct 09 '13 at 07:34
  • @TheTerribleSwiftTomato hummm thats quite true... here in Brazil the saying goes the other way around... very peculiar... tks for the heads up! – Leonardo Oct 09 '13 at 13:23
  • 3
    This answer is bullshit. Go on, go try and tell a potential client that you will do it for 40K instead of 20K but with 10x more quality and reliability. They will tell you this: "My budget is 20K and I don't need that quality". At some point you have to accept that 99% of clients don't really care about quality, and any quality there is will be your personal investment. – Morg. Oct 11 '13 at 06:59
  • @RhysW A program can be mathematically 100% correct, it's not that hard. What's hard is working around all the bugs in the software that you didn't write but have to work with. – Morg. Oct 11 '13 at 07:02
  • 1
    @Morg. The hard part may well be working out what “correct” really is. Sometimes — too often — what's supposed to be right is just so badly understood in the first place, and that's even before the problem of how to express that mathematically… – Donal Fellows Mar 28 '14 at 21:47
  • @DonalFellows Actually, from a programmer's standpoint, correct is what has been requested. As a PM and generally one-man dev team, I agree there are more interesting problems of accuracy, but let's not pretend that most of the software out there does what its creators wanted it to do. – Morg. May 20 '14 at 12:37
191

Sounds like it's time for you to join the dark side: management.

I'm not suggesting you give up programming and become a manager. But it seems like all the experience you've quoted up until now has been technical in nature. In simple operation of writing out a file, you can think of 10 different aspects that a less mature developer would never consider. Not necessarily a bad thing, but...

The dark side is all about present value. It's about making minimal investment for maximum gain (cost-benefit analysis). In business everything boils down to how much will this cost me, probability of success, probability of failure, probability of spectacular failure and potential gain. Do the math; act accordingly.

This works just as well when you are a developer: create a temporary file, ignoring permissions and name collisions - 5 min. Net gain, the rest of the team can start working on whatever code depends on the presence of that file. Is it a perfect solution? Absolutely not. Will it get you 99%, 95%, maybe 90%? Yeah, it probably will.

Another question to ask: How do you feel about technical debt? Some people think it must be eliminated. I think those people are wrong. Just like in business, technical debt allows you to borrow "cash" or "time" in order to deliver something sooner. What's better: A perfect solution in 2 years or a complete hack that a customer can use and purchase in 4 months? Every situation is different, but in some situations if you wait 2 years, your customer will already sign up with your competition.

The key is to manage technical debt the same way a well-run business manages financial debt. If you don't take on enough, you are not getting optimum return on investment. If you take on too much, the interest will kill you.

So my advice: Start evaluating your work based upon whether you're maximizing your value instead of maximizing your thoroughness. And if you practice this, you will develop the same intuition that you already developed in your technical area.

As a side note, I recently started doing the pomodoro technique and it has helped a lot. Instead of going on a tangent of a tangent, focus in small time intervals and then allocate pomodoros for future work/research. It's amazing how many times I made a note to research a topic but an hour later when the time came, I thought to myself, "there's at least 3 other things I could do with my time today which are all more valuable."

samthebrand
  • 368
  • 2
  • 12
  • 27
DXM
  • 19,932
  • 4
  • 55
  • 85
  • 9
    So according to you, deliberately creating bugs is acceptable as long as they occur rare enough? – scai Oct 08 '13 at 06:39
  • 91
    @scai - you pick your battles. I've been in the industry for 15 years and I have not seen a single release in 3 companies that I worked at to date, that shipped with 0 bugs. It just doesn't happen in the real world. I'm not saying you intentionally introduce broken code but there's a level of perfection and bullet proofing which simply doesn't pay off – DXM Oct 08 '13 at 06:50
  • 29
    Creating a bug "deliberately" would mean the bug itself was intentional - which is not the same thing as being aware of the possibility or even specific existence of a bug or incompatibility. I have an HTML5 app that doesn't work right in IE6, I'm aware of it, I even suspected that would be the case when I made it - it's just that "those that matter don't mind, and those who mind don't matter". You can knowingly build a bridge that won't withstand a nuclear attack, and that's OK. – BrianH Oct 08 '13 at 16:22
  • 31
    +100 for your take on technical debt. Like the OP, I've been trying to eliminate *all* technical debt. I had never considered the idea that technical debt is fine, until the interest starts killing you. Now I see that managing the debt is much more important than eliminating it. I had never thought of it in those terms before. (btw I also use the pomodoro technique.) – adj7388 Oct 08 '13 at 17:33
  • @adj7388: how did you award +100?? – R. Schreurs Oct 08 '13 at 18:35
  • @R.Schreurs - that was just a figure of speech :) – DXM Oct 08 '13 at 18:36
  • 1
    Oh jeez, so you are one of those people who force projects to spend 90% of their time finishing the last 10% because it doesn't work. – Dunk Oct 08 '13 at 19:23
  • 3
    @Dunk: I'm one of those people, who builds a backlog of work I have to do and if a story takes too long, I split it. I will then work on the most important story first. Often times after the split, some sub-stories will get prioritized much lower than original story. The bottom line is that I deliver value and rest assured I care about quality but each story will get priority based on its relative value. Important bugs will absolutely get fixed. But I will never spend a solid week working on ONE TASK and tying up every loose end I can think of. But if they are important, they will get fixed. – DXM Oct 08 '13 at 19:35
  • 1
    @Dunk: I will then look at the state of my software as a whole and determine if it's good enough for Beta or production and if it is, regardless of how many bugs are still open, I will ship version 0.9, 1.0... etc and continue working on the backlog. Each open bug/feature/improvement will get prioritized based on cost to me and value to my customer. – DXM Oct 08 '13 at 19:41
  • 3
    @DXM:So using your own example. You build a simple and quick temporary file thingy. Oh great, now everyone who needs it can get to work using it. Eveyone starts using it and their code isn't working. Low and behold, it was your quick and easy 5 minute implementation that is broken. It took several developers quite a few hours before they realized the problem wasn't in their code. Tell me again how much time you saved? – Dunk Oct 08 '13 at 19:54
  • 4
    @Dunk: you just twisted my words. Let's say I build a file thingy. If everyone can move on, the next story to cleanup and tighten security might get done 2 weeks from now. It might also get done by a co-op. However, I WILL NOT release a feature if it breaks other people's work. That would make "cleanup" task much more important, and it will get done ASAP or part of original work. At no point did I tell you I will ship unusable code. When I say look at the costs, I didn't mean be selfish and just cut down your own work. I mean look at the cost for your team and your company as well. – DXM Oct 08 '13 at 20:13
  • 7
    This answer closely mirrors my own experience and take on Technical Debt. More than intentionally creating it, simply by entrusting the work to junior staff, you end up with technical debt naturally, which must be fixed later, educating them in the process. Basically once you reach this stage, you MUST invest in learning about tradeoffs, and think in terms of borrowing debt which must later be repaid. This because you MUST entrust work to junior staff simply because there's only one of you, and even if what you get is lower quality, you can deliver what would be impossible for you alone. – SplinterReality Oct 09 '13 at 00:46
  • 2
    @DXM:I'll grant you that I "embellished" upon your description but I finally got a guy off my project who held a "similar" philosophy as you expressed. He gives the impresssion that he is making great progress, management is thrilled with him, but then you discover that he is making progress because he always assumes happy day scenarios. Other people suck in his code, start implementing and spend a few hours before tracking it down to one of his modules that didn't think that maybe the file didn't exist yet.... – Dunk Oct 09 '13 at 18:33
  • 2
    ..His attitude is fairly common AND seems to inevitably end up with the same results. These people become a cancer because they are frequently good at office politics and are able to transfer any blame to others. Especially when management thinks they are so wonderful because they keep hitting their schedule. Of course management is blind to his negative impact on others and the fact that he didn't really meet the schedule. – Dunk Oct 09 '13 at 18:35
  • 1
    @Dunk: You might be projecting that guy onto me and I'm not that guy. I am "management". I've held team lead or supervisory roles for a while now and this is the message I've always sent to the guys below me and managers above me, which is actually very similar message as what kriss mentioned in post below this one. The key is that I'm talking about minimizing costs across the board all the way to the customer. Not doing shitty job and just making everyone else around you suffer. – DXM Oct 09 '13 at 18:42
  • 2
    @Dunk: I think you and I work in very different environments. My backlog is team's backlog. It is visible to the entire company. And because we (at least try to) follow agile, decisions like breaking down large tasks prioritization are done together. We do not do politics and I've never been on a team where team members lie to each other. But our philosophy in my team and the company is very simple: do most important things first. And simple facts: some bugs are less important than other bugs and some bugs are less important than new features. – DXM Oct 09 '13 at 18:56
  • @DXM:I guarantee we work in different environments and completely different kinds of customers. Bugs cost us or the customer lots of time and money. Doesn't seem to be the case for you. We also have very different outlooks on acceptable. Regardless of how you determine tasks at some point a task or module is assigned to someone. My view is that when you assign a "professional" a module they deliver it in a professional manner, which means it works for happy day AND obvious error scenarios. And at least some thought is given to the non-obvious scenarios to determine if they are likely to occur. – Dunk Oct 10 '13 at 14:11
  • @DXM:I never said the developer lied. He just has a different perspective on what DONE is. Similar to the view that you expressed. That may be ok if you are working an internet site or internal app where getting a new version distributed costs next to nothing. Not so if a customer is paying you to do a job for them and they expect it to be done "right" when you deliver it. Even more not so when costs are high to update software. – Dunk Oct 10 '13 at 14:15
  • @Dunk: My first job was doing plant control software that ran things like oil refineries and nuclear power plants. And we absolutely had a quality standard and everyone understood definition of "DONE". But we still never shipped with 0 bugs. Our customers knew what was done and which features weren't working and they made the call whether to get current release or stay with the previous one. But we still made regular releases even though there were still bugs. Not every defect causes catastrophic failures. Some are just not that important. Some times we'd work on features customers wanted... – DXM Oct 10 '13 at 14:19
  • ... more than the bugs they were fully aware of. They'd simply work around the bugs or decide that feature X which is broken wasn't that important for them, compared to new functionality that they needed. – DXM Oct 10 '13 at 14:19
  • @Dunk: Do you guys actually fix EVERY SINGLE bug and tie up EVERY LOOSE END every single time you ship? I'm not saying it's bad or wrong. Clearly different industries/environments need different levels of quality. Would you mind telling me what company you work for? Now I'm kinda intrigued to check you guys out :) – DXM Oct 10 '13 at 14:32
  • Take to chat please if you want to continue discussing, Thanks. –  Oct 10 '13 at 19:08
  • 1
    @WorldEngineer, the sad thing is that chat is not tied with the question and, by the last time I looked at, content there is transient... – Fabricio Araujo Oct 10 '13 at 20:07
  • 3
    So the discussion is lost forever, so moving it is equivalent to lose it. And this discussion is MUCH better than the answer. – Fabricio Araujo Oct 10 '13 at 20:14
  • @DXM:We certainly don't fix every single bug and tie up every loose end and I don't think I ever implied it. I said to consider all of the reasonable issues that are likely to occur. It is doubtful that this can be accomplished by taking 5 minutes to implement the fictional file-thingy. In the prototype stage, 5 minutes may be plenty but once you get to the "this is the implementation" stage then there is a degree of professionalism that should be expected out of a sw developer. Reasonable error handling is in my list of professionalism. Obscure error handling not likely to ever occur, no. – Dunk Oct 14 '13 at 17:49
  • @Dunk: Completely agree with you. And the way I would find what a reasonable level is would be by performing rough cost-benefit analysis in my head. How much effort would I have to put it in to get to next level vs. how much benefit would I get out of it. I'm pretty sure you and me are both on the same page here. Maybe my example above was a bit made up, but I never meant to imply that you should write code with no error handling. If you want to keep talking we should move to chat, otherwise, I just hope you see this response before mods delete this entire thread – DXM Oct 14 '13 at 18:37
  • 1
    You are misunderstanding what technical debt is. It is exactly what causes your next feature to be ready in 2 years instead of two months. – Piotr Perak Mar 30 '14 at 14:52
  • @Peri - and how is that any different from someone who took out too much money at the bank and now drowning in interest? Have you read the above comment thread? If yes, do you disagree that every unfixed ticket is a chunk (could be very small or not so small) of technical debt? And if you don't disagree with that part, do you disagree that just about every development team will ship products with open known tickets just about every time? http://blog.codinghorror.com/paying-down-your-technical-debt/ -- "...accruing technical debt is unavoidable...". I think I'm good with my understanding – DXM Mar 31 '14 at 20:34
  • @Dunk You may find this video series really interesting as it discusses such things as technical debt, cost of delay and over-utilisation etc http://channel9.msdn.com/series/Fundamentals-of-Lean-Software-Delivery/02 - it may open your eyes or it may horrify you, in any case, I think lean or something like it, is how things will be done, more and more in the future. – Luke Puplett Apr 01 '14 at 18:41
  • @BrianDHall If your app doesn't work in IE6 it's probably the IE6 bug! – Mahdi Apr 07 '14 at 12:29
  • Technical debt is more vicious than that. – Morg. May 20 '14 at 12:38
  • @Morg - it is unfortunate that every software professional doesn't use exactly the same definition of words and phrases, but such is life. I agree that the way you defined technical debt in your mind, it is more vicious than what I'm describing. But you'll have to agree that between myself, Jeff Atwood and the author of that msdn that Luke posted, and Luke himself, our definition of "techincal debt" is different than yours. $20 loan with 5% interest is still a debt, but if I choose to have extra $20 today, it is my choice to take on that cost, which ain't that severe – DXM May 20 '14 at 14:49
  • You underestimate technical debt. Coding without prescience means creating technical debt, and your "4 months" example seems to imply that it takes more than 4 months to have technical debt worth managing. In my experience and from a pure sprint productivity optimization standpoint, it takes about five days of coding to create enough debt to justify one day of cleaning up. That's with someone like me who likes to plan and do things right the first time. – Morg. May 22 '14 at 07:53
100

I had the (likely) same problem many years ago, it lasted for a few years and I overcame it. So maybe it would be of some interest to you to know how I achieved that, even if I'm not sure my way will also apply to you.

You should also have a look here : The Seven Stages of Expertise in Software Engineering It shows that productivity is in great part a side effect of skill level. It may be that you are still at some point between stage 3 and stage 4 on the technology you're currently using (skill proficiency depends on technology, you can be master of some technologies while still learning others).

Now I start with biographic testimony.

A bit of context. I'm 47. I started programming at 12 in the 80's. While in high school I also worked as a part time professional game programmer. Basically it didn't got me that much money, just enough to buy hardware, but I enjoyed it and learned much. At 18 I started a formal learning of Computer Science.

As a result when I turned 20, whenever starting any programming task I knew many ways to solve the given problems and was very conscious of the many parameters and pitfalls at hands, and drawbacks and limits of any method.

At some points (say about 26 years old) it became really difficult for me to write any program at all. There was so many possibilities opened that I was not able any more to choose between them. For a few years (make it 6) I even stopped programming and became a technical news-writer.

I never totally stopped trying to program nevertheless. And at some point it came back. The key for me was extreme Programming, more specifically the Simplicity principle: "Write The Simplest Thing That Could Possibly Work".

Basically I forced myself not to care about code efficiency (that was my main roadblock, avoid inefficient designs), but just go the easiest way. I also forced me to care less about errors, and delay error handling to a later time, after writing tests raising the error (really that's TDD).

That's something I learned when I was writing. When I do not know what to write, or I knew what I was writing was bad. Just go on. Actually write the bad stuff. I will eventually correct it later. Or if it's really that bad erase it and rewrite it, but it's faster to write things two times that write anything perfect the first time.

Really it is very likely that a code you believe is good at first writing will need as much improvement as a really bad one.

If you follow the Simplicity path you also get an added bonus. You easily accept to remove/change initial design/coding. You get a more flexible mind.

I also got in the habit to put a temporary comment in code, explaining what I was not doing now and intended to do later when the code would be functional in the normal use case.

I also attended an XP Dojo an practiced code katas with other programmers to internalize the XP practices. It helped. It made the above formal methods instinctive. Pair programming also helped. Working with young programmers gives some momentum, but with experience you also see what they do not. For instance in my case I often see them engage in overly complicated designs and I know the design nightmare that may lead to. Gone that way. Did that. Had problems.

The paramount point for me is keeping the flow. Being fast is really succeeding in keeping the flow.

Now I'm back as a professional programmer and I believe I'm both better and faster with a deeper understanding of what I'm doing. Practicing TDD I may still be slightly slower than when I was a young bull (and tested nothing), but I also have no fear refactoring and certainly spend much less time debugging (nearly no time at all, make it less than 10% of time).

Summarily: I overcame my codeblock using agile methods (XP), going for simplicity then refactoring, and practicing to make that instinctive. It worked for me. Not sure it can be generalized to anyone else.

In terms of skill acquisition level, I mostly learned to accept that every time I change technology (learn new language, new framework, etc.) I will go through a stage when I'm slowing down. This is normal and will eventually overcome that. I also can compensate for that with good methodology and general purpose programming skills and It won't be as much a problem.

gsk
  • 101
  • 4
kriss
  • 1,040
  • 1
  • 8
  • 11
  • 26
    +1 for "it's faster to write things two times that write anything perfect the first time" – Brendan Long Oct 08 '13 at 17:23
  • 2
    +1 for sharing a personal story, which I expect will be recognizable and useful for the questioner. – R. Schreurs Oct 08 '13 at 18:43
  • 2
    I agree, you may be experiencing coders block (like writer's block). You can't manage the complexity, so you dally. The cure is the same as for writer's block; write __something__. Soon as you have something on the screen, it will give you ideas how to proceed. You have probably been given this advice in a less lucid form, as, "Don't worry about efficiency/errors/whatever, just get something done quickly." Well, that's half the answer. The other half is that once you get past the empty screen, doing the __actual__ error handling, efficient algo or whatever is straightforward. – SeattleCplusplus Mar 29 '14 at 18:19
  • @SeattleCPlusPlus: I agree it's straightforward for simple problems, probably for most algorithmic code. It's no so simple when you want to get some good classes structures. Refactoring rules are not totally useless. – kriss Mar 31 '14 at 08:00
45

An important part of programming is managing and controlling complexity and for me personally, it is one of the top issues. If ignored then either the frequency of deficiencies surges or, as in your case, the ETA of finished software increases dramatically.

Either an increase in deficiencies or a decrease in ETA

Software complexity can be controlled and managed from many different levels and ways but a good rule of thumb to get some perspective is this: "Top priority of any software project is customer satisfaction which is a function of their expectations."

In other words, software complexity depends a great deal on how skilled you are at controlling the expectations of your customer.

When one adopts that view, then two important points become obvious:

  1. customer expectations must be made explicit (in whatever form);
  2. customer expectations can always be modified and that is done through the art of negotiation.

Your example is a very good one, "simply write it" vs "myriad of other considerations". Think about it - if someone were to write down exhaustive requirements for both variants, can there be an equivalence in described features or not?

Building an F16 is different from building a Cessna although both of them can fly.

Saul
  • 140
  • 1
  • 7
28

The simple answer is: accept it.

In all systems there's trade-offs to be made between reliability, robustness, security, speed, hardware cost, development cost, time to market, you name it. You will not always agree with how the customer makes those trade-offs, but you're not the one making those decisions. All you can do is provide a considered opinion. Software development covers the full gamut, from "my personal web page" to "run the nuclear reactor", and the code has to be written accordingly. If a crash means "reload my personal web page" then who really cares if that happens? But if a crash means "Chernobyl" then your preference for solid code is if anything a bit casual for my liking.

There are some clients who will happily accept "Proof of Concept" level code and run it in their live systems, and often they have systems administrators who are well used to that. IME their systems are usually unavailable for an hour or so in the middle of the night while a bunch of scheduled restarts happen. But they've made the business decision that that is how they want to roll. Ideally because their field is so fast-moving that high-quality code would never be ready, but often because they can't see the value (if a system "just works" they never notice it, therefore that system does not represent value for money). If it bothers you too much, try to avoid those clients.

Keeping up to date is time we all have to spend, or at least should spend. Sometimes that will get you work, other times it just keeps your mind in good shape. Either way, try to enjoy it.

Móż
  • 1,252
  • 1
  • 8
  • 16
  • 6
    That "a bit casual for my liking" bit in your Chernobyl comparison made my day. I actually laughed out loud :) – Zilk Oct 08 '13 at 01:32
19

It sounds like your skills would be very useful for very high quality mission critical systems development, like finance/trading related applications, broadcasting, aerospace, defense...

Errors in these sort of applications are very costly and they employ people who think like you as you can cover all the cases.

Robin Green
  • 1,233
  • 1
  • 9
  • 22
newlogic
  • 415
  • 1
  • 4
  • 7
18

The truth is that modern systems are becoming increasingly complex. The computer is now similar to that game "Jenga" where you have all of these pieces relying on many of the others. Pull out the wrong piece and you have an error, pull out a correct/necessary piece and you still may produce an error. The more complex the system the more time you are likely to spend thinking of ways to make your code more robust, and hopefully more secure as well. Speed would be nice, but I think speed takes a back seat a lot these days when you hear in the news that "XYZ" company was hacked into and 6 million customer's credit card numbers were stolen.

Your clients may not want to hear that their program needs to be secure, robust, etc.. But you could tell them that their car does not need seatbelts and airbags nor their house need locks and doors... because who wants to hear all that?

If you are over-thinking you are going about things the right way, except that you need to pick a strategy that seems "concrete" and just go with it.

10

It sounds like you're aware of your tendency to think about everything that can go wrong.

Experienced Cautious Developers often learn to follow the mantra YAGNI, you ain't gonna need it, when they try to return to a lean, agile and productive workflow after getting too choked up in the weeds of failure-mode-analysis-gone-amok.

However, if you are indeed writing something in a domain where that level of care is no less than what Professionalism demands, then you should realize that your "velocity", your "productivity", in net terms, is measurable by how much good (or harm) you are doing to your company, your customers, and the software suite, or product family you are building or maintaining.

Remember to:

  • Include total cost of maintenance, total cost of ownership, and total cost of deploying and maintaining solutions when you consider changes in your approach. Going faster and making more mistakes may or may not make things better.

  • If you work in a good company, you can probably discuss this in your own team, and with your own supervisor, without it being a Career Limiting Move. If you can't, now is a good time to find that out, and find a new job.

Warren P
  • 830
  • 5
  • 14
  • YAGNI saved me when I was going through this phase. This answer needs more upvotes. The problem of "I'm too slow" is _not_ to be merely accepted; there _are_ times when it's OK to sacrifice a perfect architecture to get it out the door quickly. – Roman Starkov Mar 30 '14 at 12:29
8

Only thing I can see is: "You are becoming more and more valuable".

As and when you get more experience you learn about things you should avoid, and this is what make you better than others.

One thing you would have noticed that your code would be safer and more maintainable now.

  • Only thing you need to do is to explain your client why it took time and how it would be useful for them.
  • You need to show them depth of your knowledge.
  • You need to tell them why you did, what you did and how it would matter them and their business.

My suggestion would be to concentrate on this part.

gnat
  • 21,442
  • 29
  • 112
  • 288
Falaque
  • 121
  • 3
8

when in doubt default to badly quoting Knuth...

"Premature optimization is the root of all evil."

Here is what I would suggest, as it seems like you have a problem that I have from time to time...

What really works for me...

  1. Write the unit tests, as if all the code was done.
  2. document the interface.
  3. implement the interface.

what you have really done:

  1. work through the model layers requirements
  2. really set up the division of work, which objects are responsible for what
  3. get to work in an environment when you can actually step through the working code, which makes things so much faster an more accurate...

also rely on asserts in early development... then figure out which remedies need to be implemented and you wont write code that is unreachable, or hard to test.

Grady Player
  • 185
  • 10
7

I think you should stick to your coding standards, but make sure you are up-front with your clients. Many clients do not know what it takes/costs to build good software. It's part of the professional developer's job to educate them.

Whether you're agile or waterfall, you get some sort of agreement from the client about what they expect the application to do. Too many developers (OK maybe more salespeople) are guilty of sandbagging. "They didn't say they wanted a highly secured website." In most cases, it's because they weren't asked. "Do you mind if your ecommerce site gets hacked?" Of course they care and why would you build it to let anyone penetrate the security? You have to educate them.

Just make sure you're doing only what the client is paying you to do. Part of your service is your experience. Clients expect you to know the pitfalls without them having to ask. It's up to them to include the requirement. You may want to pass on clients that want something cheap.

JeffO
  • 36,816
  • 2
  • 57
  • 124
  • Actually you just took the example of the worst: web software, where php noobs are officially competition. Price is an extremely important factor, and when I deliver high quality software, my clients pay for the software and I pay for the high quality. – Morg. Oct 11 '13 at 06:57
7

Think about the practical consequences of a bug as compared to all the other problems that need solving.

Consider the following consequences of creating a poorly written piece of code:

  1. Entire database gets dumped every other month. 48 hours of downtime while the backups are restored.
  2. Customer records get cross-linked. $200 worth of orders get shipped to the wrong customers per month.
  3. A order gets stuck in a wrong status once a week. Order ships but warehouse to has to call helpdesk every time it happens.
  4. Once very two weeks or so, the app crashes and user has to re-enter 2 minutes worth of data.
  5. Once a month, the app hangs on startup. User has to kill process and start over.

The first one is obviously unacceptable. #2 - #5 may or may not be, depending on the nature of the business. #2 - #5 need to evaluated in the context of other problems the business is facing.

Ideally, #2 - #5 would never, ever happen. In real life, with conflicting priorities, the people signing your paycheck might want you to be working on other things rather than writing perfect code that never, ever has a problem. They aren't going to be impressed if #5 gets fixed at the expense of not fixing a more serious bug in another program.

poke
  • 570
  • 4
  • 12
5

The solution is to create a collection of libraries with commonly used functions which you can re-use across projects. E.g. I have a StringFunctions.dll .NET library which does stuff like encoding, encryption, decryption, regular expression evaluation, etc. This way, I don't have to continually rewrite things that don't change.

Having a wrapper for file creation tasks also makes lots of sense. Your library could expose a method called GetFile() which does all the checks for you and returns either null or a file (or whatever you deem useful).

4

@Zilk, I am not great programmer and I am been programming since 1998. Even I am facing this issue now. But what I realized is ultimately quality matters. If I die today, somebody should be able to pickup what I am doing now from where I have left. Such should be the standards of programming (Universal).

I have moved myself from developer to architect now. Moving to Management is changing the line. If you want to continue with your passion you can move to become Architect.

Initially as Technical Architect-->Solution Architect-->Enterprise Architect-->Chief Architect and so on.

As an Architect you will be guiding people to success. People like you who have been programming for decades those years of experience you can utilize to guide others.

Like a bird higher it flies more land it can see so is your experience.

Let me also tell you programming correct implementation is important than programming a wrong implementation faster. Recently one of my juniors programmed something wrong and it cost a bank lots of money. Ofcourse we had delivered on time earlier but that was no use! Was I given the role to guide even though the same junior would have coded that problem would not have happened. I am giving this example to stress that giving good guidance is also important. Some call this job as Consultancy.

Satish
  • 111
  • 3
  • +1 for "somebody should be able to pickup what I am doing now from where I have left. Such should be the standards of programming" – Tim Gradwell Sep 17 '20 at 15:28
4

I think you need to learn to decide how much needs to be done for which project. Some project may be trivial and you really don't need to spend all that time in perfecting it. Not everything is gonna need rock-solid encryption nor everything will be scaling to million users.

Writing a program which can scale well for more than a million users will take time and experience which you have now, but if you know that your application is not going to be used by more than 1000 users max, there is no point in spending all that time perfecting it.

I think this is an important stage in your programming career and now you need to goto next level, which has to do with maturity and not programming. You need to be able to correctly decide on how much time and code should be enough for any particular project.

And like everything else, you can attain this as well with practice. So try to decide this before you start a project, sometime even while you are already working on it, with experience you will get past that as well. There may be a few hits and misses in the beginning but with time you will perfect it (decision-making, not code).

3

Another option is: stop writing code, instead sell your expertise in spotting the problems in advance.

In other words, become a Consultant.

Many organizations are happy to pay expensive dollars (if not top-dollar) for someone to spot the issues before spending months on creating the code that makes the problems. It is well known that fixing a bug in design, is orders of magnitude cheaper/easier than fixing it after it has been coded, tested, and deployed.

You won't be writing as much code, and you may likely miss that, but then it seems that the actual lines of code are not your core strength, but in knowing which lines of code should be written - and which shouldn't.

Focus on your strengths.
(well, if that's what you enjoy...)

AviD
  • 490
  • 4
  • 12
2

My best recommendation for you is: building blocks.

Make a file building block that you can trust always, make one for your API, stop wasting your time writing the same thing over and over. Think about every problem once and fix it once and for all.

Noone will catch up to that, certainly not the novice who spend 80% of their time debugging code that fails for corner cases they don't understand.

Most of all, don't fix problems that cannot happen, such as wrong permissions.

If the permissions are wrong, something is already wrong and you should fix that rather than making your program bullet proof.

At some point you have to just not shoot yourself in the foot instead of always checking whether you did or not.

Instead of spending time on documentation, spend time making your code self-documenting and as short as possible. Replace all those duplicate-ish functions. Shrink your library, rename things with precision.

Morg.
  • 250
  • 1
  • 5
1

Don't be too hard on yourself. You are working in a profession of increasing complexity, that requires more human intelligence, knowledge and experience than ever before.

Computer processing power is slowing - perhaps soon stalling - leading to the need to introduce multi-core chips, gpu powered numerics, parallelism, etc. There are only so many transistors that can be placed on a chip.

Therefore the big advances presently and in the future are going to come from programmers - advanced algorithms and more efficient code.

If you look at GTA 4 and GTA 5 the differences are astounding. But they both run on the same hardware. This is the result of some very intelligent and advanced programming practice that simply was not required, or available, 10 years ago.

It could also mean that experienced programmers may become more valuable in the future - much like other professions such as engineering where peak earnings typically occur late in the career.

AsymLabs
  • 428
  • 2
  • 4
1

Just like you, I started programming at the age of 14, also when I got my first computer (although I had been studying for a few months at that point). However, I am "only" 33 now. :-)

My suggestion is that, when developing something, you take each one of those worries (file permissions, number of files in a directory, etc.) and then use all of your vast experience to answer a few questions about it, in this spirit:

  • How long would it take to handle that issue properly in your code?
  • If you don't handle it properly, how likely it is that this thing will bite you later?
  • If it does bite you, what are the consequences?

Armed with those answers, such an experienced guy will not have problems to make a wise decision. ;-)

It is the responsibility of "veterans" like you to come up with this type of requirement, and that involves both identifying what can go wrong and deciding which potential problems you should give attention to.

igorrs
  • 150
  • 6
  • 1
    The OP's reaction is that all observed potential problemns need preventing. This might have been true when he was starting out as a junior programmer (because the potential problems he identified then usually meant an enormous quality improvement), it is most likely not true anymore: As @igorrs explains: don't automatically conclude that every potential problem you see must be prevented - consciously decide if you need to. That's *the* advantage you have over junior programmers: they can only prevent what they can see, whereas you can prevent what actually needs preventing. – Leon Bouquiet Jul 26 '14 at 22:51
0

Knowing all the possible criteria's while developing app is the most important thing in developing a quality product. You are doing good in this. One thing you can do is, You can categorize the requirement into quality level then map the level with the given deadline. In this way to you can meet the project deadline easliy.

Jagz W
  • 111
  • 3
0

In the words of Edsger Dijsktra: “If debugging is the process of removing software bugs, then programming must be the process of putting them in. ” You are just doing less of the latter so you have to do less of the former. It's just a question of learning to spend time coding it right. I am still a relatively young programmer (read 20ish) and I aspire to be able to code something completely right once. An hour of planning and 10 minutes of coding is way better than an 10 minutes of planning, an hour of coding, and three of debugging.

ford prefect
  • 489
  • 7
  • 12