Thursday, February 21, 2008

Addendum to Up a Level


I think I'm going to start
a series of programming books called "What the fuck does this mean?"

I will be a co-author.

I will sit in a room with an expert programmer. I will hand them a basic tutorial question and they will write out a small response. Then they will hand it back to me.

Then I will scream "What the fuck does this mean?" And I'll hand it back to them.

They will re-write it. And hand it back to me. And I'll scream again. This will continue until I'm satisfied that what they have handed me is a coherent sentence and not some recursive brain-melting word problem.

The whole book will be written in this manner.

I may have to escalate to electric shocks during the process.

Up a Level


I think I've figured out
that my difficulty with programming isn't the programming language itself, it's the specific syntax used to describe the language.

Every language builds up its own specialized syntax. Even when there are common terms the implementation of those terms can vary wildly.

I'm looking at Python again. Figured I'd give it another go. Fine.

This, for example, is mostly gibberish to me:

"The actual parameters (arguments) to a function call are introduced in the local symbol table of the called function when it is called; thus, arguments are passed using call by value (where the value is always an object reference, not the value of the object).

When a function calls another function, a new local symbol table is created for that call. A function definition introduces the function name in the current symbol table. The value of the function name has a type that is recognized by the interpreter as a user-defined function. This value can be assigned to another name which can then also be used as a function. This serves as a general renaming mechanism."

The tutorial hasn't mentioned local symbol tables. Call by value hardly makes sense since they haven't explained anything about an object reference. It's useless to me.

And this kind of shit is everywhere in "basic" tutorials. None of this syntax is the same in any programming reference I've ever seen. It even changes when you start talking about language variants or special extensions or "wrappers," whatever the fuck those are.

Not to mention that most beginner tutorials in Python do everything through the interpreter. This is, I guess, supposed to make things easier. But if you try to put the same stuff into an IDE text panel and then Run it from there, none of the examples work properly. Variables aren't initialized or you can't return a result from something something. No explanations whatsoever.

The tutorial starts so easy, too. Here is arithmetic. Here is a while loop. Oh, now here are twenty kinds of functions that won't work outside of the interpreter. No, we aren't going to explain any of the specific terms in use.

This is pretty much every programming tutorial I've ever read. It's like going to Cambodia thinking you have at least a conversational grasp of the language and suddenly you're confronted with a few thousand local dialects that sound almost nothing alike.

Bleh.

Monday, February 18, 2008

Request


Can any
of my older/more learned readers recall the names of any of those classic programming magazines? The kind of thing that would feature little snippets of BASIC code and simple algorithms. I'm still toying with roguelike stuff and it's tough to get a grasp on things. There are a few reasons for this:

1. The old code is in very old languages. Not only can they be very hard to understand but the implementation may be so vastly different that it won't be useful with a newer language.
2. The newer/maintained code has grown incredibly complex and fragmented. You have to understand every single part if you want to extract even one piece of it.
3. Some of the really inventive, new stuff isn't open-source. Both Incursion (which has a very robust implementation of the d20 SRD in it) and Dwarf Fortress (which is mind-boggling) are closed-source with no apparent plans to open-source. I don't think Dungeon Crawl Stone Soup is open-source, either.

Any suggestions?

Sunday, February 17, 2008

Avoiding Homework


I've got homework to avoid
, so I'm going to suggest some answers to a question posed by Unfettered Blather and backed up over at Man Bytes Blog.

The question at hand is: "Now, please explain to me why future weapons will have less options than weapons available today?"

With pleasure.

1. Technology implementation is not consistent across any culture. The things we use everyday do not correlate with the most advanced tech. In addition, often the most advanced tech can only be used at great expense and only rarely. Why do most firearms still use combustion technology that has been around for at least 700 years? Why isn't caseless ammo standard? It isn't a question of can you implement a technology, but can you mass-produce it, will it be reliable and can it be made for least cost (both labor and materials)?

2. What does Faster-than-light travel have to do with military weaponry? Seriously. Our submarines use nuclear reactors that allow them to stay submerged for months at a time, but that has nothing whatsoever to do with the grunt in the field. Not only is implementation not consistent, but neither is advancement. There are often limits on knowledge that are not immediately apparent.

Most military organizations are conservative when it comes to changing tactics or adopting new machines. Patton was laughed at for championing the usefulness of the tank in World War I, and yet it became a pivotal weapon in the next World War.

3. All those fancy attachments don't necessarily make the weapon better.
Consider the M203 grenade launcher attachment for the M-16. First, you can't fire the rifle when the grenade launcher is attached. This is because it uses the barrel as a place to build up gas pressure to launch the round. Second, you have to reload after every shot and, even though it's a grenade, you can still miss. Third, you need extra training to use it and even more training to use it well. The M203 uses a leaf sight, which is only accurate if you know what you're doing, and even then you have to account for wind, recoil and other battlefield conditions.

Think about this: The M16A1 service rifle had the capability to go fully-automatic. The current service rifle, the M16A2, does not. This is because allowing full auto led to grunts spraying rounds without regard to where they went. It wasted ammo, weapons deteriorated faster and was less effective in combat. This is one of those clear-cut instances where fewer options actually resulted in greater combat efficiency.

4. In addition to specialized training, attachments require their own special maintenance. Yes, let's give everyone a laser sight. How long do you think that's going to last, crammed into a grunt's pack with sand and dirt and an entrenching tool, thrown into the back of a Humvee and dragged along the ground as the grunt low crawls into position? An improperly maintained and calibrated scope is less useful than half-decent iron sights. And if you can count on anything, it's that any equipment you send into the field will not be properly maintained or calibrated.

Here's a funny story. The Marine Corps was looking for a new pack to replace the ALICE pack, a canvas bag with a metal frame that's been used in one form or another since the 1970s. So a company came up with a super-advanced pack that was ultra-light and waterproof and modular with a durable plastic frame. The pack went through the company's own rigorous testing and then it was released to select infantry units.

The damn thing fell apart. The grunts rejected it 100%. The vaunted super-tough material ripped in a day's time after normal field punishment. The plastic frame snapped. The modular pieces got lost all the time. Despite using "advanced" technology, it was worthless.

5. The two most important characteristics an infantry weapon needs during a ground invasion are durability and ease-of-use. The weapon shouldn't break and any idiot should be able to get steel near a target. Every time you add an extra function to the weapon you make it harder to maintain and more difficult to use.

6. Fancy toys don't beat unit cohesion, smart tactics and solid weaponry. Look at our current state of affairs in Iraq. We have plenty of fancy equipment at our disposal and it doesn't matter. Even if we outfit every grunt with a computerized tactical HUD, auto-targeting weapons, thermal scanners, etc., it wouldn't do a damn thing against an IED stuffed into a coffee can.

So the short answer is: Maybe those options exist but aren't worth the negative factors of implementing them.

Or it could be game balance, I guess.

---

As a small illustration of my point, Rainbow Six Vegas has lots of cool options for each weapon. There's thermal vision, different kinds of scopes, silencers, firing modes and laser sights. Every time I'm in a firefight I have to take the time to sort through all the options available while I'm responding to real-time threats. For every time one of those fancy doodads is useful there's another time when it ruins the assault.

The laser sights tip off the enemy to your location. The 6x scope limits your vision. The thermal vision picks up all hot objects in the area. Full-auto has uncontrollable recoil.

Which means that there are plenty of times that I try to get all fancy when just shooting from the hip or going to iron sights would more than suffice.

I end up at the Reload Last Checkpoint screen a lot.

The Ground Went Sour


This falls under
the category of Ancient Pointless Trivia.

The movie "Pet Semetary" isn't horrible for a Stephen King adaptation. In other words, it's not a good movie but it's not the worst, either.

But the setup is terrible. This guy moves into a house in the country. There is a road nearby. Big rigs zoom down this road day and night.

Why didn't he notice that when he was looking to move into the house? Why doesn't he build a fence? Why doesn't he put a leash on the cat? Why doesn't he put a leash on his child? Why did he move into such a dangerous house anyway? Why can't he get a county ordinance passed to stop the trucks? Has Stephen King never heard or Business routes?

I know, I know, there wouldn't be a story without trucks barreling down the road. Not to mention that Stephen King and ham-handed plots are pretty much synonymous.

This one just feels a little sloppier than others.

Still, it's not the worst Stephen King story with murderous trucks. That honor goes to "Maximum Overdrive."

Friday, February 08, 2008

The Perils of the Digital Age


One of the big drawbacks
of companies merging is that suddenly you have one less way to recover your account should something go wrong.

Last year my Yahoo account suddenly rejected my password, the password I've had for years. The auto-sign in would show me mail going to my account but it wouldn't accept the password. Yahoo wanted every single last bit of information from when I opened the account, over ten years ago. Fuck them.

Well tonight I wanted to get into my Flickr account. Oh, whoops, Yahoo merged with them, so I can't access that, either. I can no longer access pictures of myself online. I hate these people. All the correspondence to Yahoo basically ends with, "Sorry, but we need information you entered ten years ago which, even if it were accurate, you probably don't remember anyway, like what your zip code was when you registered."

If anyone wants to take a crack at hacking my yahoo or flickr account, the account name is Thothanon. The password is anybody's guess.

---

I guess the real lesson in this is that using the internet for things that are even mildly important is a very stupid thing to do unless the service you are using has a real physical location. Otherwise you'll get cut-and-pasted answers back from customer service reps who barely even read your complaint. They won't be able to deviate from the company line even if you're willing to send them a photocopy of your ID and birth certificate.

---

Update: This is actually kind of funny. Yahoo must have closed my account or something, because it no longer recognizes my account name. But the Flickr account still exists. The only way to sign in is with a Yahoo ID that no longer exists. I hate the fucking internet sometimes.

Thursday, February 07, 2008

What?


I just saw
a commercial for Lost Odyssey with "White Rabbit" playing throughout.

It's fucking horrifying and probably the weirdest attempt to create an association between two completely different media creations I've ever witnessed.