|
We should write good code because good code is easy to maintain, not because it makes the code easier to unit test. However, it just so happens that well written code is easy to unit test; and testing our code, especially test-driving our code, helps us to write good code. But ease of unit-testing is not the only reason for writing good code, in fact it is one of the very last reasons. So how do we define good code?
|
|
|
|
|
Terrence Dorsey wrote: So how do we define good code?
It's simple and it works.
"If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." Red Adair.
nils illegitimus carborundum
me, me, me
|
|
|
|
|
I disagree... even good code might not work -- but detecting the problem and fixing it is easy.
|
|
|
|
|
Simple code may not be good code. Even though it works.
Wonde Tadesse
|
|
|
|
|
I understand what you are trying to say, but that is too simplistic. For example, this is simple:
string s;
for(i=0; i++; i<10000)
{
s += "Your data with a date in front";
}
It would be more complicated to implement a StringBuilder, but it is the right thing to do. Good code is usually simple but simple code isn't always good. Here is a fairly good, if not short, explanation: http://technosophos.com/content/good-code-useful-definition[^]
modified 24-May-12 15:43pm.
|
|
|
|
|
Tim Corey wrote: s = s +
Obviously you meant s +=
|
|
|
|
|
Yep, that. That shows me for trying to write an example of poor code on the fly.
|
|
|
|
|
But since it's an example of what not do to, wouldn't either be fine?
|
|
|
|
|
Good code is such that someone who knows little can understand and therefore enhance its usefulness.
Good programmers write such code and also can understand, enhance and clean up bad code so others can benefit from their efforts.
Unfortunately, it is sometimes more cost efficient to understand bad code, then incrementally recode only those portions that require enhancement.
A good programming manager will approve of this approach because the useful life of a project is extended.
It usually is an easy task to convince the programming manager of an incremental approach because most of the time required to understand the functions of the bad code is mandatory because it must first be understood before it can be modified.
The complete rewrite of a badly coded project is usually not feasible because of time and cost constraints.
Unfortunately, many programming managers are former mediocre programmers who have 'inherited' their management position through longevity or guile.
They are also more likely to promote a 'down and dirty' approach that can eventually lead to the early demise of a given project.
They can get away with it because they can always blame the hapless programmer who must do what the manager demands. Usually, this happens because the manager must answer to a superior who rarely understands or appreciates the benefits of good code.
Anyway, that has been my experience as a programmer, manager and eventually the founder of a software house, over almost fifty years in this business.
|
|
|
|
|
The code I write!
If your actions inspire others to dream more, learn more, do more and become more, you are a leader." - John Quincy Adams You must accept one of two basic premises: Either we are alone in the universe, or we are not alone in the universe. And either way, the implications are staggering” - Wernher von Braun
|
|
|
|
|
The code that ahmed writes... once it has inevitably been rewritten by me.
|
|
|
|
|
Roy is an experimental programming language that targets JavaScript. It tries to meld JavaScript semantics with some features common in static functional languages. Try it out in the online console.
|
|
|
|
|
I find myself seeking a good balance between the numerous layers of hacks that compose a shell script and the purely functional wonder of a Haskell program. Such efforts already exist, but I believe this to be tackling the problem from the wrong end. Instead of hacking together a library to make Haskell code reminiscent of the beloved /bin/sh, the problem should be tackled with hacking together a sh script to mimic the best of Haskell, and retain the beauty of shell scripts. Intoducing Fun.sh.
|
|
|
|
|
The creator of the Wiki dishes on the Wiki, Wikipedia's policies, OO design, technical debt, CoffeeScript and Perl, how to survive as a veteran programmer, and doing the simplest thing that could possibly work. A wiki on Mr. Wiki.
|
|
|
|
|
The rule of thirds has been around for several hundred years, with the first written reference by John Thomas Smith in “Remarks on Rural Scenery” (1797). While the rule of thirds can be used intentionally in art, photography or design, it is also an ever-present concept. Even when you don’t plan or accommodate for it, the rule of thirds exists. Your job is to use it to your design advantage. A timeless design tool anyone can use.
|
|
|
|
|
Windows Azure is part of the Microsoft "stack" - the suite of software and services we offer. Because we have so many products in almost every part of technology, it's hard to know everything about all parts of what we do - even for those of us who work here. So it's no surprise that some folks are not as familiar with Windows and SQL Azure as they are, say Windows Server or XBox. There are no sharks, and no frickin' laser beams.
|
|
|
|
|
Reminds me of a reverse IP lookup I did the other day on my Azure hosted website. There were a thousand websites that were returned. I'm not going to name any names, but one of them was a very popular website, so I guess they are on Azure too. And that makes me wonder how Azure is capable of sharing the same IP address among so many sites... maybe it's the IP address of a load balancer that points to a bunch of machines?
|
|
|
|
|
For the sake of argument let’s take it as a given that the next iPhone will sport an 1136 × 640 display, with the same 326 pixels-per-inch resolution. Let’s further assume that this new iPhone will not be announced until later this year, say, around October, just like the 4S last year. How might Apple get developers on the right track to support a new aspect ratio at WWDC next month while maintaining their standard radio silence regarding as-yet-unannounced products? The secret 176 pixels.
|
|
|
|
|
Many web developers use SSH (“Secure Shell”) on a daily basis to manage their servers, back up files, work remotely, and a myriad of other tasks. Today, I’ll explain what SSH is, do a brief history review, and, lastly, teach you how to set it up on your remote server or even your local network. Let’s get started! How to use it... and how to use it better.
|
|
|
|
|
An exploit that fetched a teenage hacker a $60,000 bounty targeted six different security bugs to break out of the security sandbox fortifying Google's Chrome browser. Pwned by Pinkie Pie.
|
|
|
|
|
Ultimately, there are two kinds of websites: those that are ends and those that are means to ends. These are two massive, general categories with all kinds of detail between them, but the distinction is important to narrowing things down. What's it meant to do? And does it succeed at that goal?
|
|
|
|
|
The world of forgotten passwords is actually a little murky. There are plenty of different perfectly legitimate angles and a bunch of pretty bad ones as well. Chances are you’ve experienced each many times as an end user so let me try and draw on some of these examples to see who’s doing it well, who’s not and what you need to focus on to get it right in your app. Always reset, never remind!
|
|
|
|
|
Very good link, thank you
Regards.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpfull answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
What does is mean to be an Agile Developer? Where does that path lead? I’m wondering how many developers out there have ever had the opportunity to find out. And for those – few, I suggest – who have, did they like it as much as I have? From faux Agile to full-on Agile, and all the steps in between.
|
|
|
|
|
I really did not care for my experience with Agile. The company was just moving to Agile, I was a new employee and their previous development team had jumped ship (taking the majority of the domain knowledge with them); leaving only one developer. Stack on the learning curve of the new system, the newness of Agile methodology for the team; and ever changing requirements with a rock solid date to get the product to market, this was a nightmare. Looking back, I believe that the company had problems keeping a talented IT staff and their attempt to adopt the Agile methodology did not help their cause
|
|
|
|