Linus Has Spoken

I was reading a recent article (“Real Men program in C”) recently, and came across a link in the comments to Linus Torvalds’ opinion on the whole C-vs-C++ thing. Let’s just say he doesn’t mince words. (This is an excerpt, but it captures the flavor of the original post.)

What Linus said.

C++ is a horrible language. It’s made more horrible by the fact that a lot of substandard programmers use it, to the point where it’s much much easier to generate total and utter crap with it. Quite frankly, even if the choice of C were to do *nothing* but keep the C++ programmers out, that in itself would be a huge reason to use C.

In other words: the choice of C is the only sane choice. I know Miles Bader jokingly said “to piss you off”, but it’s actually true. I’ve come to the conclusion that any programmer that would prefer the project to be in C++ over C is likely a programmer that I really *would* prefer to piss off, so that he doesn’t come and screw up any project I’m involved with.

C++ leads to really really bad design choices. You invariably start using the “nice” library features of the language like STL and Boost and other total and utter crap, that may “help” you program, but causes:

– infinite amounts of pain when they don’t work (and anybody who tells me that STL and especially Boost are stable and portable is just so full of BS that it’s not even funny)

– inefficient abstracted programming models where two years down the road you notice that some abstraction wasn’t very efficient, but now all your code depends on all the nice object models around it, and you cannot fix it without rewriting your app.

In other words, the only way to do good, efficient, and system-level and portable C++ ends up to limit yourself to all the things that are basically available in C. And limiting your project to C means that people don’t screw that up, and also means that you get a lot of programmers that do actually understand low-level issues and don’t screw things up with any idiotic “object model” crap.

Posted in Coding, Humor | 1 Comment

Random Thought Of The Day

I wanna know:

Why does Windows’ Task Manager list the size of the “System Idle Process” as nonzero? Also, why is it different, on different computers? My desktop apparently takes 16K of memory to do absolutely nothing, while my laptop (memory hog that it apparently is) takes 28K to do just as much nothing-per-second.

Now, I know 16K or 28K is a drop in the bucket these days — my laptop has 2GB of memory and my desktop has 3GB* — but honestly, why should doing nothing be anything more than a line or two of assembly?

* Yeah, 3GB. Not only does the 32-bit version of WinXP not always play nicely with 4GB of memory, but Core i7 processors have three memory pipelines, rather than the more understandable two or four. (Maybe Intel decided they liked Google’s “Don’t be evil” and decided to go with “Don’t be normal” or something. I dunno.) At any rate, Core i7s like their memory in threes. Go figure.

Posted in Coding, Humor, System Administration | 1 Comment

A step in the right direction

Well, that would explain it…

The reason that the quadruped robot was doing the “funky chicken” instead of walking smoothly was mostly due to a major bug in the gait angle calculations. The angle of the leg is the sum of the “shoulder” and “knee” joint angles — but the angle commands to the knee servos weren’t taking the shoulder angles into account. This caused a really inefficient, jerking motion, rather than the relatively smooth gait that was intended.

Oops.

It’s fixed now (and has a new chassis and circuit board). The video shows it moving more-or-less in a straight line, but with a few modifications to the gait tables, it can turn, at least in shallow circles.

Next on the list:

  • Rubber tips for the feet
  • Improvements to the turning routines
  • Turn-in-place functionality
  • Reverse (basically, just run the gait tables in reverse order)
  • Wireless control
  • A second microcontroller to handle control and communications

Posted in Coding, Digital, PIC Microcontrollers, Robotics, SIGMA Walking Robot | 1 Comment

Walker robot progress

Well, it moves. The gait algorithm is still handcoded instead of evolved (I’m working on finding a physics sim I can use for that), and is less than efficient — but at least it’s going in the right direction. The plan is for it to eventually be a hexapod — maybe even with three degrees of freedom per leg — but for now, it’s a 2DOF quaduped. Once it’s walking reasonably smoothly and efficiently, the plan is to make it remotely controllable and embed a video camera — probably using XBeePro modules (from SparkFun, where else?).

The version in this video is still based on a cutaway plastic project box; it has since been moved to a proper chassis produced on the 3D printer. This doesn’t yet do much for the gait, though.

More about the robot as the design evolves…

Posted in Coding, Digital, PIC Microcontrollers, Robotics, SIGMA Walking Robot | Leave a comment