Rosio Pavoris

Year seriously over now

I got my grades yesterday, so now the year is finally officially over as well. Due to MASSIVE INCOMPETENCE I hadn’t received my grades for last semester yet, so I just found out those as well.
All of it is roughly as expected, with a few exceptions.

Due to shuffling with classes at first and regular indifference later on, I never ended up going to Taalbeheersing (“language control”; basically Dutch grammar and spelling), and 6 out of the 20 points were supposed to be from tests during the semester. I didn’t expect to pass, but I went to the exam anyway because I had nothing better to do.
My final grade was 13/20.

I knew my Technieken voor Datamodelering (Techniques for Data Modelling; SQL plus some theory about ERMs) grade would be high, since I’m reasonably good at SQL (or, compared to most other people in my class, absurdly good) and I actually put some effort into the assignment thing, but my final grade was 19/20, which is probably the highest grade I’ve gotten on anything since 6th grade.
This was also a first-year class (though it was called Systeemanalyse (Systems Analysis) last year, and had a lot more irrelevant wank and no SQL), so it’s particularly funny.

Then there was Netwerken, which was last semester. I went to all the classes and the labs (and even handed in most of my lab reports), and the exam went great, and much of this stuff is things I really enjoy doing (this was also the class with the cryptography things), so I expected to get maybe 16/20, if not more. Turns out I got 11/20.
It’s more than enough to pass and it’s not like I’m shooting for a magna cum laude or anything, but it’s still absurdly and incomprehensibly low.

I didn’t pass my COBOL class. That’s not unexpected (or unintentional), I just thought it bore mentioning.

Interestingly, though, I also didn’t pass my Java class last semester. I got 6/20.
This semester, despite not putting in more effort or actually being any better at Java, I got 15/20, which is the top of my class.
They’re different teachers, obviously, and the one I had this semester was much better, both as a teacher and as a dude to have a conversation with, but it’s still pretty entertaining.

I don’t mind taking another exam to make up for it; it’s trivial to do, and before the exam last semester started he told us the make-up one in early September would include actually writing code on a computer before-hand as opposed to just writing it on paper using his brain-damaged wrapper classes he wrote around part of AWT and Swing because he doesn’t understand how they actually work1.
So I had a look at those questions, since they’ve been only since December, and honestly, they just remind me of why I hated that class. For example (translated from Dutch):

A person has a name, an address (street, number, city) and a phone number. Write a class Agenda that allows you to quickly find the address of a person given their name or phone number. There are thousands of people. In your solution you obviously won’t use arrays, Vectors, or ArrayLists.

Now, we obviously aren’t expected to write our own data structure (that would be too educational much like a real college advanced), and we also can’t use a database, so basically this exercise comes down to guessing which class from the Java standard library he has in mind and then writing ten lines of code using it.
Since this is Java and this guy embodies the clueless enterprise stereotype (IIRC the only languages he sort of knows are Java and C#, and he sucks at Java), there isn’t even a real way to guess what he considers to be a reasonable use of resources (specifically, memory) or time (is five seconds long? I’d say obviously yes, but you never know).

I’m guessing he’s expecting two TreeMaps with different Comparators, but there’s no way to be sure, and it sure as fuck isn’t something I (or anyone else) would consider to be a reasonable solution to this problem.

(To compare, the guy we had this semester gave us some general principles to use every week and let us make up our own problem entirely, on the condition that our solution was a good one for it. This one just makes up crap toy problems and ham-fistedly tries to force library classes and “design patterns” where they don’t belong. And naturally, he requires UML diagrams (syntactically correct, though AFAICT he uses his own private little dialect which isn’t documented anywhere) for everything.)

Tim Minchin interlude.



And now for something completely different.

Wooh vacation.
My parents are going to my grandfather’s sea-side apartment one last time before my uncle buys it to simplify the inheritance (estimated value 525,000 € for just that one apartment, which I’d guess is about twice as much as he originally intended to pay; he already got a ridiculously good deal on the house in Tienen, though), and I think they’re taking my sister with them, so I should have a week or two of peace and quiet (and pantslessness) at least.

My mom also wants to buy a dog before one of us goes out to buy a cat, which should be interesting. I voted for a cocker spaniel (English or American, either one; it’s interesting how much their differences resemble the differences between European and American badgers, if you squint and are drunk), my dad wants a labrador (Spike was half-labrador), and my mom wants a Cavalier King Charles spaniel. Even if it doesn’t end up being a cocker spaniel, I’ll still make an effort to have it named Haskell, though.
It’ll probably be another month before we get it either way. I’d promise pictures, but I keep promising pictures of things and then not delivering. I apologise.


1 There are a lot of legitimate criticisms of AWT and Swing, and I’ve yelled most of them at this semester’s teacher at one point or another, but “it’s too hard for students in their third semester of Java to understand” isn’t one of them.

Permalink 2 Comments

Alright, alright

Two slightly more useful programs, then. For given values of useful.

The first is a basic kopipe manager in C, the source code to which can be found here.
Should work under any real OS. If you’re going to compile it, make sure you change KOPIPE_FOLDER to something more appropriate.
Sample session follows:

cairnarvon@feynman:~$ kopipe
USAGE:
kopipe [name]
	Display kopipe
echo "[kopipe]" | kopipe -n [name]
	Create new kopipe
kopipe -d [name]
	Delete existing kopipe

Current kopipe:
kartoffelbrei  lisp-fig25      progsnake	  tanasinn
lisp-box       lisp-spacetoad  progsnake-classic
cairnarvon@feynman:~$ kopipe lisp-spacetoad
                       //`'''```,
             o        //LISP   `.,
       ,....OOo.   .c;.',,,.'``.,,.`
    .'      ____.,'.//
   / _____  \___/.'
  | / ||  \\---\|
  ||  ||   \\  ||
  co  co    co co
cairnarvon@feynman:~$

It only accepts input from stdin for new kopipe, with all the issues associated with that, so it isn’t ideal (and could probably be done more easily with bash aliases), but whatever.
It’s still nice to have, and it gave me an opportunity to use C.

The second basically mimics this thing. The guy who posted that never posted his source code, so I wrote it in Perl.
This one should work on Windows too.
Sample session:

cairnarvon@feynman:~$ progfind

USAGE: progfind [topic]

cairnarvon@feynman:~$ progfind Xarn

Title:		Xarn [Part 1]
URL:		http://dis.4chan.org/read/prog/1213290157
Posted:		Thu Jun 12 19:02:37 2008
Last Post:	Sun Jun 15 03:19:08 2008

Title:		Xarn
URL:		http://dis.4chan.org/read/prog/1205354504
Posted:		Wed Mar 12 21:41:44 2008
Last Post:	Fri Mar 14 13:46:50 2008

cairnarvon@feynman:~$

Simple but handy. It can be adapted to other Shiichan boards by replacing the URL it tries to get information from.
It can be slow because dis.4chan.org is slow as fuck at times, but it’s still faster than looking through the threads manually.

So. What have you written to make life less aggravating?

Permalink 3 Comments

For the benefit of mankind

/*
 * Copyright (c) 2008 Xarn
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to
 * deal in the Software without restriction, including without limitation the
 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
 * sell copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
 * IN THE SOFTWARE.
 */

#include <stdio.h>

int main (int argc, char** argv) {
    printf("'-._                  ___.....___\n");
    printf("    `.__           ,-'        ,-.`-,\n");
    printf("        `''-------'          ( p )  `._\n");
    printf("                              `-'      ");
    printf(argc > 1 && strcmp(argv[1], "--classic") == 0 ? "\\" : "(");
    printf("\n                                        \\\n");
    printf("                              .         \\\n");
    printf("                               \\---..,--'\n");
    printf("   ................._           --...--,\n");
    printf("                     `-.._         _.-'\n");
    printf("                          `'-----''\n");

    return 0;
}

Permalink Comments

Deadlines

Flash games are interfering with my plans to finish this Java game.
Right now, I have a fully functional, moderately clever, highly configurable Monopoly bot, which is really the most interesting part of the assignment. The rest (that is, the actual game of Monopoly) is just boring details, so it’s not likely I’m going to finish it in time for the Wednesday deadline ever.

Note that this is the same assignment I was originally going to write a tower defense game for, and then a 3D Rubik’s cube, both of which were abandoned after the interesting bits were done (in the former case, the path-finding algorithm for the bots, and an OMG OPTIMISED collision detection algorithm; in the latter, the data structure describing the cube), which counts for 70% of my final grade for my Java class.
Clearly I have attention span issues.

(Exhibit B: the net of a tesseract, constructed out of my grandfather’s business cards. I was going to make a Menger sponge, but I ran out of cards. Procrastination++)

Edit: The deadline isn’t this week. I wrote 2,023 lines of Java and about 300 lines of XML in three days and the deadline isn’t even this week. It’s a month from now. Fuck.

(For comparison, all of Muffins is only about 20,000 lines of PHP, and The Mansion, which I worked on for over a month, is 3,962 lines of C++.)

Permalink 3 Comments

So yes

Christmas and all that.
I got an iPod Nano (though I didn’t ask for one; I just mentioned I needed a new MP3 player, since my old one is a Sony one, and Sony is getting on my nerves; Apple obviously isn’t any better in terms of principles, but at least I can install Linux on it), The Art of Computer Programming, Volume 1, Fascicle 1 (bought because my mom was under the impression it was volume 1, which was a fair guess since it doesn’t even say anywhere on the cover that this is just an update to a single chapter of volume 1, not the actual volume; I don’t know whose idea it was to not label it explicitly, but that person shouldn’t be in marketing), and something purporting to be a chemistry set. Its main feature seems to be “supersnot”, so I question its usability in the manufacturing of high explosives.

Anyway.
I wrote a Facebook application, both because I was bored and because I wanted to see what the Facebook API looks like. Somewhat odd but not terribly complicated, turns out.
Basically all this app does is display your Muffins name and ID and level and avatar in your profile (and optionally your title, equipment, and/or companion as well), and show you a list of friends who added the application and their Muffins names and IDs and levels and avatars.

It’s not terribly useful for Muffins, perhaps, since we only have forty or so active players, and to the best of my knowledge fewer than ten of those use Facebook, but I made it anyway. It would have been handy to have this for something like KoL, but I’m not going to write it, in large part because, to make things simpler, I wrote a script that just queries the game database directly and outputs neatly-formatted code, which the Facebook app interacts with, which I wouldn’t have been able to do without admin access.
For KoL, you’d need an active player session to view player profiles and something to log back in when the session dies because of time-outs or rollover and a parser to extract the needed information and another bit to format that information again and then the whole thing catches on fire and you cry yourself to sleep. So no, not going to do it.

Permalink 1 Comment

Simple Footnoter

Time for another quick-and-dirty WordPress plugin.
Since Emiry likes my footnotes, I wrote a plugin that makes making them a bit easier.

Basically, the idea is that you write [1] (where 1 can be any number), and this plugin will replace it with 1. Then, at the bottom of the post (typically, but not necessarily), you write [f1], and it will replace it with 1. If the latter is at the start of a paragraph, it will also make said paragraph of class “footnote”, which you can then define in your CSS file or what have you to have a different style, if you so desire.

You’ll note that the ID of the anchor tag starts with a random number. This is to prevent (or at least make very unlikely) collisions in IDs if more than one post is being displayed at a time, since that breaks things. Ideally, it would use the post slug for that, but if there’s a way to retrieve a post slug from within a filter, I couldn’t find it in the WordPress API in under two minutes.

It’s not awesomely efficient (it uses regular expressions), or awesomely awesome, but it works well enough.
The code is here; as always, save that as a .php file, upload to your plugins folder, and activate. If you have suggestions for improvement, let me know.

Permalink 1 Comment

Adventures in Telephony



Isn’t software engineering exciting?
Truly, these people have achieved satori.

Permalink 1 Comment

See, this is news

Someone found the original source code for Adventure.
It seems to be written in FORTRAN IV, which I don’t speak, and which, as you can tell, barely deserves to be called a programming language. Still, exciting~

Permalink 2 Comments

Make your own text adventure~

In case anyone’s interested, I’ve stripped the The Mansion code of any game content and uploaded it here. It’s heavily commented to help you understand what everything does.
(Start reading in core.cpp.)

Calling it a game engine would be a bit much, but if you’re new to C++ (but not very new to programming in general) and would like to make your own text adventure, I think you could start from there.
There are a few design decisions that would probably get me a spot on The Daily WTF (or would have, back when they still did code as opposed to just random screenshots and weaksauce stories), but I’d like to think most of them are defensible in light of increased readibility of the code (except for the way generic_actions.hpp works—I should’ve made that into a function and included it once, probably; still, a bit of redundant code never killed anyone, and I can’t be arsed to fix it now).
It’s certainly good enough for small to medium-sized text adventures, anyway.

If you have any questions, feel free to ask. And if you decide to make your own text adventure in it, do let me know.

Permalink Comments

Best programming quote I’ve heard in a while

Learning C is like learning Latin—while not necessarily of much practical use in itself, and viewed as archaic by most, it does provide a solid basis for understanding the countless languages derived from it, and an enormous help for students of those languages.

That’s not actually a literal quote from anywhere, but it’s still true.
Of course, the C-like-Latin meme has existed for a long time now, and many people actually use it pejoratively (one that comes to mind is “Learning C to learn Objective-C is like learning Latin to speak French—unnecessary and a waste of time”, which is also true, I suppose).
Though people are starting to apply it to C++ as well nowadays, which, in my opinion, is bullshit.

Speaking of C++, The Mansion is progressing nicely.
At this point, the compiled game is 337 KB in size, and it’s already possible to unlock all areas except one, which is three more than I intended for the first release. I’ve also added another area, bringing the total up to 31.
All essential functionality is there, though I’m still working out a bug with saving the game—for some reason, it won’t create a savegame file, though if the player manually creates a blank file, it works fine (and loading works fine too). I can’t imagine that’s not a common problem for nubby programmers, though, so my trusty internets should be able to help me out with that.

At this rate, it’ll be another ten days or so before it’s ready to be playtested. The official release should be in about two weeks. Which is two weeks ahead of schedule.
Wooh.

Permalink 1 Comment

Zork and Pie

I was bored, so I decided to write a text adventure. It’s essentially an implementation of the famous Orc and Pie, only a bit more complex.
The parser is retardedly hacky, so I’m not releasing the source code (nobody would learn anything by it, and I know how to write a better one so I’m not looking for specific tips). Eventually I intend to write a proper text adventure engine, which I’ll use to write a more extensive game.

Commands should be intuitive. examine or look to look at things, get or take to take things, inv or inventory to see your inventory, &c.
Have fun~

(To run Java bytecode, you’ll need to have Java installed. Then, navigate to the folder with the .class file from the command line, and just do java ZaP.)

Edit: For those of you who can’t install Java but are running Windows, here is the game in executable form. I’d still run it from the command line, though, because of the way program exits are handled.

Permalink Comments

Damn you, Grace Hopper

<%@ page language="COBOL" %>

Someone thought it would be a good idea to port COBOL to .NET.
And then someone wrote an ASP.NET application in it.

And people wonder why I hate them.

Permalink Comments

Methinks it is like a Dawkins

Perhaps you’re already familiar with the idea behind METHINKS IT IS LIKE A WEASEL; it’s a simple program designed by Dawkins to demonstrate the enormous power of Darwinian evolution. He originally mentioned it in his book The Blind Watchmaker, and gave a demonstration of it in the accompanying BBC programme.
He also explains it in this shorter video (using a different phrase, but the idea is obviously the same):



(Earning that Public Understanding of Science badge. Near the end he also explains the title of another one of his books, Climbing Mount Improbable.)

Because I was bored, I’ve written a similar program (bytecode here, if you’re too lazy to compile) just now. It differs from Dawkins’ original design in a few ways.

First off, there’s only one offspring per generation, and rather than picking the best of the pool of kids, it simply picks the best of the kid or the parent.
Secondly, rather than each letter having a given chance to mutate, it just changes one letter per generation. This slows down the improvements early on, but it reduces the chances of reproduction severely messing up a nearly-correct string (my first test using random mutations took over six thousand generations just to get the final letter right; real evolution doesn’t work towards a goal it needs to get just right, so it’s not under that kind of restriction).
Thirdly, it actually kind of sucks, because you can’t really see it change as it goes. It just dumps data into the output window, and it scrolls too fast to actually follow. Still, you can scroll back a bit once it’s done.

I ran it a few times, and it seems to take about two or three thousand generations (that is, a few seconds; since this is kind of like bacterial asexual reproduction, that’s actually next to no time at all) to get from the random starting string to METHINKS IT IS LIKE A WEASEL. I could calculate how long it takes on average, but I’ll leave that as an exercise to the reader.

Permalink Comments

Blasphemy

RAWRPosting about a dog—a mathematicsing Jesus dog no less—on Caturday? Surely there are laws against that!

Also! Apparently I never posted about lolcode? Look into it. I found out about it a few weeks ago, but I guess I wasn’t posting at the time.
I also wrote a Fibonacci number thing, but due to changes to the language, that isn’t even valid code anymore. Lolgacy, as it were~

Maybe I’ll write a compiler for it eventually. At this point, it’d still just be a simple search-and-replace preprocessor, I guess.

Permalink Comments

Productivity!

Well, not really. I’m writing a game for no particular reason, and it’d surprise me if there weren’t a million games like it already.
It’s a very simple adventure type game, where the player is an adventurer on a randomly generated map populated with monsters and treasure. The goal of the game is to kill all monsters by walking into them repeatedly.
Here’s a screenshot. Or rather, a mock-up of one, since it’s still far from finished.

Epic!

The finished game will have a sidebar with stats and whatnot as well, obviously.

The only thing that might make this worth playing is the custom map feature I intend to implement. It’ll allow people to create their own maps, and populate them with monsters themselves, including custom ones, using player-provided sprites.
The maps will be in XML, following this DTD.

If you know how to read that, you’ll also get an idea of the mechanics behind the game. Pretty straightforward, really.
The only thing that’s not apparent from that is the way treasure works, and that’s just a random permanent bonus to one of the core adventurer stats (hit points, armor class, attack bonus, damage, or toughness), after which the chest disappears. No inventory, no XP, no ranged weapons or magic.

It’s still going to take a while to finish, mostly because Java insists on being a pain in the ass about just opening and displaying an image, but if I ever do manage to finish it, I’ll put the source code online somewhere.
If anyone has any ideas they think would be awesome in a game like this, do let me know.

Permalink 2 Comments

COBOL is a crime against humanity

I mean that sincerely. It’s an incompetently-designed language that should have gone completely extinct the moment someone came up with C (fuck, it should never have been created in the first place; even FORTRAN didn’t suck as much).
It paradoxically manages to be high-level enough to completely lose a feel for efficiency (something even Java doesn’t do), while at the same time not being nearly high-level enough to not be a complete pain in the ass to code in. The only purpose it serves is to teach innocent students bad programming habits.

Apparently they’re taking the hint, though: this year is supposedly the last one COBOL will be taught at the KHL. (You’ll remember they already stopped printing the textbook last year.)
No word yet on what they’ll replace it with. Let’s hope it’s Lisp.

Anyway. Three exams down, three to go.
Have some ELEPHANTS.

:O

Permalink Comments

Blah

So, I’m writing a Conway’s Game of Life thing in Java (not for any particular reason, and certainly not for our Java class; that’d be a bit too advanced for most of our morons), and I’ve come to a few conclusions:

    1. Java is a retarded language made for retarded retards.
    2. Whoever wrote the mouse input class at the KHL wants to keep its inner workings a secret. (I’m not writing my own I/O code if it’s provided.)
    3. It’s actually a lot easier than you’d think.
    4. Flashing colors give me a headache.
    5. 3.2 GHz is a lot of flashing. (I’ve slowed it down now.)

It actually works, but it doesn’t play with users nicely yet. When it gets to the point that it does, I may convert it into an applet and put it online. Probably not.

Gasp!Edit: Screenshot!

When it starts, it first asks for the dimensions of the field (20 by 20 in the picture). You can click in the field to activate or deactive cells, and either just activate it (with the Go! button) or walk through it step by step (with the >> button). The other buttons all do what you’d expect.

The awesome-lookingness is somewhat limited by the fact that it uses a class someone else wrote for the output. No pretty fonts, very limited set of colors, &c.
Still, I’m not going to rewrite something that complex. Especially not since as it is, this thing is already 80% code we haven’t seen in class yet.

If I’m going to convert it to an applet, it won’t be tonight, so don’t hold your breath~
Source is here.

Permalink Comments

Planning ahead

Next of Kin is a really handy WordPress plug-in Terru pointed out to me.
It keeps track of how often you visit your blog, and after a certain amount of time it sends you a warning e-mail. If you don’t visit your blog for another while, it sends you another one. Then, after a third while, it e-mails one or more e-mail addresses of your choice.

Almost nobody on the internet bothers to plan for what’ll happen after they die, and it’s caused some problems before. I’ve already done some planning, but this is definitely a very handy plug-in.

Permalink Comments

Is Assembly programming still relevant?

A few days ago, someone on Slashdot asked if Assembly programming is still relevant today. It saddens me anyone would even ask that.

Assembly, of course, is the very low-level programming language that’s really just a single step above the machine code (that is, the actual 1s and 0s) — most Assembly instructions will correspond exactly to a single machine code instruction, as opposed to higher-level languages, where a single instruction can actually be dozens or hundreds of machine code instructions. It’s specific to a given processor architecture, since you’re directly manipulating registries on the CPU and things.
It tends to be only marginally readable to humans, especially if they have little experience with it. As such, most students tend to hate it when it’s first taught.
But it’s so extremely important.

A lot of people will point to optimising compilers and the existence of higher-level programming languages, as if those make Assembly obsolete. They say Assembly is only still used in very specific niches, so it really isn’t important to know it.

Assembly is actually used in more fields than you’d expect. Drivers tend to be written in Assembly. Embedded systems (like cell phone applications and whatnot) tend to be written in Assembly. Writing compilers (which still happens, for new languages and for new processor architectures) requires an extensive knowledge of Assembly.
Even so, you could argue most programmers won’t ever have to hand-code Assembly themselves. I’m not sure that’s true, but even if it were, it’s irrelevant.

Optimising compilers have, indeed, made hand-coding in Assembly somewhat less important as well.
Consider the following bit of code, in a random C-like language (assume the variables a, b, and c are integers that have been declared and initialised earlier):

a = b * 2;
c = a * 2;

Now, a “dumb” compiler could translate this into machine code that’s equivalent to the following bit in Assembly (I only know x86 Assembly, since that’s the only architecture we get to work on):

MOV EAX, [b]
IMUL DWORD [b]
MOV [a], EAX
MOV EAX, [a]
IMUL DWORD [a]
MOV [d], EAX

(EAX is one of the CPU registers in 32-bit x86. Note that Assembly supports simple variables. They’re really just placeholders for relative memory addresses, and they get substituted when the program is assembled. Variables aren’t typed at all. MOV is a command that moves the contents of a certain register or memory location to somewhere else. IMUL multiplies the contents of EAX with the contents of the argument, and places the result in EAX (and EDX). DWORD indicates it’s dealing with a number that’s 32 bits long.)

Obviously, there’s some redundancy here. The program could be written to do the exact same thing more efficiently in the following way:

MOV EAX, [b]
ADD EAX, EAX
MOV [a], EAX
ADD EAX, EAX
MOV [d], EAX

Depending on what you want the program to do, you could even leave out MOV [a], EAX. The important part is that it gets rid of the redundant MOV EAX, [a], and, very importantly, that it uses ADD, which adds two numbers and is much faster than IMUL. ADD takes a single clock cycle to execute, whereas IMUL takes three or four.
This is a very simple example, but it’s the sort of optimisation early programmers had to do a lot of.

Of course, ridiculous gains in processor speed and aforementioned optimising compilers, which will actually do these optimisations for you more efficiently and more quickly than most human programmers could possibly hope to, have rendered this particular advantage of Assembly programming quite obsolete.
The problem is that many people don’t realise optimising compilers will not rewrite shitty code for you.

There’s one thing Assembly does that no other language can: it forces you to think about how the system actually works.

There’s something to be said for black-box approaches to programming. When you’re working in team on large projects, treating bits of code you didn’t write like black boxes is essentially the only viable approach, and object-oriented programming languages (like C++ and Java) encourage it.
Treating the hardware itself like a black box, though, is just asking for trouble.

If you know Assembly, you will intuitively understand how and why buffer overflows work. You will understand how arrays are stored, and how you should go about manipulating them efficiently. You will immediately grasp the difference between passing a variable by reference and passing it by value. You will get a sense of which functions in high-level languages are the most efficient to use for any given task (which is still important even in the multi-Gigahertz era, much more so than most people are willing to admit).
All of these are concepts that any programmer needs to understand well enough to make use of, but only experience with Assembly will breed a deep enough understanding to use them well.

Assembly makes the difference between a good programmer and a great programmer; or the difference between an average programmer and a code monkey.

Permalink Comments

The Hoo-Ha Monologues

A recent resurgence of interest in The Vagina Monologues of people near me combined with stories like these combined with lists like these combined with a passing interest in tag clouds have inspired me to do some codin’ and produce the Vagina Tag Cloud Experiment.

The idea is that you enter your favorite euphemism for “vagina”, and it stores in a database table somewhere how many times that word has been entered before, and it displays that in a weighted list type of thing.
Mouse-over a word to see how many times that euphemism has been entered. You can enter as many words as you like, and enter a word as often as you like.

Font-size right now is ceil(sqrt($size)*60)%, because I wasn’t entirely sure what to make that. Enter a few terms, to see how it scales.
If you want to make this a proper survey type experiment, tell a few friends!

(I am aware of the fact that the CSS sucks. If anyone wants to write me a new CSS file, feel free.)

Update: I’m not using POST instead of GET. This is intentional. I like the idea of people being able to pass on links like vagina.php?word=hoo-ha to their friends, XSS and CSRF aside.
Maybe it needs a moderation system, where new entries need to be approved first. At the very least, 28 votes shouldn’t be that big.

Updater: Fine, fine, I’m using POST instead of GET. GET now just prefills the form thing, and the words in the cloud are links to the thing with the GET preset.
Font-size is now ceil(log($size+1)*50)%, pending better suggestions.

Permalink 2 Comments