7 comments

[ 3.5 ms ] story [ 25.7 ms ] thread
I used to do it by hand.
Me too friend
There was that time I was finishing up my PhD thesis and had written a Monte Carlo integration that computed the volume of an energy surface in a 6-dimensional phase space.

I wrote the first draft of the program in Java, it wasn't really fast enough, so I wrote a second draft in C that used a bunch of performance optimizations, most notably it applied a coordinate transformation to the phase space that meant the probability of a point being inside the surface was much higher than it was before.

The program was really a lot faster but most of the gain came from using better algorithms, the factor I got from C might not really have been worth it. I wrote that program in my own dialect of object-oriented C.

Apologies to Greenspun:

“Any sufficiently complicated C program contains an ad hoc, informally-specified, bug-ridden, slow implementation of half of C++.”

It's amusing how the times have changed.

Back in 2002, you couldn't get a job unless you wrote "object oriented code" in your resume.

Nowadays, state is evil (pun intented) and OO is the naughty child - "Bro, do you even write functional?", yet no one writes haskell (neither do I).

Seeing articles like these for 2006 trying to shoe-horn Objects in C is amusing!

This is not a nostalgic post about the gool ol' days, today we know so much more about what works and what doesn't in large applications. State _is_ bad and should be encapsulated. Pure functions are your friend. Objects... egh. We don't talk about objects, we refer to them as "this guy".

(comment deleted)