Application Development
A little bit about me and my .Nettyness
by Joey on Oct.13, 2008, under Application Development
I am a .Net developer. What does that mean?
One important bullet item to mention, is that it means all of my applications are restricted to running on the often made fun of Windows platform.
To all of those Windows haters out there I have two words for you. Suck It! Windows is a great operating system and if it weren’t, then it would have gone the way of OS/2…whatever that is.
Now I know what you are thinking. Here’s another closed minded developer that went with the first thing to give him a non female generated boner. You’re half right. I gave Java a bit of a chance at one point in my career. Sure the language is great and yes it runs ANYWHERE. My problem with the word anywhere is that it smokes weed with the word EVERYWHERE. Do I have time to learn every friggin Java framework out there and every possible server setup or configuration in order to broaden my job possibilities? Hell no I don’t. I have more important things to do like have sex with my wife and drink Makers Mark. Grant it I really don’t know what I’m talking about but that’s cool because neither do most of the people I know so no biggie.
I chose .Net because let’s face it, all I have to do is search for .Net jobs and have my pick of the results. I know what platform the apps will run on, I’m pretty sure the data will be managed by MS SQL Server and I know the framework. Do I fear challenge no, I do however enjoy familiarity. With every new project comes challenge so I’m all set in that department thanks. Do I own Java and Ruby books? Hell yeah! Why? Because I’m a friggin nerd and a lemming. I see my friends getting interested in stuff and blindly follow along. Is this wrong? Hell no! That’s how they ended up liking this shit.
I originally intened this post to be a wonderfull description of my current OSX / Windows development setup but it seems to have turned into a rant about what I do for a living and why I do it. My bad.
Take from this what you will and remember, we can’t all be as cool as Milo in Antitrust.
if(joeyGreen is Earthling) joeyGreen as Human; Introducing my new friends ‘is’ and ‘as’.
by Joey on Jul.07, 2008, under Application Development
There are two C# operators I probably should have known about a couple of years ago that have recently come to my attention.
I would like to introduce you to my new friends ‘is’ and ‘as’.
I’m sure most normal C# developers are already familiar with these two lads but I am not in that group of smart peeps and feel that it’s my responsability to share my new knowledge with the rest of the slow geeks out there.
I first saw the ‘as’ operator being used in my Pro LINQ: Language Integrated Query book and sort of assumed it was new as of the .Net 3.0 framework as I had never heard of it. Shortly after that I noticed the use of ‘is’ and ‘as’ in some code here at work which prompted me to ask a coworker how long they had been around. Apparently both of these operators have existed since .Net 1.1
According to the MSDN documentation, “is Checks if an object is compatible with a given type. An is expression evaluates to true if the provided expression is non-null, and the provided object can be cast to the provided type without causing an exception to be thrown.”
Very simple and super useful for checking object types prior to casting them.
For more information go to:
http://msdn.microsoft.com/en-us/library/scekt9xw(VS.85).aspx
Now on to my new pal ‘as’.
The Gods of MSDN say that “as is used to perform conversions between compatible reference types. The as operator is like a cast except that it yields null on conversion failure instead of raising an exception.”
For more information go to:
http://msdn.microsoft.com/en-us/library/cscsdfbt(VS.85).aspx
I really love these operators and methods that actually return a value you can check as opposed to just causing your application to hurl exceptions all over the place.
One of my other new favorite methods that deserves a shout-out here is the LINQ SingleOrDefault() method which returns null if a record is not returned by your query. One thing to keep in mind though with SingleOrDefault(), it will throw an exception if more than one record is returned.
Thats all I have for this episode of “Hey I get paid even though I don’t know what I’m doing.”
Join me next week when we go over HTML, whatever the fuck that is.