2012.12.05
Programming Languages vs. Fat Fingers
A substitution of a comma with a period in project Mercury's working Fortran code compromised the accuracy of the results, rendering them unsuitable for longer orbital missions.
How probable are such events and how does a programming language's design affect their likelihood and severity?
In a paper I recently presented at the
4th Annual International Workshop on Evaluation and Usability of Programming Languages and Tools
I showed results obtained by randomly perturbing similar programs written in
diverse languages to see whether the compiler or run-time system
would detect those changes as errors,
or whether these would end-up generating incorrect output.
Continue reading "Programming Languages vs. Fat Fingers"Last modified: Wednesday, December 5, 2012 11:40 am
2012.09.22
How to Calculate an Operation's Memory Consumption
How can you determine how much memory is consumed by a specific
operation of a Unix program?
Valgrind's Massif subsystem could help you in this regard,
but it can be difficult to isolate a specific operation from
Massif's output.
Here is another, simpler way.
Continue reading "How to Calculate an Operation's Memory Consumption"Last modified: Saturday, September 22, 2012 5:46 pm
2006.10.06
Code Finessing
When I set out to apply CScout
on the Linux kernel source code, I
discovered that it failed to correctly expand a couple of C macros,
causing the analysis to fail. This prompted me to reimplement CScout's
macro expansion using a
precise functional specification,
then optimize
the code's severe degradation in time performance, and finally tidy up
the optimized code mess.
Continue reading "Code Finessing"Last modified: Friday, October 6, 2006 9:44 am
2006.09.25
The Verbosity of Object-Oriented Code
As I refactored a piece of code from an imperative to an
object-oriented style I increased its clarity and reusability,
but I also trippled its size.
This worries me.
Continue reading "The Verbosity of Object-Oriented Code"Last modified: Monday, September 25, 2006 0:32 am
2006.09.21
UML Class Diagrams from C++ Code
I needed a UML class diagram of the classes I use in the implementation of
CScout refactoring browser.
I drew the last such diagram on paper about four years ago, so it was
definitely out of date.
I always say that whenever possible documentation should be automatically
generated from the code, so I decided to automate the task.
Continue reading "UML Class Diagrams from C++ Code"Last modified: Thursday, September 21, 2006 11:49 am
2006.06.26
Dave Prosser's C Preprocessing Algorithm
For about five years I've been trying to implement a fully conforming
C preprocessor for the front end of the
CScout refactoring browser.
I've found this to be a fiendishly difficult task.
Although what I have written can correctly process million-line
real-life projects, every once in a while I come across a construct
that confuses my implementation.
While searching the web for explanations of some of the finer points
of the C standard I came across a reference to an algorithm by
Dave Prosser that the X3J11 (ANSI C standard) committee used as a basis
for the standard's wording.
Continue reading "Dave Prosser's C Preprocessing Algorithm"Last modified: Monday, June 26, 2006 7:15 pm
2006.04.12
Code Quality: The Open Source Perspective
My new book
Code Quality: The Open Source Perspective
got published,
three years after I started writing it.
The book owes more to open source software than any of the books
dealing with Linux, PHP, Apache, Perl or any other book covering
a specific technology.
Continue reading "Code Quality: The Open Source Perspective"Last modified: Wednesday, April 12, 2006 12:05 am
2006.04.03
Efficiency Will Always Matter
Many claim that today's fast CPUs and large memory capacities make
time-proven technologies that efficiently harness a computer's power irrelevant.
I beg to differ, and my experience in the last three days demonstrated
that technologies that originated in the 70s still have their place today.
Continue reading "Efficiency Will Always Matter"Last modified: Monday, April 3, 2006 0:42 am
2005.12.07
If STL Had Been Designed by a Committee
I've been reading on XML schema, and it's embarrassingly obvious
that it has been designed by a committee.
Continue reading "If STL Had Been Designed by a Committee"Last modified: Wednesday, December 7, 2005 3:40 pm
2005.07.19
C++0X Enhancement: Rational Metaprogramming
In a recent article
Bjarne Stroustrup
presented the evolution of C++ toward the 0X standard, and asked the C++
community for ideas regarding C++ enhancements.
This is a proposal to add to C++ support for rational metaprogramming.
Continue reading "C++0X Enhancement: Rational Metaprogramming"Last modified: Wednesday, July 20, 2005 1:19 pm
2005.07.15
C++0X Enhancement: Packaged Libraries
In a recent article
Bjarne Stroustrup
presented the evolution of C++ toward the 0X standard, and asked the C++
community for ideas regarding C++ enhancements.
This is a proposal to add to C++ support for using packaged libraries,
and a standardizing a library distribution format.
Continue reading "C++0X Enhancement: Packaged Libraries"Last modified: Wednesday, July 20, 2005 1:19 pm
2005.02.15
The Efficiency of Java and C++, Revisited
A number of people worked on replicating the results and optimizing
the programs I listed in my earlier blog entry.
Continue reading "The Efficiency of Java and C++, Revisited"Last modified: Tuesday, February 15, 2005 9:42 am
2005.02.10
The Efficiency of Java and C++
I seem to have trouble convincing my neo-Turk students that Java's design makes
it inherently less efficient than C++.
The arguments often and up in an exchange of comments like:
— This (micro) benchmark executes with the same speed when written in Java and C.
— Yes, but a realistic application, like Eclipse takes ages to start up.
— You are only complaining about the cost of the runtime startup
costs and JIT compilation, which are quickly amortized, and, anyway,
Eclipse offers many more features than other IDEs.
and so on.
I therefore wrote a small program to demonstrate the exact problems of
Java's design decisions.
Continue reading "The Efficiency of Java and C++"Last modified: Tuesday, February 15, 2005 9:40 am
2004.11.14
Book Review: C++ Coding Standards
A number of years ago, reading Koenig's and Moo's
Ruminations on C++ [1] I made a wish for more of the
same, updated to reflect current C++ practice.
My wish has come true.
The book
C++ Coding Standards: 101 Rules, Guidelines, and Best Practices
by Herb Sutter and Andrei Alexandrescu [2]
is an indispensable book for all serious C++ programmers.
Continue reading "Book Review: C++ Coding Standards"Last modified: Sunday, November 14, 2004 5:41 pm
2004.07.20
Not All Open-source Systems Are Perfect
I am a big fan of open-source software, and I use many open-source
programs on a daily basis.
Some of my favourite systems, on which I depend, include
the FreeBSD operating system,
the apache web server, and
the vim editor.
I also often use
graphviz,
CVS,
Ghostview,
gnuplot,
LaTeX, and
the GNU C Compiler.
I find all of these systems robust, well documented, and, in many cases,
superior to their proprietary alternatives.
Continue reading "Not All Open-source Systems Are Perfect"Last modified: Tuesday, July 20, 2004 11:09 am
2004.04.18
Computer Languages Form an Ecosystem
(This is a copy of an
article I posted on
slashdot on March 15th,
in response to a discussion titled
C Alive and Well Thanks to Portable.NET.
Many posters argued that the C language is dead.
I add my response here, because one month after its original slashdot submission,
I am still getting web site hits from it.)
Continue reading "Computer Languages Form an Ecosystem"Last modified: Sunday, April 18, 2004 1:10 pm