Posts

Showing posts from 2012

JavaScript I Can Live With

Update 10/2016 - This posting is better viewed in my new blog . I've never been a fan of JavaScript. Not because of the language itself. Syntactically it's a lot like C# (which I love) and functionally it provides a wealth of features for web programming. My issue has always been with actually writing the code. Due to the fact that JavaScript isn't statically typed it's difficult to create truly good tooling and it's always felt to me like programming JavaScript in notepad is almost as good as with the best IDE. In my book that makes it a very cumbersome language to work with for all but the simplest applications. After working with C# for the last eight years and experiencing the power that a statically typed language and a good IDE provide I find it very painful to go back to a language that doesn't. Maybe I'm just spoiled but going back to a language like JavaScript makes me feel like I've moved back in time a decade. Enter TypeScript. TypeScrip

Implicit Type Conversion and Arrays

Update 10/2016 - This posting is better viewed in my new blog . I came across something I found sort of interesting a week or two ago. I had an array of integers that I wanted to use in populating a ComboBox for a tool I was working on. I started to call the ComboBox.Items.AddRange method which simply takes an array of objects. To my surprise I received the wonderful "The best overloaded method match for 'System.Windows.Forms.ComboBox.ObjectCollection.AddRange(object[])' has some invalid arguments. Hmm, strange. Doesn't everything in .NET derive from object? I quickly opened my favorite playground console application (where I do most of my quick coding tests) and starting poking around with objects, object arrays and how type conversions between them works. First I performed a sanity check: int i = 5; object o = i; Sanity confirmed. No complaints from the compiler. Integers can indeed be implicitly converted to objects because they inherit from object. Now

Visual Studio 2012

Update 10/2016 - This posting is better viewed in my new blog . I installed Visual Studio 2012 about two weeks ago and I've been spending time experimenting with it whenever possible. I have to admit I had more than a few doubts about VS2012 going in. I disliked how Microsoft removed all colors from everything in the UI and the accents like the ALL CAP menus and the use of strings of colon characters for emphasis. I have no idea who made some of these design decisions but they were NOT made with input from the current user base regardless of Microsoft's protests to the contrary. When the beta debuted a couple months back the overwhelming top request from developers was to fix the monochrome color scheme. Microsoft went a little way towards resolving that issue by adding just a splash of color to some of the glyphs (aka icons) but the UI is still terribly bland. The first thing I did after installing was to switch to the Dark color theme. It took me a little while to get use

ClickOnce For My 2 Cents

Update 10/2016 - This posting is better viewed in my new blog . Let me be clear; I love Microsoft's ClickOnce. I've found it to be an absolutely fantastic deployment methodology for many scenarios. It allows developers to create full featured applications and deploy them to end users with little or no pain. Essentially ClickOnce allows for a thick client application to be deployed as easily as any thin client. The core product of the company I work for is an enterprise finance and billing suite for local governments. In 2004 we began migrating our application to .NET developing under version 1.1. We implemented the primary client layer as a WinForms applications and its initial release consisted of roughly 150 assemblies. Historically Windows client installations had always been a significant paint point for our customer's internal IT staffs and therefore for us. During early R&D efforts for the new .NET application we were intrigued by a feature being called &q

I have a dream.

No not "that" dream. The dream I've had for several years concerns the future of my personal computer. I envision a time when my "PC" is really just my smart-phone except that it'd have a fully functional desktop OS and everything digital that I need. I want to do away with simultaneously maintaining a mini-computer phone, a desktop computer at home and a laptop for work. I want an all-in-one device with docking stations at various locations that provide additional horse power as needed. For example, I use my home computer largely as a gaming device, so at home I might have a powerhouse graphics card, better sound, more RAM, additional CPU power, an HD monitor and peripherals (mouse/keyboard). I'd still need to maintain hardware at each location but my OS would remain constant along with my installed applications and all my files. Anywhere I went I'd have ALL of my data on my personal OS installation. No more installing the same application on severa

Browser Wars

Update 10/2016 - This posting is better viewed in my new blog . My first experience with a "browser" was Mosaic around 1994 in the Washington State University computer labs. I viewed it as a novel and somewhat intriguing toy but I wasn't overly impressed. Within a year I was sitting in a physics lab on the WSU campus browsing early web sites with Netscape and my head was fairly spinning with the implications of what I was finding openly available to anyone with a connection. Little did I know reality would soon far exceed my wildest imaginations. By 1997 I was attending graduate school at Oregon State University and the web was starting to become what it is today. I used the WWW every day and Netscape was the browser of choice for myself and almost everyone I knew. At that time Microsoft was in all kinds of trouble over Internet Explorer's OS integration and I thought of them as something just short Satan incarnate. Despite that stance I was using IE exclu

Documentation? Oh my.

Update 10/2016 - This posting is better viewed in my new blog . I'm at work near the end of a long day. I spent almost the entire day writing documentation. As a developer I understand the absolute necessity of good documentation but good lord it's boring to write. I do derive a certain satisfaction out of a job well done when it's complete but it's so very painful during the process.

Silverlight, oh how I'll miss thee.

Update 10/2016 - This posting is better viewed in my new blog . I've fought it. I've kicked and screamed. I've ranted and raved. But all to no avail. It's over. Silverlight is dead. More's the pity. If only it could have gained more traction. If only Apple, Google and the other unknown forces would have adopted change more readily. But no, it's to be HTML/JS/CSS when it could have ALL been XAML backed by C#. You win anonymous forces. You've forced standardization of an inferior model. Thanks a lot.

That pesky enum (part 2)

Image
Update 10/2016 - This posting is better viewed in my new blog . This is part 2 of my previous  That pesky enum post.  You should read part 1 first.  In part 1 I defined the enum Beers and a static class BeersMockEnum and illustrated their use. Now, I make modifications to these types by inserting a new item (Bitter) in the Beers enum and the BeersMockEnum class as follows. public enum Beers { IPA = 0, Bitter, Lager, Porter, Stout } public static class BeersMockEnum { public static int IPA { get { return 0; } } public static int Bitter { get { return 1; } } public static int Lager { get { return 2; } } public static int Porter { get { return 3; } } public static int Stout { get { return 4; } } } I then recompile only the ClassLibrary project (which holds these definitions) and deploy the newly compiled assembly to the run directory replacing the existing ClassLibrary.dll but not the existing ConsoleApplic

That pesky enum

Image
Update 10/2016 - This posting is better viewed in my new blog . The .NET enum, such a simple concept.  At the most basic level an enum is a collection of key/value pairs with a restricted string key and an integer value. However, the enum can trick you.  It would seem logical that when you define a new enum it'd obey the same rules as would any class you define.  That assumption can lead to subtle and sometimes difficult to identify issues. To illustrate the point I'd like to make I'm going to define a new enum called Beers and then define a new class called BeersMockEnum who's purpose will be to mock the behavior of the Beers enum.  Utilizing these I'll illustrate how they differ in a way that can present significant problems in real life implementation and deployment scenarios. First I'll define the Beers enum. public enum Beers { IPA = 0, Lager, Porter, Stout } Using the following I'll iterate over the values and output.