This Blog Has Moved!

My blog has moved. Check out my new blog at realfreemarket.org.



Your Ad Here

Saturday, August 22, 2009

Are All Of Microsoft's Software Engineers Idiots?

In my current wage slave job, my boss made a very bizarre claim. "The people who wrote most of our software used to work at Microsoft. I used to work at Microsoft. Therefore, our software is awesome."

Superficially, that makes sense. Regrettably, that is not true when actually observing what they're doing.

The tactics of writing software for Microsoft are *NOT THE SAME* as the tactics that are appropriate in a small startup.

Working for Microsoft is probably a lot like working for NASA. At NASA, software is given a super-detailed specification. At Microsoft, there's also usually a pretty detailed specification. When writing Windows, the primary goal is to make it the same as the last version of Windows, with some enhancements and bugfixes. When working at a startup, you don't always have a clear direction.

NASA is a direct State-backed monopoly. Similarly, Microsoft is a State-backed monopoly. At NASA, the managers' primary goal is to have software that works, and to avoid looking stupid. There's no penalty for inefficiency, because the cost is passed on to taxpayers.

Similarly, Microsoft's primary goal is to have the next version of Windows mostly work. If there are bugs, then John Hodgeman will be ridiculing Microsoft for a couple of years. Even if Microsoft pays 100x more than necessary when developing Windows, the cost is passed on to customers as higher prices.

At a startup, when you only have a couple hundred users, if there's a bug you just fix it. It doesn't pay to add extra overhead to the software development process. With a web-based product, it's very easy to rapidly fix any problems.

A software engineer at Microsoft is much more like a State bureaucrat, rather than someone trying to get stuff done at a small startup.

There's a bunch of things my employer is doing that makes me say "WTF?" Regrettably, it's probably better to work with what they already have, than to try to fix it.

They wrote their own http server in C++. That would have made sense 10-15 years ago. They could have saved a lot of time just using Microsoft's server. I doubt their webserver is better than Microsoft's or Apache.

They wrote their own string classes and string manipulation libraries. That makes no sense at all. Why not use the classes that come with Visual Studio?

They wrote their own build tool. They aren't using Make. They aren't using Visual Studio's build tool. Their own tool is inferior to both of them. Both Make and Visual Studio are smart enough to only rebuild files that have changed since the last compile. Their build tool always recompiles everything.

I tried setting up some Visual Studio workspaces/solutions and projects. They're using bizarre compiler options. I couldn't get it to match. I'm going to have to look through the source code for their build tool, in order to figure out exactly which flags are being passed to the compiler.

I'm working on a Windows desktop application to help people who write content for the website. Was it written in C# or .NET? No. Was it written in MFC? No. They're using direct win32 API calls! This application was written last year! What kind of fool does that? They were working for Microsoft! They should have learned something better than using win32 API calls!

They even wrote their own dialog classes and control classes, built around the win32 API calls. Essentially, they wrote their own version of MFC.

Regrettably, the fact that everything is written in low-level C++ is bad for me. First, it's obviously a stupid design. Second, it doesn't solve my primary career problem, which is "All of FSK's experience is considered obsolete." At least I have a job for now.

They could have used ASP.NET or PHP and had a better website written in 1/5 the time or less.

Another bad habit from Microsoft is the code review. So far, all the code reviews I've ever participated in were demeaning and pointless.

Here's an example of a criticism my boss had of my code.

I wrote:

for (i=n; i>0; i--)

He demanded I change it to:

for (i = n; i > 0; i--)

For those of you who can't see the difference, he made me add spaces around the '=' and '>'. My reaction was "WTF?" Of course, I'm a wage slave and I complied with the crazy demand. There was a whole bunch of stuff. He made me rename my classes and variable names to conform with "Hungarian notation". Microsoft doesn't even use Hungarian notation anymore! Modern compilers with context-sensitive help make Hungarian notation obsolete. He demanded I change

if (bTest)
return false;

to

if (bTest)
{
return false;
}

He also demanded I change

if (bTest)
{
return false;
}
else
{
// ... more code
}

to

if (bTest)
{
return false;
}
// ... more code

He also had a bunch of recommended changes that affected my program's actual logic. I managed to convince him to not insist on them.

He was complaining that I wasn't checking for errors, in a code segment that couldn't possibly lead to an error if the algorithm were implemented correctly.

Performing a nitpicky code review allows him to superficially seem like he's managing me. He may say "I made FSK rename his variables the way I insist. Therefore, I'm a good manager." I doubt he checked or understood the actual logic of what I was doing.

This is a bad habit that he obviously picked up at Microsoft. It might make sense on a team of 100+ people. With 3 software engineers, it's obviously stupid. It would have been better for me to move on to the next feature, instead of renaming all my functions and variables.

In some programs, they're using their own collection of flatfiles instead of a database. I tried explaining the merits of a database, but they didn't get it. There are some places where they are using a database. I suggested adding some new tables for my new feature, and they didn't get it. They were afraid that adding new tables to the database would break something.

It's amusing how a software engineer at Microsoft has learned bad habits that are damaging when working at a small startup. "Write your own string library, http server, and database!" may make sense if you're writing Windows. It's a waste of time at a small startup.

If I told you what branch of Microsoft they worked at, you would say "ROFLMAO!!" If I told you, it'd give away who they are. They claim that they were among the better software engineers and program managers working in their area.

Anyway, their software is good enough for what they're doing. They have about 100x more code than they actually need for their simple website, but at least it runs. I should be able to maintain it and make the changes they want.

My job is "good enough for now". It doesn't solve one of my big problems, which is "All of FSK's experience is considered obselete!" They're only using low-level C++ and win32 API calls. They wrote their own custom C++ code for everything, but at least it runs.

My employer's biggest risk is "Will they generate enough revenue to justify the investment made?" and not "Will the code for their website run?"

It's amusing to notice the attitude "We used to work at Microsoft! Therefore, we write great software!", and compare that to what they're actually doing.

7 comments:

Anonymous said...

FSK, actually your boss sounds like a pretty cool guy. Microsoft notwithstanding, not using bloated libraries and writing your own tools, even if they are 'inferior', is GREAT. Saving data in files instead of a database? GREAT.

You see, multi-megabyte libraries and stupid tools like make and databases and giant web servers are statist tools. It takes a department to maintain a database, keep track of updates and licensing changes. It takes a team to keep a webserver running. Learning even a simple old-fashioned set of arcane MFC calls takes a year, and even then it does not make any sense and you have to look up which messages are Windows and which are faked by MFC. It's great for government projects. You might as well just learn the Window API (that's what everything else calls anyway in the end).

So maybe you 'reinvent the wheel' by writing a string class, but at least you know what it does and how it does it. It is actually very much in line with what you preach in the non-tech world - it is not full of shit, simple and understandable. Anything else promotes large corporations, intellectual property and turns you into sheep.

As for nitpicky style, I am a bit sloppy, but I understand wanting all your code to look similar. When you debug someonelse's code, you really feel it (why is this asshole putting spaces here?).

Anyway, keep up the good work.

Master Doh-San said...

"Performing a nitpicky code review allows him to superficially seem like he's managing me. He may say "I made FSK rename his variables the way I insist. Therefore, I'm a good manager." I doubt he checked or understood the actual logic of what I was doing."

Unfortunately, you've just described about 90% of all "managers" in America.

Maybe the most telling part is that he's trying to "manage" you. One does not "manage" people. One manages manpower -- which is a resource -- but one must lead people. Unfortunately, there is too much management and not enough leadership in this country.

CorkyAgain said...

MFC is just an earlier version of the Rails stuff FSK dislikes so much. Both of them impose limits on what you can do -- unless you write a bunch of convoluted code to circumvent those limits. In order to know whether FSK's new employers made a mistake in not using MFC, we'd need to know whether their project is the kind of thing MFC was designed to produce (as opposed to the kind of thing that has to be forced into the MFC paradigm.)

Same goes for the other libraries/tools mentioned. Was the decision not to use them completely arbitrary, or were there sound engineering reasons they had to "roll their own"?

Even in today's web-oriented software world, there are projects where using the Win32 API and C/C++ is the right choice.

I wouldn't recommend converting to Visual Studio project files. That locks you into one vendor, and given Microsoft's past behavior, it's very likely that your project files won't be supported by future versions of VS. But make is stable and predictable enough that writing your own build system is just silly. (I don't agree with anon when he implies that make requires a team to support it.)

Did they also roll their own version control system?

Anonymous said...

Ok, your code and the corrections are textbook examples of bad C form.

if (bTest)
return false;

should be at least
if (bTest)
return false;

Your boss has a point - although you don't need braces, when debugging, you might not notice and do something like

if (bTest)
printf("I am here\n");
return false;
instead of
if (bTest) {
printf("I am here\n");
return false;
}
With braces it will work fine as long as you are inside the braces. Without, you are screwed.
------------------------------------
Your boss is right about the else clause being unnecessary and convoluting the logic.

Of course, you should just never, ever return from the middle of an if clause if you are programming in C/C++. It is not a question of stupid style, it is very hard to debug code that willy-nilly returns out of the middle of a loop. If you know the entry and exit points, you are much faster at debugging.

If you like that sort of thing, you are much better in assembly, Forth or even BASIC.

Anonymous said...

Writing good software requires creative thought and intelligence. It is case of knowing where to draw the line. In some circumstances something is good, it other cases it is not really important, there are other things that are more of a priority.

Does the software actually work? Do the users like it? What does your gut instinct say to do?

I've worked in a number of companies and in software for a very long time.

It never ceases to amaze me that although software is mostly about mental processes, there seem to be quite a lot of idiots working in software.

Maybe these idiots get promoted into management to stop them wrecking the codebase, but then they wreck things at a different level.

Anonymous said...

It appears that blogger strips the tabs and spaces in the text. It does not let you use the pre tag either. It's hard to say what the code looks like...

Anonymous said...

The comments about braces seems like pretty small beer to me.

I usually use explicit braces even for just 1 statement.

Then sometimes if I want the code to be compact, I don't use braces to wrap just 1 statement.

Quite frankly I think people that define programming as knowing when and when not to use braces as a bit silly.

Have you come up with a novel algorithm? Is your software head-and-shoulders above the competition? Do users love your software?

Is the application you are writing a run of the mill user interface backed by a database or something much harder such as a compiler, novel 3d graphics engine etc?

Small things for small minds.

Aren't there more important things to think about?

Can't you boss think of anything more profound to comment on?

This Blog Has Moved!

My blog has moved. Check out my new blog at realfreemarket.org.