in which pi implies things through juxtaposition

Apr 15, 2012 01:01

Until you can tear and burn the bible to
escape the EVIL ONE, it will be impossible
for your educated stupid brain to know that
4 different corner harmonic 24 hour Days
rotate simultaneously within a single 4
quadrant rotation of a squared equator
and cubed Earth. The Solar system, the
Universe, the Earth and all humans are
composed of + 0 - antipodes, and equal
to nothing if added as a ONE or Entity.
All Creation occurs between Opposites.
Academic ONEism destroys +0- brain.

I often wonder what it's like to be Gene Ray. He's an coot/crank and would probably make a good career politician, if it weren't for his website.

Some people were angry that my last rant contained swears and sounded too much like "abloobloo i hate php". (*bleep*k you too, Danny! ♥) It was over the top, yeah. That's what other people come here for.

So, I've been busy enough with work. Most of the code base is a pleasant thing to work with, and even to maintain, but there's also a surface sheen of oily muck and a couple of hairy bottomless pits (by 'oily muck', I mean the sort of thing that, left untreated, will eventually evolve into one of the latter). I have, for better or for worse, dealt with bugs in both areas, and the occasional bug in the oil-laden waters floating above a bottomless pit to hell. My brain has been kinda broken because of this.

When I accidentally introduce a bug that manifests itself by breaking a feature that I'm pretty sure nobody even uses, it's all of these, at the same time. This kind of thing tends to be introduced in the process of fixing something else, and that other broken thing is nearly always worse. As a case in point, a change I made to the grimble parser made it stop coring, and also made it inaccurately track the location of foos coming from the server, which ended up breaking a certain type of dsfdsfdsf. Really, the right fix here would be to remove the useless feature (along with fixing the parser), but that's a significant amount of work across several minefields: Grimbles, dsfdsfdsf, and foos are some of the hairiest parts of the code. And then there's removing it from the interface, and the one person who uses it will complain to hell and back if it goes away. So the feature stays; the next time I break it while fixing something else, I'm going to start insisting that it at least get moved to a 'legacy shit' module (even if it means I have to create that module on my own).

Other bugs manifest themselves as individual hairs attached at the skin, collecting little parasite bugs that all stem from the same problem. I have a few of these, too. Some of them I got by being the most recent person to stumble in and say "Oh, christ, this needs to be rewritten", but other ones I've staked out on my own. Getting assigned this kind of bug is occasionally an effort in debugging the human responsible for it - hooo boy, human factors. In most of these cases, the actual issue is that some part of the design is flawed. Sometimes significantly, sometimes not. houdini_cs once said that computer science is really just "drawing the right boxes and lines on the whiteboard" - usually the right boxes are drawn, but the lines connecting them are wrong; sometimes they're the wrong boxes entirely. Luckily the overall outline is sane, and it's just one small level that has a problem. Reconnecting the lines so things work right is often an exercise in history as much as anything else; the complaint is frequently 'it worked in an earlier version', and I can use some kind of differential analysis (made possible by version control tools) to determine what's wrong. When the boxes are wrong, I might have to wipe the fucking whiteboard clean, and draw new boxes.

There's a data structure I'm working with that's laid out in memory sorta like this:
. .
. .
. ! .
0000 | data_length |
| name_length |
| pool_length |
| data |
0004 . # .
. $ .
. % .
. * .
00da | 'n' |
| 'a' |
| 'm' |
| 'e' |
00de | 0 |
| 'p' |
. 'o' .
. ~ .
. } .

The way this is declared in C involves a flexible array member, which is interesting trivia but not exactly the point. Existing code that works with this sort of structure needs to be able to find the beginning of each chunk-that-we-know-the-length-of. I prefer to see just length-prefixed strings, but sometimes it's convenient to transmit null-terminated strings. If you do this, the only sane thing is to count the null byte in the length. Further, do not make people perform length calculations over and over: there should be interface functions like char *get_f_name(struct *f). Ideally, we want some kind of fast binary parser, but...

"The genius of the Unix pipeline is precisely that it is constructed from the very same commands used constantly in simplex fashion. The mental leap needed to see this possibility and to invent the notation is large indeed." - Dennis M. Ritchie.

Don't think of web applications as needing to 'sanitize' their data to get it between, e.g., SQL and your data. Instead, think like this: "SQL placeholders prevent such attacks by ensuring that the query is submitted as-is to [your dbms], which then parses it and applies the arguments. This approach ensures that the arguments are treated strictly as data."

I said this to three people; two of them (Alice and Bob) have taken programming classes, and two of them (Alice and Carol) understood the analogy:
Say I want to express the idea of 'recursion' to you. The most natural way for me to do this is with a computer language; the most terse way I can possibly phrase this is: "ones = 1 : ones". (I am giving you the Duplo blocks, and when I have answered your question about what the hell that means, I can give you some Legos.)

That defines a function which recursively makes an infinite list containing nothing but the number 1, so if you try and say "give me the value of that function", it'll print out [1,1,1,1,1,1,and never stop. Also it so happens that in this particular language (I'm talking about Haskell, for the record) it is easy to say "give me the first 10 elements of a potentially infinite list".

If you still don't get the analogy, you might want to think of the Duplo blocks as working like this. That will either hopelessly confuse you, or hopelessly enlighten you.

Another time, I was explaining the problems I was working on at work:
Take a bolt, right? It's like someone's cross-threaded the right-size bolt into the right spot†, and instead of backing away and lining the thing up right, he reached for the wrench‡.

The daggers mark occasions where the person listening winced. the double dagger means 'twice as hard'. When you write programs, think of me describing your code to someone this way, then reread it. If you read your code and wince, consider rewriting it until that feeling goes away.

I think my summary here is: I spend a lot of time (perhaps too much) thinking about how people think, and then mapping it onto the behavior of state machines exchanging messages. It's pretty a interesting and somewhat practical way of viewing (and debugging) the world. Also, a lot of people can be driven into easily predictable states, and everyone leaks more information than they expect. I swear to use this power of observation and communication for absolutely no good whatsoever.

philosophy, code

Previous post Next post
Up