.NET Developers – Burger Flippers?

This is probably old news to a lot of people, but it was new to me so I’m writing about it.

A year ago, the CEO of startup Expensify wrote a blog post unintentionally bashing professional .NET developers. The entire post was inflammatory and insulting to the .NET world, with gems such as the following quote littering the whole blog:

The right sort of person is so passionate about coding, they can’t be stopped from doing it.  They typically started before high school — sometimes before middle school — and never looked back.  They write everything from assembly to jQuery, on PCs to mobile phones, doing hard core computer graphics to high level social networking.  They’ve tried everything.

Everything, that is, but .NET.

You can’t make this stuff up. He goes on to explain that he makes all people with .NET experience on their resume at ALL defend that position during phone screens. He doesn’t see .NET as a “real” platform and that .NET developers just sit in their “McDonalds kitchen” pressing buttons that spit out burgers. He claims that .NET devs can’t adapt to situations (although, he very notably doesn’t give any examples of things .NET devs can’t do, but rather stays in his metaphor or burgers).

Here’s a slightly out-of-context quote:

See, Microsoft very intentionally (and very successfully) created .NET to be as different as possible from everything else out there…

He goes on to make some valid points about Microsoft getting people entrenched in their platform and their tools – but the same argument can be levied against many other companies as well. But regardless, the above quote is a bit laughable when you remember that .NET was originally Microsoft’s answer to Java. And .NET is very similar to Java in many ways. It was intended to be their version of Java, not something “as different as possible”.

The CEO also describes his developers as in a fairly humorous and confusing way:

Instead, we look for a very different sort of person.  The sort of person who grew up cooking squirrels over a campfire with sharpened sticks — squirrels they caught and skinned while scavenging in the deep forests for survival.  We don’t want a short order chef, we want a Lord of the Flies, carried by wolves into civilization and raised in a French kitchen full of copper-bottomed pots and fresh-picked herbs.  We need people who can not only cook burgers, but cook anything, from scratch.

Once again continuing the McDonald’s metaphor, apparently the devs this guy is looking for hunt and cook squirrels. .NET is push-button development but his guys can adapt to ANY situation, since they’re hunters and can cook their own stuff, right?

This drama comes to a close last month, when Expensify publicly began searching for a .NET developer. They definitely acknowledged the hilarity of them looking for a .NET guy after bashing .NET so thoroughly. However, some good questions were raised in the comments. If they need a .NET dev (in this case, for WP7 apps) why can’t their squirrel-hunting devs just get in that McDonald’s kitchen and press that burger button?

The sad part is that most of the professional .NET community was warned, via some high-profile blog postings, to stay away from these guys. That means the people applying will have a higher chance of being those “burger flipper” devs that he was insulting.

How Shadow Explorer can save your ass

Shadow Explorer is a neat little tool I found while cruising around the web. In a nutshell, it is a frontend built for Vista’s Shadow Copy tool. Vista Home versions allegedly do not have a frontend at ALL for this service, while higher end Vista copies do, but it’s not that great.

To use Shadow Explorer you can simply download it from the linked site above. It’s very simple to use – just download, run, and run the resulting .exe as an administrator.

Once open, it looks pretty bare, like you’re missing something or something broke. It probably didn’t. There’s a long thin dropdown at the top that will list out all the dates that there are restore points on your machine for. Select a date, and then you should see a copy of your filesystem (or at least the “protected drives”).

From there you can find files and restore them by right-clicking and then exporting them back to your filesystem. Works like a charm. I just had a situation where I saw a neat little popup saying “Files deleted permanently” and sure enough, some files were gone. Not in the trash, not in any temp directories, nowhere. No explanation. Restored them easily with this tool.

Thanks to Microsoft for Shadow Copy and thanks to these guys for making a way to access it! Shadow Explorer is kind of like backing up your whole harddrive (obviously it’s not a replacement for doing so… but it’s like making a LOCAL backup of all your files).

Make sure before you use this that Shadow Copy is enabled, though. Usually it is but I’ve seen at least 3 people who didn’t due to some errors in their configuration. To check, go to Control Panel, System (in classic view), System Protection, and then in the middle of the screen you should eventually see all your protected drives and unprotected drive. Simply check the drives you want to copy and hit apply or ok. You can also manually create a restore point if you want.

 

Best 6 ways to keep on top of technology trends

Technology trends” is a pretty vague and generic term, but it’s still applicable to many peoples’ jobs. For example, a web developer should know about upcoming technology, even if their company isn’t using that tech yet. Keep up on trends also keeps developers or other technology fields aware of other techniques that might just make things easier for a company. Worst case scenario, it let’s you as an individual know what the rest of the world is doing in case you want to jump ship.

Here are some of the best ways to keep on top of technology in its ever-changing yet totally-interesting glory.

1) Read Digg, Slashdot, and other peer-submitted sites

Sites like digg and slashdot are (or used to be) somewhat unique, in that the content is user-generated. This let’s you know that the information is relevant to readers. Of course, this is only useful if you know the demographics of the readers, but come on. It’s digg and slashdot. You can probably make some fair assumptions here and be right on target.

Reading news stories submitted by your peers is a great way to track trends. You’ll see upcoming technology that’s interesting, and you’ll see criticisms of technology that doesn’t work. In fact you’ll see a lot of criticism, but that’s also very useful, so you’ll be aware of all the negatives of something before jumping into it.

EDIT: Thanks to xionon for pointing out that Reddit is one I forgot to mention, but it is actually much more developer oriented.

2) Check out traditional news sites

By traditional news I don’t necessarily mean CNN and BBC and Fox news and places like that. Although these can be useful tools to learn about technology, most of the time this would be useful only for existing or already on-its-way-out technology, or technology that would appeal to people on a larger scale. This is changing, of course, but that still does hold a bit of truth.

A more relevant technical “traditional news” site might be something more like engadget, or gizmodo. These are traditional because they aren’t peer-submitted, but have their own editorial process to screen content. As such you know that the content coming through is at the very least somewhat well-written, and has passed some sort of screening process related to content so you get what the site advertises.

Of course, it being April Fools Day, those sites are a bit of an exception right now, but usually that’s true!

3) Build a social network of developers and other technical people

Whether this is through AOL Instant Messenger, Gmail, Twitter/blogs, Facebook, Myspace, whatever, building a network of technically-minded friends will really help you keep on top of things. One of the most important – and most fun – aspects of technical work is swapping stories with people who can appreciate your horrible socially-crippling nerdiness and, god forbid, actually identify and respect your inner geek.

Social crutch aside, you can swap ideas, learn new techniques, and hear about technology solutions you’d never have encountered otherwise merely by having friends and talking to them once in a while.

4) Attend conferences

This might sound boring, but go to official conferences. You get free swag, you meet other professionals, and this is a great way to build your network.

Plus, free swag.

It can help you understand a new topic to listen to a speaker who is an expert on the topic, as well. To be fair, it can also confuse the hell out of you, so make sure you’re attending the RIGHT conferences!

5) Join usergroups

Joining a local usergroup (through meetups.com or whatever that site is, or just looking through Yahoo! groups, or Google groups for a tech group) can have many great effects. One of which is free pizza once a week. Another is that you get a group of people, usually wanting to focus on a specific, similar topic or goal. Think of it as a study group for adults.

That said, you might want to tell your girlfriend that you joined a bowling league. If she doesn’t like bowling, break up with her. It’s probably for the best.

One example is in my area, obviously the Boston area, there’s a usergroup that’s been meeting to go over .NET 2.0 and onwards training, in order to get Microsoft certification. Much easier to study when you have someone to ask questions, instead of reading a book, friendless and alone.

6) Ask coworkers

Kind of a lame one to end on, but asking coworkers is often forgotten by many tech people. Coworkers can often have nuggets of knowledge (if I ever write a book I am calling it Nuggets of Knowledge) buried in their brains much the same way a squirrel buries acorns for winter. Spring is here, and you want the acorns of their intelligence. Dig them up!

StyleSheetTheme – the Unsung Hero of .NET 2.0

I had an issue today that was not clearly covered in blogs that I found on the subject, so I thought I would write a little post explaining what the problem is and what my solution was.

My issue was on a .NET 2.0 page. As simply put as possible: Using a Theme was causing my browser-specific css to get ignored.

My Masterpage was using a simple IE-conditional to include css written specifically for IE7 (and another for IE<7). We also had a generic basepage that every page inherits.

 For some reason (and I’ll explain why in just a second) my ie7.css file was just not getting recognized by any of my pages. I quickly checked the source of the page and found that the order of css on the page went: ie7.css in the conditional, followed by all my Theme css files located in App_Themes/Themename/css.

Introduction to Themes 

In case you are new to .NET 2.0 and Theming, the general idea behind it is that you have a special folder called App_Themes. Inside this folder, you can make subfolders. These folders should be the names of your theme, so if you want a blue theme, the file structure would generally look like ~/App_Themes/Blue, and then images and css directories under that.

 Why is this useful? .NET 2.0 includes the ability to set a page directive called “Theme”. At the top of a page, there’s some junk thrown in there by .NET, like MaterPage, Title, etc. You can add to that: “Theme=’Blue'”.

What happens next is that all that css is imported automatically. Presumably as well that css should have a relative path to the images. You can have skin files and all kinds of things in the Theme. The magical part is, if you want, you can also set the Theme programmatically. If this is the case, you could have some kind of Session variable, in theory, that “knows” where on the site you are, if you have different areas, and then set the Theme to the appropriate area. For example a Green area that has article.aspx and news.aspx.

In the Green/Blue example, if you used the same css class names (or even the same css FILE, copied in two different directories) you can literally just swap the image colors and automatically have two completely different looking websites running off of the same exact aspx/cs files.

The best part of Theming this way is that all you have to do in a codebehind is say, literally: “Page.Theme=”Green”;” and you get the Green Theme.

So what was my issue?

The Issue

The Theme css is imported automatically. Anything inside the Theme folder gets grabbed and added to the page in a <link rel=…> tag. This is fine. It’s not what it’s doing, but where. These are added automatically at the END of the head tag, by default. Good by IE conditional statements.

The IE conditional statement is supposed to pull in a stylesheet with extra or different definitions that override the current css in the case of IE. However, with css, the last version of a definition is used by default. So it was like my IE files were not even there.

The Solution

StyleSheetTheme! This is a second kind of theme that differs from the “Page.Theme” version of .NET 2.0’s theme system. (Geez the word Theme is starting to lose all meaning to me at this point… sorry 😦 I didn’t name these things!) A StyleSheetTheme differs from the regular theme in two ways:

1) The way it is added to a page programmatically

2) Where it positions the css on the page

StyleSheetThemes are specifically designed so you can alter the css with other stylesheets. Instead of placing everything last, it places it FIRST. This is incredibly useful for things exactly like browser-specific css files, or small little inline things you may want.

The reason I think so many people ignore this theme type is because of how it is implemented. On an aspx page you can statically declare it similar to the other theme, in the @Page directive, just by saying StyleSheetTheme=”Green”.

Programmatically, though, things are different. There is no Page.StyleSheetTheme. Instead, you have to override a property. That code would look like this:

protected override string StyleSheetTheme

{

           get { return “Green”; }

}

This can happen in the basepage, which makes the most sense, honestly. You might notice that this is also static. Using a variable won’t help much, either, since it’s not executing at preInit or onLoad, it’s a separate method. What you CAN use, though, is a Session variable, as long as it’s not null.

Conclusion

This simple solution saved me a LOT of hassle today. I recommend more people check out StyleSheetTheme instead of Theme, since Theme requires hacks in order to get it to work well with alternate css paths.

.NET 3.5: A LINQ to the Past

With the release of Visual Studio 2008 comes .NET 3.5, the newest iteration of the .NET framework. Unfortunately, .NET users are also greeted with a rise in popularity of the age-old question: Stored procedures or in-line SQL?

I won’t bore you with the details of LINQ (Language INtegrated Query) itself, as nothing can beat Scott Guthrie’s nice introduction on his blog. Something I’ve noticed about these new piece of technology, though, is that debate seems to rage up about how exactly to use it.

 LINQ has the nice ability to eliminate the need for many data layer projects and simplifies everything down significantly. To put it rather succinctly, you have the option to make a database object and call pre-made stored procedures like methods, or perform “in-line” LINQ to SQL commands.

The temptation to use in-line calls is tempting. That eliminates any database work besides initial creation and relationships. No more creating stored procedures and then calling them from code. Everything is contained in one place. You can even view your entity relations from inside of Visual Studio 2008.

However, many people point out that in-line SQL is not very efficient. The database optimizer doesn’t get a chance to be run on the query, not if it’s created dynamically. Therefore, traditionally stored procedures have been the “optimal” choice for database calls.

With LINQ, however, this may not be the case, or at least not as much as would be expected. Visual Studio magazine explains that LINQ can use eager or lazy loading to run its queries.

Eager loading loads up a ton of data at once, entire entities and relations. Lazy loading is a more “on-demand” type loading. What this means in more simplistic terms is that with lazy loading, there are many many roundtrips to the database, each one retrieving a smaller amount, whereas eager loading makes fewer trips for more data.

It seems that with LINQ, the hot topic is performance, and how to maximize it. Ultimately, you will probably take a slight performance hit from switching to LINQ. Is it worth it? That’s the question many many people around the world are asking themselves right now.

There are many methods of optimization, though, like pre-compiling in-line queries and just sucking it up and using stored procedures (which, as I mentioned earlier, can still be added to Visual Studio as methods of an entity object).

If anyone has some comments about LINQ I would be happy to hear them!