Alan Cox on Writing Better Software
Andy Gimblett writes "Alan Cox recently gave a talk in which he discussed some current and emerging techniques for producing higher quality software. Some of these will be familiar to Slashdot readers, such as validation tools, type checking, etc, but others seem heavily influenced by his recent MBA. In particular, he has a lot to say about Quality Assurance in the software world, and the kinds of things we should be doing (and some people are doing) to make better software. Story and lots of quotes at Ping Wales, and video at IT Wales."
he has a lot to say about Quality Assurance in the software world
Quality Assurance in 4 easy steps!
Dear Managers,
1. Listen
2. Close your mouth
3. Plan everything around #1
4. Profit!!! (notice there is no line with ??? because you listened!)
The dangers of knowledge trigger emotional distress in human beings.
It's quite surprising to me that there's no mention here of unit testing, or any sort of automated testing where the engineers who wrote the code actually write tests.
It should, by now, be clear that "code that doesn't have tests, doesn't work", and that if XP has done anything for us, it's to focus on writing tests. I've seen this in action and it works.
John.
unit tests
not a panacea, but it does go far.
Simpy
I see that the word "Free" doesn't appear in this story's synopsys.
How would Alan apply his quality methods to projects which member might never meet due to geographical contingencies ?
Trolling using another account since 2005.
...isn't just for end-users! If you anticipate that others will be working on future versions/releases of your software, good commenting can make the job SOOOOO much easier for the next codemonkey.
I'd say commenting is doubly important in OSS projects, as it involves many sets of eyes trying to comprehend what you coded.
There's a Mercedes gap too. I want one and can't afford one, but it's not government's job to do anything about it.
Who cares about what Alan Cox has to say? He's soooo 2.4
...but all I got was krill.
However the greatest problem with writing good software is still in the marketing. In order to sell/license software it needs to have features, and the lack of defect often does not count as "features".
Anyone have a mirror?
I am a professional software developer, and I would like to argue that the top 5 most impportant things about good software is (in order of preference, most preferencial first):
1. Stability
2. Robustness and speed
3. Sufficient comments (one comment every 3 lines)
4. Passing large objects as constant references and not by value
5. Viewing your code in assembler afterwards and using a profiler to look for bottlenecks
Of course, the above mentioned things are not enough, but I believe it is a good place to start. Any other ideas?
But the real key is reducing the number of defects introduced into software. Testing only finds existing errors. If the number of errors are low from using good requirements, design and development practices then testing becomes less expensive and time consuming.
That's our old friend goatse.cx
All those moments will be lost in time, like tears in rain.
My employer produces a large-ish software package, with 10 years of history and a small, 2-3 people, development team. Since I joined we have made massive strides in automating the build process, include some unit tests, and a few smoke tests in an automated process.
Well, the effort paid off. Before we supported one version of HP/UX, and one release of Linux, now we support HP/UX (still a pain), and 4 looking at going to 6 Linux version/distributions and it is less work to produce a release now than ever just a year ago.
Tools like automake, autoconfig, libtool, cvstrac and of course cvs have made my life bearable.
thank god for google the story
When I tell an object to delete this, am I killing it or telling it to kill me?
Is he back on full time linux development now?
:)
"Alax Cox gave a talk"
Was it in Welsh?
We did, and now it has gone.
Come back Wales!
IT Wales, working in partnership with Know How Wales, Knowledge Exploitation Centre and Cygnus Online, has unveiled plans for an exciting new programme of events specifically targeted at computing professionals from both business and academia.
During the launch breakfast, held in Sketty Hall Swansea, on Thursday 23rd September, Beti Williams, Director of IT Wales, outlined the aims and objectives for the group.
"The IT Wales Advanced Technical Computing Group will help to establish and promote Wales as a country with an international reputation for innovation and excellence in Computing and Information Communication Technologies. It will provide a platform for collaboration between computing professionals from business and academia, enabling them to drive forward the computing industry in Wales and stimulate awareness of the diverse applications of computing. The group will also be well placed to highlight the skills required to meet the future demands of the global computing industries."
Guest speaker Alan Cox, a graduate of the University of Wales Swansea and one of the most influential IT innovators in the world, offered the audience an entertaining and thought provoking insight into the current limitations and human failings of the software development process.
The full programme of events will commence in January 2005 and will link with organisations including the British Computer Society, Welsh E-Science Centre and Natural Computing Forum.
Details will be published through itwales.com and e-mailed directly to IT Wales business club members. For full video footage click on one of the links below
To register interest in receiving information from the Advanced Technical Computing Group e-mail details to info@itwales.com
Presentation:
Real Media File (31kbit, 7.5MB,
320x240res)
mpg video (120kbit, 25.5MB,
160x120res)
High quality DivX and 330kbit mpg files available here
DivX version also available in the business club members section
Questions:
Real Media File (31k, 3.3MB, 320x240 res)
mpg video (120kbit, 11.2MB, 160x120 res)
High quality DivX and 330kbit mpg files available here
DivX version also available in the business club members section
Well, they've had the idea of requiring authorization, so the effect is the same.
Anyone got a mirror?
The links seem dead so I will add my .02. The programmer's view of the software should not be confined to the source code control system. Programmers should know how to install and implement the software they design and code. Programmers should have some personal experience supporting the software they code. NOTHING highlights the weaknesses of your software faster than being forced to work a support line/forum, etc. Establish personal relationships with employees in the sales force and management. You will be able to be more influential in the company if you do this. Establish personal relationships with your customers. You can use them to push your agendas. Paying customers have some of the most pull with your company. Use this to your advantage.
It's slashdotted..
Btw He didn't write it in Welsh did he? Coz Wales officially doesn't exist http://news.bbc.co.uk/1/hi/wales/3715512.stm
2 farmers from Lampeter go to Market Day in Carmarthen and have a very successful day and sell all their cattle. They go for a posh lunch in Queen Street at lunchtime before going home.
The waitress walks over and asks, "Menu Sir?" to which they reply, "Bwyd cyntaf, menyw ar ôl"
...are nifty. They can catch all sorts of stuff and produce lovely reports - or, well, at least functional reports. And running them nightly - or hourly - helps to ensure the code won't get out of sorts.
PLUG: Need to check Java code? Try PMD!
The Army reading list
You do nto notice major differences until you do unit test first as part of the design process before doing OO code...
Because it is short cutting the design pahse by takign youd own less unworkable roads ti improves the design while decreasing tiem to complete the code..
That is why the phole complete process is called agile!!!
Unit testing after the design is not very effective except to catch where things break after a change
Don't Tread on OpenSource
You can't help but be frustrated when dealing with projects that were obviously "proof of concept" which then evolved directly into the actual "product". Hard to resist but just plain stupid. I wish more open source projects had strict standards.
yomomma.org/
Reusable, reliable, quality software begins with the interface. If someone cannot tell what a routine or module does with just a quick read, then all is lost. They'll cease to believe what the documentation (if any) says, and go on to write it themselves.
The solution is better interface design. Clear, concise naming without ambiguity. And including the specification is absolutely necessary. With the contract included as part of the interface, there is even less chance for error and/or any ambiguity. Testing is aided because the rules for calling a routine are right there with the routine interface and comment.
Unfortunately, most programming languages refuse to support contracting in any form, and most developers don't see the benefits. Until this hurdle is breached, quality software will not be achieved.
Steve
--
remember Sammy Jankis
Sometimes it is just contemplating if it makes good sense. Sort of like "I wonder if it makes good sense to take an Internet browser that connects to the most insecure network on the planet, integrate it completely into the operating system and don't properly validate data that is recieved.
From excellent karma to terible karma with a single +5 funny post...
As always, mirrors of the pages and the movies are here: MirrorDot. Enjoy.
~Jay
We used to implement code reviews at my former workplace, but they were more "sanity checking" peer reviews than anything else. They didn't take very long, and it gave one or two other people a chance to see how understandable or generally logical the changes were.
That type of thing doesn't work as well for large changes, but we found that for small ones it sometimes can be a useful thing.
Mainframe/UNIX Bit Twiddler and long time Windows/Linux Hobbyist.
The Theorem Theorem: If If, Then Then.
http://itresearch.forbes.com/rlist/term/Software-Q uality-Assurance.html
Chris Williams clw7500nc@gmail.com
This has several important benefits:
www.eFax.com are spammers
Wonder if he also talked about being on a chip. ;-)
In the Fortran variant I was working in until a few years ago, local variable names were limited to five (5) characters, and many otherwise obvious functions were performed by a series of external subroutines with six-character names usually beginning with SY (for "System").
That meant that the code itself could be quite hard to follow without some sort of logical commentary accompanying it.
I tended to comment my code quite heavily in that context, since I'd already had experience with uncommented code in that context and knew how hard it could be to follow...
(Try reading Fortran that's all in column 7 and which is mainly composed of arithmetic IFs and CALL statements sometime and see how intuitive it is!)
When using more modern languages, I tend to comment less, sometimes a lot less. It usually comes down to a judgement call on my part as to whether or not I think the code would be easy for a newcomer to maintain...
Mainframe/UNIX Bit Twiddler and long time Windows/Linux Hobbyist.
The Theorem Theorem: If If, Then Then.
"regression testing, what's that? If it compiles it works and if it boots it's perfect!" - Linus
'nuff said
If thou see a fair woman pay court to her, for thus thou wilt obtain love
These are some things i guess is necessary for good software
1) Reviews at all stages.(Reqs/design/dev)
2) While at development, u sure must know whats the most efficient way to code a design (which libraries are more suitable etc)
3) Unit testing and Integration testing (when the project is huge)
Some practices that managers can really use to take the pressure off the team
1) Try giving buffers to the team (seriously, it works)
2) Proper Code management (Lotsa rework and pressure come due to lack of this)
3) Proper tracking and status updates to the customers
emerging techniques for producing higher quality software
So now we're taking software writing advice from PHBs now? :)
The only way to create error-free software is using a guaranteed error-free interface (I'm not talking Java, we should go much further), which has to be the base of the operating system to be actually error-free.
As a nice by-product, developing applications will be much easier.
At my company the management has started an MDA (Model Driven Architecture) project, because some developers presented it to them as the holy grail in software development. They use a GUI to make associations between classes and ASL for the code. They say that you are less likely to make a mistake because you code in a platform independent way (so, you do not have to pay attention to all the little details) and the translator is responsible to make the actual code.
Some of us more experienced developers do not think it is the holy grail. It looks like you can make as much mistake as in convetional languages. Also, development with a GUI (see at www.kc.com) is much more cumbersome.
Is there anyone who used MDA and ASL and has some experience about it?
Government cannot make man richer, but it can make him poorer. - Ludwig von Mises
Tight code? Have you been living under a rock since 2000? With one or two exceptions (read: Farbrausch) the rest of the scene can't see past the 3D engine (with hardware requirements that make Doom3 look like made for low end) and unoptimized DX9 or, in some cases, OpenGL code. Long are gone the times when PC coders knew what they were doing and wrote tight assembler inner loops. If you want to look at tight and optimized code look at Doom3 and Far Cry. It doesn't get better than that. Or even better, download some Amiga and C64 demos.
There was recently a fast coding compo in a party and the C64 guys were typing the hex codes directly, not even using an assembler. Talk about tight code! :)
Erlang Smorgreff
Perl is happy happy language. Code always turn out better.
The guy should first learn to write code himself, then write an essay. Also, the guy just lost my respect when he tried a mini-golpe at the time of 2.4.9 VM change. He staied out of the kernel for 1+ years and I think noone missed him.
Here is an eigenpoll about Best Practices for Software Development
The current list are
The Planing Game
Scrum Project Backlog
Continuous Integration
Test Driven Development
TDD & CI with Aegis
Onsite Customer
100% Test Coverage
Scrum Project Management Patte
Current Worst Problem
Layering
Collectiv Code Ownership
Simple Design
Use Cases
Big Visible Chart
Refactoring
Codeing Standards
CRC Cards
Pair Programming
Continuous Performance
And your can add new options yourself.
Don't say:
double sum = 0.0;
for (i = 0; i < len; ++i)
{
double signal = buf[i];
sum += signal*signal;
}
return sqrt(sum/len);
say:
double sum = 0.0;
for (i = 0; i < len; ++i)
{
double signal = buf[i];
sum += signal*signal;
}
return sqrt(sum/len);
In other words, tell me WHY this code added the square of the signal, not THAT it added the square of the signal.
Moreover:
If more folks would follow these rules it would be a HELL of a lot easier to follow their code.
NOTE: If you can say it in the code, do so - if you can specify the exceptions to your function via a "throw(int code)" type statement, then do so rather than using a comment.
Remember - the code tells the COMPILER and the programmer what is going on, the comments tell the programmer WHY it is going on.
www.eFax.com are spammers
The text version has a link for "Next" that points to the same text as the original page, but in a larger font. The /software directory only contains those 2 files.
Is this irony? An article about quality has only half of the article.
And it increases the Slashdot effect as everybody thinks they made a mistake and keeps clicking the "Next" link until finally realizing that the website is broken.
I spend my life entertaining my brain.
Thank you, good sir.
Oh no, someone with an education in MANAGEMENT suggesting ways to MANAGE a production process.
Yes your average programmer/engineer might be able to manage a project. But why not take some of the expertise of a manager to make it a bit better?
If someone like Alan Cox should now be ignored as "some MBA toting PHB" how open minded are you?
I think Alan might have a bit of an idea how the software development process works.
If you're not even willing to consider their ideas, you're doing yourself quite a disservice.
For DOS/Windows/OS2 etc:
h tm)
Gimpel Software's:
PC Lint (cheapish)
Flexelint (pricier)
Freeware (checks GDI leaks)
bear.exe (http://www.geocities.com/the_real_sz/misc/bear_.
gdiobj.exe (http://www.fengyuan.com)
Linux:
Electric Fence (free)
Valgrind (free)
Splint (free)
Books:
John Robbins books on debugging. Concentrates on Win 32 but useful ideas wise for any x86 platform.
And now the gags...
Tools I've not found helpful.....
Rational Rose!
Microsoft's beloved COM!
Linux fan and Win32 developer
read
"Am i missing a programing language reference here?"
as
"Am i missing a programing language specific reference here with use of interface? ie as a reserved word? Java perchance?"
The Ping Wales article's link to Page 2 loops back to Page 1.
Quality Assurance is not testing.
Testing is testing, and can run the gamut from unit to use case, from integration to system, from acceptance to beta. But QA is not testing. A lot of people call testing QA, but it is not the same thing.
Testing is what you do when you get the code. QA is everything that you do throughout the software development cycle to ensure that you have quality software. This can include code reviews, process audits, statistical analysis, etc.
I have been doing QA and testing for 11 years now. I have a degree in computer science, and I CHOSE to do this career. You may be able to get away with ignoring QA professionals and still produce high-quality software. But not all software projects are equal. QA is probably the most overlooked part of software development, testing the second.
My beliefs do not require that you agree with them.
Oh, come on. If you didn't laugh at that, you'd have to cry. Even if you don't like the subject matter, you've gotta admire the way this just cruised in under the radar.
..... the server can spit out dynamically-generated JavaScript which in turn modifies style sheet properties ..... when you want to edit a record from a table, sometimes it's easier to populate the inevitable "add a new record" editing form straight out of the table, highlight the row being edited and put the UID into an invisible <input /> field, rather than fart-arsing about fetching another page and repeating an earlier SQL query just for the editing form} and certain carefully-selected sites?
Or am I the only IT boss who insists to disable JavaScript by default except for the office Intranet {our in-house LAMP [and we use at least two of the possible P's in that acronym] apps use JavaScript a lot for flinging data around between forms and highlighting stuff in tables
By the way, if you really want a GMail invite, they are giving them out like confetti at the moment.
Je fume. Tu fumes. Nous fûmes!
I don't get it.
Cause you didnt heed #1. Or #2, for that matter.
I dont hate managers, but I gotta tell you, mlh hit the nail *right* on the head.
From the listening will come many many concrete steps.
emt 377 emt 4
Alan Cox got O-O programming and Objective-C, reusability and abstraction layers right.
Now I have to listen to him bitch about academic concepts because he has an MBA. Pluueese...
There wasn't an original idea in the whole article in the link to this thread.
-r
Great, now we get to hear everything we've heard in CS1 classes repeated over and over.
I'm tired of people simply repeating what they've read in a book. I'd like to see some actual studies to measure the benefits of some software practices. I think the results would be enlightening.
I agree with most of the posts citing organizational and management techniques as the most fruitfull areas for improvement of software quality. But technical fixes don't require changing attitudes or otherwise fighting human nature. It seems to me, since the Sun's, IBM's and MicroSoft's of the world are spending tons of money to give us slickly integrated or widely applicable software development tools, that they would do themselves and us developers a favor to incorporate some of the oldest "lessons learned" into the tools. We have had so many "revolutionary" languages come and go that we seem to have forgotton just what array bounds checking and strict type enforcement save the average programmer from having to think about. In my current project, I am porting Ada code to C++. Yes, Ada is a language only its Mother, the DOD, could love but we shouldn't have tossed out the baby with the bath water when everyone dropped their support for it. There were vendors of quality assurance tools to be used on top of the qualitity built into the language because the customers and the developement culture all emphasized reliability of the finished product. How did we manage to so thoroughly get away from those objectives?
SLASHDOT: news for people who can't concentrate on work or have no life at all and got tired of yelling back at the TV.
Or use a language that allows something like this in approximately 900 man/days for an individual. Working with live objects in an integrated IDE is powerful, and eliminates many of the problems, and tools built to combat those problems that other languages have (BTW that FAA radio problem mentioned on "/." wouldn't have happened with smalltalk).
A company I worked for recently, in the South of England, was having much of the testing done in India, via the internet, on real hardware which was in the lab in the UK. The testers could drive the emulators and debuggers as if they were present. Same for code reviews and all the other things.
This was safety-critical software to DO-178B Level 1, it does not get any higher!
The implication above that type checking automatically produces better software is false. Type checking tends to bloat up the code, making it harder to read. Harder-to-read code means more errors during inspection and changes. Plus, the time saved using dynamic or "free" typing languages gives one more time to inspect the code and build unit tests.
Heavy type-checking relies on the same theory that more buerocracy is the solution to quality. It is not. Keeping code lean and clean is the road to quality in my observation, not bloated formality.
Table-ized A.I.
To take the analogy from other Engineering fields:
;) ). The more responsible ones sell the plastic models...
;).
The first one (v1.0) is the "Blueprint". With software the blueprint actually works like the Real Thing! Compiles, runs, makes the right noises, blinks the right lights etc. But it should never be mistaken for the Real Thing.
The second one (v2.0) is the equivalent of those plastic/clay models. You do various tests on these. Go back to a new blueprint if you've screwed up badly.
The third one (v3.0) is The Real Thing. It'll have bugs of course, but by this time it should mostly work as expected.
The fourth one (v3.1) is The Real Thing with the annoying bugs fixed - equivalent of a renovated house just the way the customer now realizes they want it.
The fifth or sixth one (v4.0?) is when a bright spark or two decide that something fancy is needed and adds pink flamingoes, garden gnomes, ornate parapets, Clippy and other stuff. Things start going downhill soon.
The big trouble with software is it costs about the same to do each stage. So most of the time people try to sell the blueprint (and usually get away with it
And that is one reason why most software isn't that good.
The other reason is most programmers are crap (and many use languages which highlight their crappiness - e.g. C or C++). There are tons of crappy books and few great novels. Spell checks and good proof-reading won't make a crappy book good - they can't fix a plot with holes like a sieve... Good editors (auditors?) are rare.
But fortunately(?) for us all, many people still want to buy crappy books
Caveat: I'm not a Programmer/Software Engineer and have no Comp Sci or IT degrees (I'm just an IT security consultant), so take my words with a dollop of salt if you may.
Look, there's a couple hundred posts in here already about how to improve software quality. To me it's all besides the point. We already have a rich collection of ideas and approaches to improve things. The problem isn't a lack of comprehension about how to improve in terms of coding practices or general development processes. Most individual coders and their immediate managers IMHO already know very well what they're doing and what they're not doing right.
The problem is a business problem originating 'higher up'. The folks who own and run software development companies simply know what they can get away with. At the present time they can get away with selling defective software. I don't know why but for some reason the marketplace mechanisms that normally correct this sort of quality problem aren't working.
The whole software dev industry is basically in denial about this. We like to talk quality but in reality our customers don't demand it and we don't produce it. Until that overall dynamic changes how can anyone expect the PHB's to do anything different. No responsible PHB is going to spend money on something producing no return.
Btw, can anyone explain why this isn't the case with other high tech products. We all expect our home electronics etc to work 100% perfectly but with pure software products we're much more tolerant.
Rule of thumb:
- 1.0 is a prototype/beta.
- 2.0 is the first redesign.
- 3.0 fixes 90% of the bugs and adds user-requested features.
- 4.0 is nearly perfect
- 5.0 is a needless redesign
- 6.0+ are just spiffier graphics and/or useless redesigns.
Two years later, someone releases a prototype similar to the original 4.0 and the cycle repeats.I've never believed on testing.
It may sound crazy these days, but it is not.
Never saw a non trivial piece of software (read 'real application') that is 'FULLY' tested.
The whole concept of 'QA' on software is ridiculous, software has two main propieties that invalidates the whole concept:
1 - The complexity factor, interrelation between parts give an exponential number of possible error conditions, testing those conditions, simply takes too much time.
2 - There's no way no qualify a design as 'good', that's a application dependent evaluation, not an objective one. The best we can say about a given design is that is not that bad, we cannot logicaly assure quality on design.
I can understand the bussiness need of such concepts, and the real opportunity of people doing bussiness around them, but pretending QA is something more than a buzzword and a bussines catchword is simply false.
What's in a sig?
Things like UML, and before that, Yourdon, and lots of others, are there as methods of expressing the design, before a single line of code is written. So are textual documents with pseudo-code, and informal sketches in the designer's log book, and lots of other things, which ought to be considered as vital parts of the source documentation. And of course, Requirements Specifications are absolutely vital in any branch of engineering. You really do need to know what you are designing!
The change control process needs to include everything that is used to generate the final code, so that it is all kept up to date.
I don't think that Sir Bill comprehends this, because otherwise the Criminal Monopoly would not be changing the fundamental requirements of Latehorn right now, ripping out bits that they can't implement, in the same way that every new piece of bugware they create is utterly lacking at the front end of the process, and is hacked and patched (in the derogatory sense) till it "seems" to work, at what should be the tail end of the development process. But there again, I don't think that Sir Bill understands anything that is remotely technical, but he does have better comprehension than most of new ways to run an Illegal Monopoly.
Wales doesn't exist, according to the EU
What? They only found out about zero day holes recently?!
Ever heard of a one night stand?
Nevermind, wrong site...
There: Something at a specific location.
Their: Owned by someone.
Please make sure your english compiles.
On UNIX you did this instead:This was revolutionary. Really. It's not perfect, but it's so much better than what we were using at the time that it's no wonder people couldn't wait for AT&T and re-implemented UNIX from scratch several times.
This is the same kind of improvement we need in our interfaces for GUIs, databases, network services, and so on. Even the Berkeley socket interface is too complex... all those details of address formats and address structures? Those shouldn't be there... you should be able to do this:Yes, there's libraries that do this, but they all have the same socket()...gethostbyname()...connect() stuff under the hood. This should be handled at the system call level.
As for GUIs... Plan 9 is about the only one I've seen that looks like it's even trying to reach the level of clarity, safety, and consistency we need.
Pretty interesting reading especially since it touches several points we are also trying to make with our OpenSubsystems project.
He says: "Of the much-vaunted 'holy grail' of reusable objects, Cox said, "As far as I'm concerned these all generally suck too. Part of the problem is that they're sold as products and the original ideas behind a lot of reusable products is that you wrote it once. If you write it once, it has to do everything. If it does everything it's complicated, and if it's complicated, it's broken. That's not always the case but it is quite frequently the case.""
I cannot agree with this point. It is impossible to start every project from scratch and even though not reinventing the wheel, create your own version of it. Using his own argument about microprocessor industry, microprocessor manufaturers mastered the art of creation of complex and reusable objects Similar examples can be found in other areas of life (construction industry, car manufacturing). Since it is possible to do it in hardware, there is no reason why software components cannot be complex and still reusable but still of high quality. The software industry should probably learn their lessons from the the above mentioned industries.
Some of the critical requirements to get to that point are
Be specific then generalize. Only very few people have the capability to abstract the patterns to create reusable piece of software. If the generalized patterns don't match the actual need and use, they will not be used. Create software you need and that does exactly what it needs to do. Then go back, review, revise, observe and only then extract the common themes into patterns and reusable components. Replace the specific parts of you system with the newly identified reusable components.
Start simple. Most software projects struggle with incorrect, invalid or misunderstood requirements. It is impossible to create something, which can be reused if we do not understand what it should be used for. When trying to create reusable component, do not try to encompass "infinite and everyting". Take only the pieces, which are truly generic and handle other scenarious by inheritance or customization. Software follows 80/20 rule where 80 percent of users use or need only 20 percent of the provided functionality. Your generic components should represent those 20 percent.
Good interface. Design good interface for your reusable components. This is what everybody will be using with the rest of the software being just a black box for most users. If you do not get the interfaces right then the component will not be used correctly or as often as it should be. If they are not easy enough, the perception will be it is easier to recreate it than reuse.
Test, Test, Test. There is no excuse for releasing code, which doesn't work. The reusable code represents you and your reputation and it is much easier to loose a good reputation than to gain a bad once. Think about it as warranty. It plays a big role when buying car or house. Why shouldn't it play the same role when buying software.
Extend and iterate. Once you got the simple reusable object right, customized and extended it few times for specific situations look back and identify the next set of common behavior. Listen to your users. Instead of including every new feature into the simple component, think about creating new extended version, which can be reusable as well. This way you can still provide and use the simple object when the simplicity satisfies the requirements without confusing users with the additional bells and whistles.
Documentation. Without documentation it is difficult to use any slightly more complex object. Without documentation it is hard to communicate your ideas and intentions. The better you communicate the larger audience understands you.
Since PHP is a scripting language, you can write pretty much anything and something will happen when you run it. Usually PHP does a pretty good job guessing what type you meant and such, so it kind of fixes your bugs for you. That way you don't have to test your code.
Concept programming is an approach to programming that I hope will yield improvements in quality. If your code is structured like what it represents, then it's easier to understand and maintain. This simple idea yields interesting metrics, and highlights issues that are a bit hard to spot otherwise.
Over time, I became convinced that a new language was actually necessary to implement concept programming correctly. It turns out that some of the tools developed for XL help many other things (like documentation, good interfaces, automated tools, etc).
-- Did you try Tao3D? http://tao3d.sourceforge.net
If I ever had an engineer working for me who didn't already know all of those points that Alan Cox writes about, I'd fire him on the spot.
Alan Cox wins the award for having a firm grasp on the obvious.
I actually read the article and watched the video hoping that there might be some new information in there. But alas, it's all just normal everyday qa processes.
His diatribe against explicit memory allocation didn't really belong there. While there certainly are issues with it, gc is no panacea. It just puts the burden on code that you don't control. I can't begin to tell you all of the bugs I've tracked down that were caused by bad gc implementations.
I first read the title as "Alan Cox is writing better software", and thought that finally he's doing that :-) Then I realized my mistake and was disappointed.
-- Esa Pulkkinen
One place I worked had mandatory code reviews. It accomplished a couple of things:
1) Enforced variable naming conventions including informal exceptions to the convention. "You get i, j, and k for free."
2) In an environment where there were both employees and contractors, it made sure that there was no code that only contractors understood.
It also makes sure that there is no code that only one person understands.
3) It kept gratuitously clever code (usually mine) out of the production system. An example of this, in C++, was using constructor syntax in integer variable declarations, e.g. int i(5); instead of int i = 5;
4) Other programmers would make suggestions as to where they would like to see comments added.
As a result, comments were put where the code was hard to understand, not where it was obvious.
5) Oftentimes somebody would catch where the code didn't match the comments.
It mostly worked because there was a strong manager that knew the personalities, chose who reviewed whom, and kept pointless arguments to a minimum.
Any given software development practice will not solve all the problems by itself.
Code reviews won't catch all the bugs. Unit tests won't catch all the bugs. Design diagrams won't prevent all the design flaws.
But applying pressure on all these fronts, combined with talented team members, will improve the quality of the software.
"We can't solve problems by using the same kind of thinking we used when we created them." -- Albert Einstein
...but others seem heavily influenced by his recent MBA. In particular, he has a lot to say about Quality Assurance in the software world...
Software QA by normal people: Test the product.
Software QA by MBAs: Assure that twenty thousand meaningless documents are signed, perform audits to ensure that these documents are signed, provide mandatory training so engineers know how to sign these documents, award bonuses to those who sign the most documents, define productivity to be the number of signed documents in an engineer's cabinet.
Don't blame me, I didn't vote for either of them!
Any programmer that tries to "convince" management that quality assurance checking is desirable will be first on the outsource-to-India list.
Management doesn't want any backtalk about "quality". They expect the programmers to do things right the first time; that's what they're paide to do. When management has compliant workers in India that work cheap, follow instructions, don't talk back, and aren't around the manager's office geeking up the place, they're not going to bother with "quality assurance" insubordination. In particular, programming methodologies such as Extreme Programming that require greater management involvement in the coding process will be treated with scorn; management wants less involvement, not more. As to whether or not the code actually works - once it's out the door and bonuses are in hand, who cares?
Stunned by the horrible quality of the software in the megacorp I work for, I was complaining to a dot-com millionaire friend of mine who got rich on a different company. It was enlightening.
He related the experience of meeting one of their VPs. Turns out the VP was famous for having realized that every customer service call was an opportunity to SELL MORE PRODUCT. Their profits went up. Wooo-hooo! Writing SHIT CODE actually made them MORE MONEY.
I realized it was the same with my company. On all the on-line forums I hear "I'd never buy any other brand. I once had this horrible problem, and their customer service was so responsive! They fixed the problem!" It never seems to occur to customers that if the product actually WORKED they wouldn't have needed to call support in the first place. Shit code boosts our profits, too. People get a warm fuzzy talking to good customer support, no matter how bad the technology is.
There are other ways to benefit from bad code, especially if you dominate the market. Releasing a new version? If you botch the backward compatibility it forces everyone to upgrade! Profit!
So, what's all this nonsense about better code?
Yes your average programmer/engineer might be able to manage a project.
I think that is way too generous, if we are going to continue the Dilbertisms keep in mind that your average programmer is mediocre in the profession that he/she has been trained for. Why would you think he/she could do well in a profession that they are not trained for?
Overall I agree with you. The problem is that there are very few people who are trained in both technical areas and management. More often than not a person in a given position has knowledge of one side and ignorance of the other, or possibly contempt as so many posting around here show. The geeks with the later attitude are the nerd equivalent of the pointy headed boss and are probably making their own contributions to project failure, should we coin the acronym point headed geek, PHG?
There wasn't an original idea in the whole article in the link to this thread
Original ideas are highly overrated. When the audience is ignorant of high level ideas, mid level ideas, and may have only heard but not understood the low level ideas, it is far better to go over the old material once again.
"ElitistWhiner", +1 for cuteness.
-or-
Sex with a mare
Or a governor.
images on the background of large portions of text is a NO NO!
Unfortunately convincing most managers of this is nigh on impossible. They somehow infer that it means that you write shitty code.
All his points are valid, but (a) dangerous when taken as gospel, and (b) miss the forest for the trees.
What kills software is complexity. I've been writing code professionally (i.e. getting paid for it) since I was 15. It's been 28 years. Starting with Dijkstra's "GOTOs Considered Harmful", I've seen fads to improve software reliability come and go: structured programming, object-oriented programming, garbage collection to handle memory leaks, etc; as well as programming languages prividing the syntactic and semantic sugar to support the fad du jure. Hasn't helped, has it?
The general problem is one of managing complexity: if you can "come from" anywhere to a snippet of code, how can you ensure that all your assumptions about the context you're in are valid? Similarly, if you can access a global variable, well, globally, how can you be sure it contains what you expect? How do you know all the ways your data can be accessed? How do you control when and where an object is destructed, or that all resources (memory being just one) are freed?
Either restrict who can do what, or restrict the assumptions you make about the things you are operating on.
Using a garbage collector restricts who can allocate and deallocate memory. Object oriented programming restricts who can muck with private members. Structured programming restricts how you can get somewhere. O.K. wise guy, how are you going to write a garbage collector without dealing with raw memory? Gee, you have to get your hands dirty. How are you going to deal with private members inside private member functions? Gee, looks a lot like functional programming with globals, doesn't it?. How, the heck are you going to compile that loop without a jump at the end? Gee, what was that about GOTOs?
The trend appears to be to try to find the "next great technique" which will provide the best bang for the buck when improving quality. All of them help. None of them enough. Frankly, this incremental approach is not going to solve the problem of defects that are a result of the product of human error and code complexity. We need to learn how to manage complexity on its own.
Are there any examples of success in managing complexity, and can we learn from them?
I think so.
The best example I can think of is a compiler. Look at how many different inputs it can handle and still produce correct machine code with a fairly low defect rate. I attribute this to the fact that its input is highly structured: it has to follow strict syntactic rulers. Thus, when compiling something, one has a great deal of knowledge about the context in which this occuring. Yes, you have to deal with semantic issues (types, declarations, etc.), but an unambiguous language should make this clear.
One can point out that programming languages are well-specified, so implementing a compiler is relatively easy. If only all requirements were so detailed. I don't think that's it, however: one can come up with very detailed specifications for a complicated system that's difficult to implement. A programming language, by contrast, can be syntactically expressed in a few pages of BNF.
Contrast this with a user interface, where various elements need to be enabled or disabled depending on what other elements have been previously activated, or used to gather data. How easy or difficult is it to "forget" to enable or disable a control? If you see a parallel with this problem and excessive use of GOTOs in a program, you're starting to get a feel for what I'm talking about.
What has happened in the past 25 years or so of programming language evolution is that the complexities of the past have been pushed and morphed into the complexities of the present. And tackling one in isolation (memory management) does nothing for a transformation of the same problem (resource management in general -- memory isn't the only thing that leaks), though it may provide the best bang defect-rate-reduction-wise
You could've hired me.
Can you summarize in clear terms what the difference between concept programming and object-oriented design is?
Also, what exactly make XL a concept programming language? It looks somewhere between Haskell, Ruby, and a simple procedural language to me.
I took a look at your webpage. Kudos on the effort. However, it looks like you're reinventing a clone of python. No offense, but I think you'd probably be better off making a frontend for python, given how many "in progress" and "todo" items you have (and the fact that those make up a significant portion of your total project).
Disclaimer: I'm not a fan of python, but I'm working on a language of my own, so I make it my business to read about and compare language ideas. While it looks like you've spent 90% of your time documenting, I've spent 90% of my time writing code. I have a working interpreter that runs an order of magnitude faster than interpreted perl or python, and I'm about to make the leap to JIT compilation. Anyway, once my compiler is ready, you may want to think about writing a frontend for it. (Note: I don't have a website yet, and I won't publish the spec until I finish my compiler.)
QA of GCC sourcecode (C,C++,...) is very bad (demonstration: gcc-4.0-ss is very unstable and dirty).
QA of C# Mono (from Novell?) is very bad (demonstration: it has memory leaks, the guilty is who uses Boehm GC).
QA of Java from GCC is very bad (demonstration: it has memory leaks, the guilty is who uses Boehm GC).
open4free ©
But yeah, for the kinds of things I'd use a scripting language for today, Unix file i/o is OK and all.
Cox really does highlight some of the best practices out there, but he also skims over some key ones. The biggest problem I've seen out there (and I've done QA Management consulting for a good chunk of those 10 yrs, so I've seen a lot of organizations) is commitment by management. Most QA folk know that there will always be a challenge to find the right balance between schedule/budget, quality of product, and feature set of the product. Do you want it good? now? or stripped down? And most QA folk are willing to work within that mindset. But when management 1) does not appropriately staff QA activities; 2) does not appropriately fund QA activities & annual budgets; 3) does not make it damn clear to all staff that QA is a requirement for project and thus ultimately product success and if you don't like someone testing your code and logging bugs against it, you better move along pardner, the organization pays lip service to QA. Heck even when QA finds a horrible problem prior to release, so there's time to fix the problem, you'd think most folks would be happy (ok, not thrilled because that balance is skewed towards a schedule slip) that there was time to get in a fix. But no, 99 times out of 100, QA is slammed for holding up the process.
Independent testing is a must for an organization to have any real understanding of the quality of the product. Engineers cannot be the only folks testing their outputs. For oone, it's a very expensive way to test - I want geers designing & coding & unit testing not integration or system or release testing. QA folks will cost between 30-70% of a geers salary - why would you want the most expensive resource doing the (in most cases) less technically demanding work? And work they usually don't enjoy doing anyways (grumble grumble, I didn't sign up for this!)
OK, so this is a bit of a rant. I'm just dealing with my current senior management who say they want QA to manage and execute the independent testing, but turn around and find 95% of Engineereing who refuse to participate in the process.
I'll just go have a beer and forget about my problems...mmm... beer... drool drool.
"Content's a bitch."
A few suggestions 1 have some sort of switch that dumps a complete config file to ~ (this is an all options with defaults type file) 2 set things so the most common run is shortest 3 assume the files to process are in the current directory (and are wanted in the current directory 4 actually write useful documentation
Any person using FTFY or editing my postings agrees to a US$50.00 charge
Until management and HR people realize it's about hiring engineers who take quality and accountability seriously, the software has the deck stacked against it. It doesn't matter how long that person has been programming. It's about a person's attitude and work ethic. Even in a horrible environment, a good programmer will deliver acceptable software. they won't be happy about it, and will most likely leave, but atleast what they do write will be implemented well, carefully designed and documented.
Stop saying "Bzzzt! Wrong!". It's fucking annoying.
Can you summarize in clear terms what the difference between concept programming and object-oriented design is?
:-) From a CP point of view, OO is an approach which models a rather large range of concepts represented as "verb + noun", where verbs are represented as methods, and nouns as objects. For instance, "window.draw()". There are some concepts that OO has trouble with, because they have no easy "verb + noun" representation. For instance, computing a maximum the OO way is tricky. In Java, you'd typically resort to a non-OO static method for that. See http://mozart-dev.sourceforge.net/cp-vs-oo.html for a more detailed discussion.
There's very little in common, except for the fact that they are both software methodologies
Also, what exactly make XL a concept programming language? It looks somewhere between Haskell, Ruby, and a simple procedural language to me.
As to what makes XL a concept programming language, it's extensibility combined with readability. That it looks like a simple procedural language is by design. It would not be CP if it could not represent old concepts the usual way. It's under the hood that it's really different. And you see when you start manipulating non-standard concepts, for instance a simple plug-in allows you to manipulate symbolic differential forms in your source code. You can't do that as easily, if at all, with any of the languages you listed.
-- Did you try Tao3D? http://tao3d.sourceforge.net
Reinventing a clone of python? XL has very little in common with Python, except the indent-based syntax. There's not much that Python can do that can't be done better with other languages. In other words, it's mostly syntactic sugar on well-known concepts. XL, on the other hand, introduces several powerful ideas, and does a few important things better than existing languages I know of.
So I think it's worth doing.
-- Did you try Tao3D? http://tao3d.sourceforge.net
Also, what exactly make XL a concept programming language? It looks somewhere between Haskell, Ruby, and a simple procedural language to me.
The old XL (in C++) is about 55000 lines of code. The new XL is about 22000 lines of code. Documentation is a fraction of my time.
-- Did you try Tao3D? http://tao3d.sourceforge.net
Hi, can you post some kind of mailing list or "New language will be posted here" webpage?
I'd post a page on one of my sites if you don't want to/can't find a free site.
sd_newlang.4.webinfo
[at]
xoxy
.
net
Well, if you want a pure OO maximum, rather than a Java maximum, then there would be a maximum method on a collection. Add all the numbers to the collection, then call maximum, and it will give you the maximum. Whether or not that would be able to handle comparison of different types would depend on the language (anything that includes generics certainly could), but an OO design like that can inherently handle multiple numbers.
So far, nobody really expected the compiler to perform the differentiation for you, even if cheap pocket calculators like the HP-48 have been capable of doing this incredible feat for maybe 10 years... But why not?
That's quite simple. Your understanding of how calculators do it seems to be wrong. Nothing that I know of creates a derived equation and uses that. They use numerical methods that make use of the original equation to compute the derivative. With your example, the "incorrect" code is nearly correct. You make the equation into a function (in rough psuedo-code):
func I(t) = K*exp(-alpha*t)*sin(beta*t)
Then you use another function to find the value you want at t:
derivative(I, t)
Which will use the I function with numerical methods to compute the value at t.
Complexity is sometimes required to make things work. Sure you can work out simple ways to do simple things but complex things like handling user interaction is not simple, users are not predictable especially when my kids get on the keyboard.
Does a lot of the checking that lint does and it is free and happens every time you compile.
If you check -Wparentheses, I found three assignment bugs in OpenOffice.org already.
It is interesting that doing a code review well is very hard. I have a hard time not reimplementing my concept of the code over the top of the code provided. This is incredibly hard to do.
It sounds like your "testing" is the automated testing that you have in place, this is excellent and should be part of the build. Note that you should NOT be testing it yourself before the code review The whole point is to ferret out bugs before wasting time on further testing, ie code, automated tests, review, then test thoroughly.
One of the points of this is attitude of the programmers. If you sit in and say "I tested this and it works" it immediately reduces the incentive to really find bugs.
hello
Padraig, this isn't my journal!
Your after making a comment on a story about the great Alan Cox.
Although this is an old story so it will do.
How's tricks?
I see now why your replied to this. It's a comment by me. I thought you'd just replied to a random comment in a story.
Well, if you want a pure OO maximum, rather than a Java maximum, then there would be a maximum method on a collection.
You obviously have not read my definition of a concept cast. A concept cast is when you cannot represent a concept, and use some alternate concept in its place. It's very insidious, and most people don't even realize when it happens.
In your case, you replaced the concept of maximum of N elements with the concept of a collection containing N elements. They are close, but not identical. As a result, semantic noise is introduced, for instance boxing and unboxing, or built-in memory management for lists (it depends on a particular implementation).
-- Did you try Tao3D? http://tao3d.sourceforge.net
That's quite simple. Your understanding of how calculators do it seems to be wrong. Nothing that I know of creates a derived equation and uses that. They use numerical methods that make use of the original equation to compute the derivative.
The HP-48 calculator or Mathematica both do the thing that "nothing you know of" does. We could also discuss why the numerical approach may be incorrect.
-- Did you try Tao3D? http://tao3d.sourceforge.net
pick somewhere to use for these messages. i've enabled comments on my journal entry work