some fun with C#

The only problem I had to deal with in my quickie switch from interland to dreamhost was changing the Unit Circle store from ASP pages to something else (I haven’t decided if I’m going to do a Flex thing, a zencart thing or a PhP thing yet). The first hurdle I had to deal with was that the old store used an Microsoft Access database backend. I’ve switched 100% to macs and my old PC was dead, so I couldn’t load the mdb file on my home machines, at work we don’t have the full office license, so I couldn’t use Access on my work PC. I searched around the web and found some shareware that theoretically could convert from MDB files to other types of files, but none that I tried worked very well (if at all). What I did have on my work machine was Visual Studio. On a whim, I opened up the server tab and tried adding the access file AND IT WORKED! I could browse the tables, but there was no way in VS to export them. So I wrote up a quickie C# app, which I’m posting here. Ya know, for the kids.

Some caveats:

  • I haven’t written C# professionally for a couple years.
  • I haven’t added the code to actually grab the table list from the access file and enumerate those. It is left as an exercise for the reader.
  • It doesn’t handle quoted values in table values explicitly (it passes them through, but any CSV importer will get confused).
  • I wrote it in about 20 minutes.
  • In other words, don’t judge my coding skills from this.

Here is the code.

By the way, I had formatted the code using the C# code formatter on Manoli.net which is very cool, but it completely screwed up my blog layout due to the <pre> statements and long lines. So I put it in the separate page.

Did a mock technical interview event tonight at UW (more tips for college CS students looking for a job)

It was actually a lot of fun. Usually when you are doing a real interview, you can’t really take the time or energy to explain to the candidate what they did wrong and how they could improve. Also, I was very impressed with the quality of the candidates. At Microsoft, I interviewed a lot of college grads in the last few years from schools like Berkeley, Stanford, Princeton and other CS powerhouses. Most of those students were pretty weak compared to the students I talked to tonight.

There were a couple pieces of advice I offered to all three candidates. Most of this is only relevant for recent college grads, but some may apply to others as well.

  • Learn more C++. A lot of CS schools like teaching Java. It is fairly good for teaching some of the fundamentals of Computer Science. However, it is still not very popular in the software industry outside of server software. If you are looking to be a developer at a software company, you will almost certainly be writing in C++ and you will have an edge if you can write good C++ in your interview.
  • Practice programming problems. Most software companies that I know (including Adobe, Microsoft, Google and Amazon) do whiteboard-style interviews. You will be given a programming problem and will be expected to write code to solve it. You may also be asked a logic problem. There are many web pages that have actual technical interview questions, you should use them to practice with.
  • Wear appropriate clothing. Unless you are doing software development as part of a consulting company or at a bank or insurance company or something, developers wear jeans. Wear nice jeans, without holes. Don’t wear gym shoes (even cool, expensive ones). Wear a nice shirt. Do not wear a tie or jacket: you will be uncomfortable and will feel out of place. You want to look nice, but comfortable.
  • Be honest about your abilities. Don’t lie about what you know. We’ll figure you out pretty fast.
  • You are not a 9/10 in C++. This is one of my pet peeves and I’ve written about it before.

Now about your resume

  • It should fit on one page. Unless you were working in the industry for years and years, you should be able to fit all your info on one page.
  • Your hobbies and outside interests are not relevant. It is resume filler and will have no bearing on if you get an interview or not.
  • Your job experience outside of the industry isn’t important unless it is relevant to the position you are seeking. If you have relevant or significant full-time job experience (ie: not retail or food service), you should list it. If you were a manager in a non-tech business, that might be relevant if you are looking for a management position, but not an individual contributor position.
  • Put the most important stuff first. People read top to bottom. If the top of your resume isn’t compelling, people reading it won’t make it to the bottom. When I was younger, I used to have my education at the top of my resume, because I didn’t have as much experience. Now my experience is at the top since I’ve been out of school for 15 years. When I look at college grad’s resumes, I look at the school (do I know it?), then I look at their job experience (have they programmed professionally?), then I look at their skill sets (do they know C++?). Unless one of those things stands out to me, I won’t bother looking at the rest.
  • List classes taken which relate to the position you are applying for. I don’t need to know every class you took in college, but if I’m hiring a graphics programmer and you took 3 undergrad classes and a graduate seminar in computer graphics, I want to know.
  • Think about keywords. Most resumes come in electronically now, via a company’s website. There they go into a database. When a position is opened, recruiting will do a search on their database looking for keywords: C++, graphics, windows, etc… Make sure that your resume will be found in those searches.
  • Target your resume to the position you are interviewing for. This could be a lot of work, but it is worth it. You may not need to change everything, but at least change your objective. If you are applying for a lot of jobs, you may want to make different versions of your resume for different classes of positions. I have three different versions of my resume which emphasize different skillsets depending on what kind of job I am applying for.
  • Don’t write a wishy-washy objective statement. I’m kinda over the whole “Objectives” thing on a resume. Obviously, you want a job. Everyone wants “a challenging position with an interesting company, utilizing their skills and allowing growth potential.” Yawn. This is the one place where it really is important to tailor your resume to the position you are applying for. Especially, if you are moving from one area (QE) to another (Development).
  • Use good ideas from other resumes. The Microsoft Word resume templates are not your friend. Everyone knows them now. Luckily, you kids have this thing called the interwebnet which allows you to find a zillion resumes and look at the best ideas from each. Everytime I see a good idea from a resume (a better way of listing experience, a more consise way to describe skills), I see if it is something that can help make my resume better. The actual graphic design and layout of my resume grew over years, incorporating ideas from a dozen other resumes. (Please do not directly steal the design of my resume (I’ll make sure that you’ll never work in this town again), but feel free to incorporate some of the ideas for your own).
  • Have someone you know, someone who actually knows how to write well, go over your resume. Engineers are not known for their command of grammar, punctuation or command of the English language. You only need to look at this post to see what I mean.

If other people have more suggestions, I’d love to hear them.

Dear Microsoft Entourage Team

I h8 you.

Sure, I have a lot more e-mail than most folks, and I understand that performance might be affected by the quantity, and for the most part Entourage still works pretty good with 200,000+ email messages (except where it hangs for 15 minutes at a time while it is doing something once in a while), but when I actually try to do the good thing, and start deleting mailboxes full of messages, it isn’t cool for you to hang there, deleting 40 messages an hour for HOURS. So, now I gotta delete messages in small batches so as not to upset whatever delicate balance there is in your poorly written software.

I guess the Entourage software interview process doesn’t include corner cases, huh?

[Update 2.24.07- Macworld finally provided a fix]

Interview tip for young C++ developers

I’ve been interviewing a lot of young devs lately and I’ve got a good tip for the inexperienced job hunters out there…

You will probably be asked by a prospective employer how you would rate yourself as a C++ developer on a scale from 1 to 10. Do not rate yourself a 10. In fact, if you rate yourself higher than a 4 or a 5, you are just asking for punishment in an interview if you get one at all. Bjarne Stroustrup is a 10, you are not. (If you don’t know who he is, you aren’t even a 4) I’ve used C++ nearly every day for 15 years and I’m constantly learning new things about the language. Saying that you are a C++ expert when you have had no experience is saying that you don’t know very much about the language.

So take a lesson from Uncle Kevin and don’t be afraid to be honest when you talk to the recruiter or interviewer, ’cause if you come off like an idiot, you’ll never get the job.

A good IDE

is worth its weight in gold…

Now, this should be obvious, but it isn’t until the day you are forced to use a crappy IDE. When it comes to software development, I’m from the old school. Not the old, old school of punch cards and dip switches, but the newer old school with command line building and debugging through printfs. I’ve realized that I have become soft in my advancing years.

I’ve spent most of the last 11 years of my career doing my development in Visual Studio (and its earlier versions). Now, I’m fairly platform agnostic as a rule. During that time, I’ve also written software for Linux in Java and the Macintosh as well. Eclipse and VisualAge were decent enough IDEs that I didn’t feel hampered. However, the leading IDE on the mac until recently was CodeWarrior. CodeWarrior has an long history. It’s been around for a long time and you would think that as development environments go, it should be one of the best considering it became the main development tool for Mac OS development. I have no idea why though. It sucks. I mean, it really sucks. At first I thought it was just the shock of the new. I was just having to adjust to a new environment, but no, I’ve been using it for 18 months now and I still hate it.

Luckily (or unluckily) Apple is basically forcing all those who want to write software for OS X to switch to XCode. I’ve only just started using it, so my observations are premature. In general, it seems quite good and well designed. It does have some significant quirks and weirdness though. Apple seems really interested in making it better, so here is hoping…

A classic example of crummy software testing

Microsoft unleashes a poorly tested version of windows media player on the macintosh audience

I have to put in a little disclaimer here. I worked on the Windows Media Team for (PC) version 7.

That said, tonight I tried to install the newest version for the macintosh, version 9 onto one of my macs. I installed it through a non-admin account (I didn’t want it in my account), it seemed to install ok, except that it didn’t give me an option of where to put it and it demanded the admin password. When I try to run it from this account, I get a “you do not have privileges to run this application” error. I switch to my admin. All the ownership and execute attributes on the application are fine. I can run it from my admin account just fine (remember that I didn’t even want to be accessible from any other account), but in this lower permission account I can’t run it. Even though that is the account I installed it from.

Now this is, of course, a bug. A bug I have caused myself in the recent past. It is also a very easy bug to fix and a very easy bug to find if you are testing your product. It is testing 101 and one of the first things a good tester will catch. An important note is that the WMP for mac wasn’t developed in the Mac BU during my time in Windows Media, it was part of the Windows Media Team. This might explain why the quality might not be up to the Mac Office standards. MSN suffers from this problem too, I’ve heard.

Bugs get through, it happens. There is no excuse for something this obvious to get through the cracks though. Especially in a politically sensitive area for Microsoft like this. Microsoft needs to improve their quality on non-windows platform for their media player if they expect it to be any sort of real web standards. Until their quality gets better, I’m going to bug the websites I view to embrace a real cross platform video format like Flash, or Quicktime.

sometimes Carbon makes me cry

the woes of cross-platform C++ development

Carbon is Apple’s APIs that were created for developers who had been writing for OS versions before OS X. Apple really wants developers writing in Cocoa (just as Microsoft wants to developers to write in .Net), and they couldn’t make it more clear to those of us who are using Carbon. While being fairly feature-rich, it is overly complicated and poorly documented. Every company I have ever done professional software development with (which includes several of the top companies in the world) does development in C++. Cocoa doesn’t work with C++. It uses ObjectiveC, which means (like .Net) that you can’t easily write portable code for Cocoa. Apple is going out of their way to make it hard to port apps to their platform and should wake up and support C++ for Cocoa.

ACLs

want to know why Windows is so easily hacked?

As technologies progress and our devices are ever more networked with each other, security in operating systems has become increasingly complex. This complexity makes the systems themselves less secure because it is harder for developers to understand it. So the OS vendors add complexity to deal with the fact that applications are doing security wrong which creates a vicious cycle.

Are you a windows developer? Do you understand ACLs? Maybe you do, but most likely you only think that you do. Why? Because they are somewhat complicated. “What, I can explicitly grant permissions for my network printer to access this file?” Microsoft doesn’t make it easier. The documentation in MSDN is near useless. The web isn’t your friend here either since a lot of the websites I’ve found when looking for more info were just wrong.

I was working on a nasty file-permissions problem in a project that I was working on which necessitated a move from old-style file permissions code to ACLs. Now, I’ve been developing professionally on Windows for over 10 years, and I thought that I understood ACLs. Nope, I just thought I did. I spent days studying the web and writing test programs to figure out how to give the appropriate permissions to a single file. Luckily, I had an awesome tester who could break my stuff in ever more increasingly complicated ways, otherwise I probably would have shipped something that either didn’t always worked or was just a crazy security hole.

I realized that if it was that hard for me, what about all those less experienced or rushed developers currently shipping applications for Windows? The majority of developers inside of Microsoft probably don’t understand ACLs as well as they should. Is there any wonder why there are so many security issues in Windows?

The answer isn’t further complexity, but better documentation and education. This is critical stuff for Microsoft and 3rd party developers. It is time that Microsoft treated it that way.

I haven’t reviewed the ACL implementation in OS X 10.4 yet, but I shuddered when I heard that it was being added.

The difficulties of cross platform development in a Microsoft world

Cross platform development was never simple, but it could be simpler if Microsoft decided to support some standards occasionally

Now, I’ve been responsible for at least some of the Microsoft APIs inflicted upon developers, so I take some responsibility here. I don’t expect that Microsoft should have X Windows or Display Postscript or anything. I do expect that if I use standard C functions and the STL that they will at least work somewhat the same across platforms. That is too much to hope for when working in the wild world of internationalization it seems. Microsoft uses MBCS encoding for multi-byte encoding of char *s. This is a Microsoft-only thing that is the result of some dev way back when and is still foisted upon the world even though there is a much better standard called UTF-8. While I understand that Microsoft needs backwards compatibility for legacy applications, since they have already have a second set of APIs for Unicode, how hard would it be for them to support UTF-8? Actually, somewhat difficult, since Microsoft uses a different directory separator from the rest of the world that also doubles as an escape character for certain Japanese characters. If you have Japanese support on your XP machine, you’ll know what I mean already. However, this lack of UTF-8 support not only makes it difficult to port apps to Windows, it also makes it difficult to develop applications for multiple platforms. Microsoft already is forced to support UTF-8 for the web, XML and documents. It is about time that it works in C and the STL just like on all the competing operating systems.