switch ( Math.Sign(q.answer-42) )
{
case 1: q.left(); break;
case -1: q.right(); break;
case 0: Foo.Bar(); return;
}
Archive for the ‘Uncategorized’ Category
Poetry
Posted by Dan Byström on October 26, 2005
Posted in Uncategorized | Leave a Comment »
dev112
Posted by Dan Byström on July 4, 2005
| I speak of none but the computer that is to come after me, A computer whose merest operational parameters I am not worthy to calculate. And yet I will design it for you. | ||
|
— Deep Thought |
Now I know exactly how Deep Thought felt. I’m not worty to hang out with these guys, yet somehow I am. 🙂
(The rest of this blog is in swedish, if you don’t understand swedish but would like to, I recommend you take a crash course in swedish.)
Vi kommer att starta upp under sommaren för att komma igång ordentligt till i höst. Under kommande vecka kommer vi att börja med "Veckans tips", vilket antagligen kommer att bli en sanslöst heterogen läsning med tanke på allas olika bakgrund och intresse. Lita t ex på att jag inte kommer att tipsa om SQL (mitt tips i frågan är som alltid: nej 😉 samtidigt som vi har riktigt tunga SQL-experter med i gänget.
Posted in Uncategorized | Leave a Comment »
Nine While Nine
Posted by Dan Byström on May 22, 2005
This week I attended the Nordic Software Developer Summit, or NorDev 2005 for short and I’m back with a lot of impressions and mixed emotions.
Listening to and seeing Jimmy Nilsson and Eric Doernenburg doing "pair programming" while demonstrating TDD (Test Driven Development) was one of the more inspiring experiences. When I later talked to Eric on the evening I noticed I got a little dizzy, assuming it was from the wine and hunger. But I later understood that the real reason was because he informed me that doing pair programming means that you ALWAYS are two programmers in from of one computer. Not just occasionally as I had thought. This is an almost incomprehensible concept for a lone wolf like me. But I see no reason not trusting him on this one. Therefore, I just got dizzy.
The three speeches in a row on SOA may have been just great. However, with not a single line of code in sight, they were not the thing for me. I consider my goal to be cranking out code that works better and are easier to use than my customer had dared to hope for (that’s my goal anyway) – not trying to tell them what they need, by drawing nicely looking diagrams describing their business processes and make them say "ahh!", "ooh!", "really?" and "we didn’t know that!". Other people can do that.
Listening to David S Platt’s talk on Web Service security was indeed very entertaining, but he pulled off such an embarrassingly large number of jokes about sexually frustrated geeks, that I arrived at the conclusion that surely it takes one to know one.
Johan Lindfors from Microsoft demonstrated what’s to come in Avalon and the impact it will have on today’s GUIs can probably be compared to going from gray dull dialog boxes to cool web pages in the late 90’s. But remember: just because someone shows you a GUI that is so cool that your brain gets drained of blood, DOESN’T MEAN THAT THEY KNOW HOW TO MAKE EVEN A TINY HELLO WORLD PROGRAM TICK. It is like assuming that someone being good at airbrushing cars is just as great at building engines.
I consider myself, for a programmer that is, to be really good at GUI issues, but most probably, the graphical skills required to make use of Avalon’s full potential will bring me to my knees.
The world also turned out to be small as always. At lunch I sat down beside a couple of guys I’d never seen before. When I asked them were they were from, I found out that they work less than a 100 meters from my office in Växjö (460 km away).
I regret not leaving the .NET track in favor of the Java track and listening to Rickard Öberg’s speech on AOP (Aspect Oriented Programming) though, which was great I’m told. But until I learn of any good AOP tools for the environments I’m working with, I guess I can live without knowing more about it anyway. It would be just like waving a candy bar in front of a child and not letting it take the candy.
Finally I really must say I don’t agree with the expert panel’s conclusion that choosing between .NET and Java would be a "religious thing". It shouldn’t work that way for professionals. I’d use Java any time a customer wanted me to and/or it would look like it was the best choice. I’d use Fortran or Cobol on that same ground also (although I’d probably not be their best choice for a job like that).
| It’s a poor craftsman who blames his tools. |
I traveled by train. On the way up the train was 55 minutes late. On the way back I tried to rebook my ticket to an earlier train because I got away an hour earlier than expected because I found Dino Espositio’s speech on ADO.NET totally uninspiring. SJ refused to rebook my first class ticket because I hadn’t paid for the most expensive flavor of it. That’s exactly in SJ’s spirit of aiming to be one of the worst run companies ever seen. Come on, their tickets are more expensive than the cost of driving the same distance by car (with just one person in it) or by airplane??? I mean, flying is almost pure science fiction, while running train along pre-laid out iron bars can be (and obviously are) done by idiots.
Goodbye train! Hello airplane, here I come!
Posted in Uncategorized | Leave a Comment »
Still alive
Posted by Dan Byström on April 19, 2005
…although my absence from here might have lead you to believe otherwise.
The answer is simple: I have way too much work for finding the right "blog mode".
I’m working on an exciting project (in C#) where I’ve come up with a number of interesting things to write about in the future, when I have more time. For example, a vast amount of new GUI UserControls, as well as an interesting solution for synchronizing data between clients by using direct socket communication instead of bogging down the database.
Posted in Uncategorized | Leave a Comment »
Happy New Year
Posted by Dan Byström on January 3, 2005
…to all you out there. Especially to my six(!) subscribers on Bloglines – whoever and wherever you may be.
Although Joel on Software, with almost 8,000 subscribers doesn’t need any promotion, I simply must quote this:
| I don’t care how much you know about continuations and closures and exception handling: if you can’t explain why while (*s++ = *t++); copies a string, or if that isn’t the most natural thing in the world to you, well, you’re programming based on superstition, as far as I’m concerned: a medical doctor who doesn’t know basic anatomy, passing out prescriptions based on what the pharma sales babe said would work. — Joel Spolsky |
Well spoken, what can I add to that? Maybe just the plain observation that in these days when security issues become increasingly important, the above statement is a prime example of code vulnerable to the "buffer overrun" security attack. OK, that was just a lame attempt trying to show off.
Hope we’ll all get a great 2005!
Posted in Uncategorized | Leave a Comment »
With Zwei.Drei.Vier.Links()
Posted by Dan Byström on December 1, 2004
In preparation for a continued discussion of how a language could assist us in checking for null references, I’ll state what I see as drawbacks with the With-statement in VB (or Pascal for that matter, where it has its origin). Eh, say that again? Well, it’ll become clear later on.
In VB6 I used With a lot. In the world of COM it was not merely a convenience, but also an optimization technique, since the programs ran faster when calls to AddRef/ReleaseRef were reduced. In .NET that’s not an issue anymore.
Anyway I still miss it in C#.
Consider the following piece of VB code:
With Customer(42)
With .Order(3)
.Lock()
Process .Order(3)
Customer(42).Update
.Unlock()
End With
End With
Never mind the object names or why you’d like to do exactly something like this. I’m only interested in the implications made by the With statements. We can observe that:
- We can only have one “active” With at a time, so nesting them won’t help us access the outer With. Nested Withs also makes the code hard to read.
- If we have the need to pass the “withed” (I don’t have a better name) object down to a method (like the Process method in the example above) we have to reevaluate the “withed” object.
- Entering a With block with a null/Nothing reference is completely and utterly useless, yet it is allowed, and the exception won’t occur until we try to access the first method/property of the “withed” object.
Given those drawbacks, it may be understandable that the With statement wasn’t made part of the C# language. I think 1) and 2) are quite obvious, but 3) is more my own personal reflection and something I want to improve upon!
What if we could overcome all three issues? Stay tuned…
Posted in Uncategorized | Leave a Comment »
Clarifying
Posted by Dan Byström on November 22, 2004
Jimmy Nilsson posted a blog the other day that I’d like to comment upon.
Do you expect a Volvo car salesman to tell you that a Saab is best for you?
Do you expect your bank’s economical "advisor" to recommend that you invest your money in another bank? Obviously not, yet they are allowed to call themselves "advisors"!
Do you expect the folks at Microsoft to recommend using something that’s not built in-house? It really happens from time to time, but I find it equally surprising each time.
Posted in Uncategorized | Leave a Comment »
Stupid is as stupid does
Posted by Dan Byström on November 10, 2004
…as Forrest Gump’s mother used to say.
Last week a large number of people did something stupid (59,017,382 persons to be exact). Analysts say that it was “moral values” that settled the outcome. To understand this, it may help to recall that “the land of freedom” was built by religious fanatics, outcast from England three hundred years ago. Just slightly more than ten generations ago!
| Morality is simply the attitude we adopt towards people whom we personally dislike. — Oscar Wilde |
I would otherwise have guessed that the main reason for the outcome was that when fearing terrorists, you would probably feel safer when lead by one, just as companies today hire hackers as security guys, I mean.
But a much simpler explanation exists: US Election 2004 Results Listed by Average IQ.
Time for a little quiz. Who has said “The homosexual agenda is the greatest threat to our freedom we face today”?
- John Cleese, in the Spanish Inquisition sketch
- Adolf Hitler
- Usama bin Ladin
- Tom Coburn, republican senator of Oklahoma
No prize for guessing the answer, but don’t miss to locate Oklahoma on the average IQ table.
Posted in Uncategorized | Leave a Comment »
Pirates of the crabwise …
Posted by Dan Byström on October 10, 2004
I’ve written an application called PurmoMaster (its current incarnation is called PurmoMaster 2003 and a PurmoMaster 2005 will probably follow) for a company called Rettig Heating. PurmoMaster is used to calculate heat loss in buildings and then to find exactly what radiators is needed to correctly heat a building. PurmoMaster is given away for free and the obvious reason is that it will only suggest radiators from Rettig’s product line (there is still 2000 radiators to choose from). Rettig wants to keep track of their customers in order to inform them of product updates, new prices etc. Therefore a user must register a mail address on Rettig’s web site and is then given a license code in return, which is all that is needed to run the application. Simple.
I just googled for PurmoMaster 2003 and found the most amazing thing. A cracker group has TAKEN THE TIME to create a key generator for a FREE PROGRAM! According to their web page, this heroic deed has been performed by two master minds using the nicknames absolut and oktan. Their parents must be proud.
(As a side note: IF the program WAS NOT free, this would have been useless anyway, since Rettig would immediately spot a pirated version once the customer placed an order, but that’s another story.)
Apart from being a good story, this is also tragic. If people can spend their time doing things like this (with absolutely no gain what so ever) – what chances are there that a “real commercial” application should ever be left alone?
Posted in Uncategorized | Leave a Comment »
Choices Rule (pt I)
Posted by Dan Byström on September 20, 2004
(continued)
I will pick up the thread from where my previous blog ended, but not by continuing with more C++ or .NET. Last time, I tackled a problem in a somewhat disturbing way – by solving it according to familiar rules instead of a new and probably more interesting way. Not at all the usual me, I hope.
I’m not sure if you’re familiar with the concept of Choice-based vs. Rule-based people. It was a complete mindblower when I first read it some 15 years ago. It was pinned on our notice board at work so I kept going through it in my mind whenever I saw it. While the article text may take some time to settle, it will then, among other things, explain the strange fact that some people have absolutely no interest in knowing why (you know the "we have always done it in this way!" reply). You may also have wondered why your users don’t always jump up and down in excitement over your latest radical improvements of your software. I’ll refrain from extending this list of examples and from telling you about real life happenings although it’s tempting. Discover this on your own. The gentleman hosting this article has, by the way, done his own thinking. Someone taking the time to explain to people the beauty of Fibonacci numbers in nature may be worth reading.
Looking at my quotation of Jimmy Nilsson in my previous blog, you can immediately tell that he’s a choice-based person. In fact, all decent programmers MUST be, right?
I’ve been thinking long and hard about this topic and I’ve now begun to question that people can be divided into just being rule-based or choice-based. I’m convinced there is a whole spectrum in between. Not only that; I also think that the same person can behave differently depending on a given situation: being rule-based in some circumstances as well as choice-based in others. I’ll outline my reasoning in a later blog where I will argue that this spectrum can be written as a function of three variables ("personal abilities") for a given situation.
| In this world, there are two kinds of people: Those who divide people into two categories and those who don’t. — unknown |
It was once said to me that if a scientist and an engineer both walk a path and encounter a large boulder blocking their way, then the engineer will try to find a way around the boulder while the scientist will try to find a way through the boulder.
While not a striking analogy, it is still easy to understand. While my sympathies go to the scientist, I must confess myself to the engineering group. I have discovered that I actually work best under constraints – trying to find ways to bend them to my own advantage. That’s what most programmers are up to each day, I guess. We try to find ways around limitations like too little memory, too little screen estate, algorithms that won’t run fast enough and most of all, limitations in the tools and languages we use. The better we can bend these rules, the better programs we may write. That’s an engineer’s point of view. The scientist on the other hand is busy removing the constraints altogether.
Is it rule-based or choice-based to play by the given rules, when you come up with ingenious new solutions to trick your way around those constraints/rules?
(to be continued…)
Posted in Uncategorized | Leave a Comment »
