by RyanZAG · 12y ago · 0 comments
Anyway it makes a good point that business objectives come before "best practices" which I agree with, but you need to be careful when cutting corners that you don't actually sabotage your business objectives. The real discussion is actually on a risk level: if I cut corner X, I can potentially make revenue Y unless cutting corner X causes a problem and I incur loss Z. Cutting that corner is only good if
P(no problems | cutting corner X) * Y > P (problems | cutting corner X) * Z
If this equation looks tough, it's because it is tough. This is not an easy decision and you really need to be on top of your game to choose correctly. Alternatively, Y must be much bigger than Z and you have some faith in your shortcut. But for most dev work, a lot of the time you're going to be getting that equation wrong if you just guess it and it's why so many experienced devs will tell you not to cut corners.I am currently developing and maintaining a system which powers an ongoing core business process. If it goes down, employees basically sit around unable to accomplish work. I hope that this system will be robust enough to continue operating for years, maybe decades, and anticipate that during that time four or five business units will either transition their processes to this system, or create new processes that use this system. Clean, quality, well-tested and extensible code clearly matter here in a way that they don't for a one-off Christmas 2013 promotion.
I think this captures the central problem in our current software development state of affairs. Because as developers we are stuck with primitive tools that make doing even trivial stuff time consuming, we have been conditioned to view every piece of code we write as a "will be maintained forever" proposition. You don't generally see people using excel and worrying about the maintainability of their spreadsheets, because even sophisticated spreadsheets are trivial to create and so the default mentality is use and throwaway.
This is a problem we are trying to tackle at my startup, a web developer tool that you can use to quickly put out applications to support day-to-day operations without obsessing about whether you're going to need to build a spaceship out of your current requirement.
I agree with you we should strive to make trivial things simple to write, and I also agree many programming tools fail at that, but I don't agree the software we write (in general) qualifies as trivial. Even some spreadsheets don't qualify. People writing them often make a horrible mess of it, unless they truly are simple spreadsheets.
I didn't mean to suggest that it doesn't require knowledge and effort to put together a sophisticated spreadsheet but relative to building even the simplest web application, spreadsheets are a breeze.
Indeed, the only "solution" I see is a solution in just the loosest sense. Namely: We continue incrementally improving languages, frameworks, libraries, and coding practices--a process that has been going on since software began. That's a disappointing answer, but I think it's the only answer, and I'll explain why.
The complexity of the tools we use is a result of their great flexibility and power. For example, a Ruby on Rails app is a huge agglomeration of technology, including HTML, JavaScript, jQuery, CSS, SCSS, Ruby, the Rails framework, and usually a number of other, project-specific technologies. All of these technologies must be learned (no small task), and their quirky interactions with each other must be managed. One sometimes thinks, "There must be a better way! There must be some abstraction that can hide all this technology." But I challenge anyone to design such a thing.
Each of those technologies is mature. Each one has had tremendous effort put into designing the simplest possible API without sacrificing power and flexibility. Even technologies with a lot of baggage, like HTML, CSS, and JavaScript, have seen substantial improvements in recent years. Given that, does anyone think they can do better? Can anyone do everything these technologies do and present a radically simplified API? Remember, you can't sacrifice power and flexibility and just support the most common use cases. Almost any application will need at least one thing that's unique or idiosyncratic.
This is why people use Rails (or similar tools) for custom apps instead of Wordpress. Wordpress has many off-the-shelf plugins that provide commonly-needed features. From a site maintainer's perspective, Wordpress abstracts away most of the complex web programming inherent in those features. But for serious app developers, that's almost never good enough. The plugins never seem to work exactly as you need them to, and they rarely talk to each other the way you would like. A short ways into the project, you're forced to either hack up your plugins, which is a maintenance disaster, or code your own plugins, which means you're really just using Wordpress as an inferior Rails substitute.
>The complexity of the tools we use is a result of their great flexibility and power.
This may see like a strength but it is actually a massive weakness. Existing IDEs attempt to be all things to all people and as a result are not actually delivering the best that they could if they were more focused.
>Given that, does anyone think they can do better?
Download our software (check my profile for link) and spend some time playing with it, you might just reconsider that position :)
Or join the newsletter, we are coming out with an exciting update that is basically going to attempt to combine wordpress-like application composition within an IDE.
That said, I think the operative decision is "should I cut the corner?". If so, you should also factor in the p( ___ | not cut corner ) probabilities.
So, you should cut the corner if the benefits exceed the costs. Written out:
p(~P|C) * b(~P) - p(P|C) * c(P)
>
p(~P|~C) * b(~P) - p(P|~C) * c(P)
Symbols: p = probability; b = benefits ($); c = costs ($);
P = problems; ~P = no problems; C = cutting corner; ~C = not cutting corner.Rearranging to:
p(~P|C) * b(~P) - p(~P|~C) * b(~P)
>
p(P|C) * c(P) - p(P|~C) * c(P)
Then you get a simpler form: b(~P) * (p(~P|C) - p(~P|~C))
>
c(P) * (p(P|C) - p(P|~C))
An amazing fortune awaits any person who can simply evaluate this inequality in real-world situations.It is also useful to know when the cost of gathering the information to evaluate the expression is not worth the potential benefit!
Everyone just thumb sucks it in the end anyway - I'll just embed this domain name in the distributed binary, nobody will ever steal our domain name! Technically someone at this point should pull up the statistics for stolen domain names to get an estimate for the probability, and work out how much it would cost to set up a system to pull a correct domain name from a backup, and then work out the cost to redistribute all the binaries to end users whose software won't be working for some time. I doubt anybody has ever done that particular calculation.