September 17, 2008

Stackoverflow

Don't get me wrong, I love Stackoverflow, I'll even admit I am fully addicted to checking it on a regular basis. And I am dying to get to 1000 Rep, and grab a few more badges. However, since the Beta ended, I am starting to seriously question its worth (initially when I started using it, I threw up a couple of test questions and some of them were answered very well). It seems to work best as a Mechanical Turk for those to lazy to spend 20 minutes on Google. If you can't find the answer in 1 google, then post it on Stackoverflow and the hoards, hungry for reputation will fight over who can answer it first. Now if it is a difficult question, someone usually posts one incredibly brief and very vague response and it never gets looked at again. This would be the main problem with Stackoverflow, useful enough for very easy questions, not so useful for the arcane. I may be wrong, and over time someone will answer some of the more difficult questions I have posted, but it hasn't happened yet. It seems if you actually tag something pretty specific, or be somewhat detailed in the title you are only going to get a few viewings and probably one or two bad answers.

BTW, the way to gain reputation is to look for broad categories that lots of people look at (you can flip through the popular questions and quickly see what they are), and follow those for a while and do the fastest gun in the west answer style. (Put up a very quick vague answer and then edit it before the five minute, you can change your answer time is up)

June 6, 2008

Going Overboard...

Well, I just wasted about 4 hours yesterday going down an architecture rabbit hole. In our latest project we are updating some ancient code to DotNet (as well as creating a whole new architecture), and have decided to use an IOC/DI container to handle creation of a lot of our objects. This solved a lot of problems with our dual views (a WPF view and a WinForms view) where things like timers were required (can't use a WinForms timer on an WPF window). I was so happy with the results that I decided to change a ton of ported code that was basically a bunch of global configuration operations to using the IOC container. Since the code was ported it had a ton of dependencies, which ended up being a ton of circular dependencies (this object used that object, etc) which I only discovered as I was moving them into the container. Either all of the configuration code was going to have to be re-written or I am going to have to wall off that section of the code and accept that it is going to have a bad code smell for now and refactor it later. I decided to revert the four hours of changes, and keep the project moving forward so that we don't have to spend a week refactoring the configuration for no real gain other than getting over the Ugh factor of the ported code. Now the project can move forward, make small progress, check-ins can occur regularly, the unit tests can be run. Maybe sometime in the future this will bite us in the ass, but for now I think it is the right decision.

Was the four hours wasted going overboard? Probably, but for every mistake you make, you learn something. And I probably won't waste four precious hours like that again.

May 3, 2008

A Year With Vista

It's been a year now that I have had Vista at home. I still use XP at work, and to be honest if it wasn't a serious pain to downgrade my work machine, I definitely would have a long time ago. And although this has been hashed out for more than a year now here are my thoughts on Vista.



For power users (i.e. everyone who instantly turned UAC off) I see no advantage to Vista, and there are a bunch of disadvantages. I never use the search feature (I turned off indexing a while ago because it never found anything I looked for except for shortcuts in the program menu and Launchy does that so much better. Aero looks nicer than the standard XP look and feel, but not that much nicer. Windows-tab was really cool for about 5 minutes, and then I never used it again. And the first thing I did was turn gadgets off, I highly object to giving up so much screen space (and I am running at 1900x1200). Apparently the start menu has improved, but I actually find it worse (it is far more work to keep clean and organized, which is something that I am adamant about).


Now, I've never had any real problems with Vista (except for some home networking quibbles in the early days), and there aren't any programs that I can't live without that don't run on Vista. It just seems to me like an unnecessary upgrade to me. Part of the problem is my lack of familiarity with it. I hate the new explorer. Maybe it is better for newbies, but it completely sucks for people who have spent their whole lives with the old explorer. It constantly thinks you are in a music folder when there is one sound file (or even not) in the entire directory. It sucks to the point where I have switched to xplorer2 (just the free light version as of yet). And my other big complaint, is the ridiculous amount of unnecessary services that Vista deems you want to be running. I am so comfortable in the task manager on Xp, I know what everything is there. After a year I still have no idea about quite a few Processes that are running on my machine, and list of Services (which I do admit is an improvement in the task manager) is daunting. I have no idea what I need to run, and what I don't. What Microsoft really needs is a tweak tool that is in between giving you no control and the services tab. Kind of simple questions like "Do you want to run remote desktop", "Is this a tablet PC", "Are you in a work domain", and such. Why things like Remote Registry, Tablet Input Services, DFS Replication are turned on by default on Home editions of windows is just plain stupid.


Anyhow, I think Microsoft completely dropped the ball on Vista. They added nothing of real value, spent 5 years creating that, and dropped or back ported to XP all of the big changes that were planned for Vista. Plus, the promise of gaming in Vista is a total disaster. After a year and a half there are still no games that use DirectX 10 to make the game look substantially better (maybe Crysis if you have some kind of supercomputer, but that is hack that got around with some registry tweaks). Gaming is still faster in XP, and there games for windows program is a joke. The Games browser is completely useless and I Games for Windows Live is a complete loss. $49.95 a year, for two games that support it? One of which is Halo 2 for PC, which sold, maybe 4 copies.


Rant out...

December 14, 2007

Threading is Hard

Here's to another obvious title. Even in .Net, where they have done a lot to simplify things (thank-you background worker), however threading always seems to cause the biggest headaches even when just coding things. Usually if you ignore the issues with threading there are random crashes in testing, but as you design the code you sit there and try to think about what you want to do. First, there are very few references on threading in .Net. Secondly, all the tutorials that there are involve simple things like launching a bunch of threads that sleep, and output their thread id to the console. Or they are examples of how to update the UI from a background thread. Not to pick on these, but there never seems to be any examples of how to interact with real objects in your application in a thread. What requires a lock, and what doesn't? How do I make my own classes threadsafe without locking entire classes of functions. And then how do I ensure I don't end up with deadlock in my applications (this tends to be one of those things that only show up when the application is under the kind of load it never is either in testing or in development). One of the few really good resources on threading in C# was this article, which lead me to buy the book C# 3.0 In A Nutshell and I was very glad I did.

But enough whinging and complaining about how difficult threading is, that is, as they say, why we get paid the big bucks. Here are my suggestions to make it easier, use Attributes to declare which functions have the potential of being used in multiple threads and then have the compiler throw a warning on the access of potentially non-threadsafe variable usage. This is the kind of thing that compilers are good at, and is the kind of thing that programmers suck at. If Microsoft decides not to include this, why not a company like JetBrains add it to Resharper. Another thing that might be done is exposing in intellisense whether or not an object is thread safe. That's it, that's all, until the next time I have to debug some obscure bug due to some unprotected variable that somehow got accessed on multiple threads, at which point I will come back and curse threading again...

November 19, 2007

The Start Menu and why it won't stay organized.

I am a bit OCD about keeping my Desktop and Start Menu organized, bookmarks too (which is now much easier since I discovered Foxmarks six months ago) but that is another story. This is about the Start Menu. Even in the new Vista Start Menu (which I think I am about to switch back to the Windows 2000 Classic menu) Apps that upgrade themselves, STILL insist on installing themselves in the root every time there is an upgrade. I know that some installers let you choose where to put the links (unfortunately very few developers use this feature), but can't Windows remember where you moved an application in the Start Menu? It isn't rocket science, but even in Vista there isn't even hooks written for this -- oh thats right we are all supposed to be using the Search Bar, which works Ok sometimes. Except I hate the fact that I can't have it just index the Start Menu (like Launchy does), I have to turn it on (and have my hard drive seem to be always spinning away and chewing up CPU and resources) or turn it off completely. Another quick bitch about installers, is Apple and its #@$!@ iTunes (which if Winamp had half decent support for podcasts I wouldn't need anymore, cause really the new Winamp 5.5 fixed a ton of things that had been bugging me for years) installer which seems to be bitching at me every week to upgrade iTunes. The problem being, iTunes doesn't create a real shortcut. It creates some daemon child shortcut that doesn't point to the executable and is wrong every time you update iTunes. So the horrible step is upgrade iTunes, delete old shortcuts on the taskbar and the Start Menu, move iTunes into the place on the start menu I want it and then create the taskbar link, YUCK!

Anyhow, I am away until next week, more rants and complaints then...

November 18, 2007

Microsoft Stupid Keyboard

Now I know that my keyboard is almost 5 years old (why buy a new keyboard when you don't need it?), and I like the feel of the keyboard but it has one of the most stupid features I can imagine, the dreaded F Lock. Now, I like most Microsoft hardware, I used their mice for years -- though I must say my new Logitec Mouse is the cats pajamas, but some brainboxes at Microsoft decided that the function keys we all know and love, and use daily, need to be remapped to special keys that bear no relation to say the values displayed in the shortcuts on application menus. Or what the values that video games expect, etc. They added this key, that cannot be programmatically controlled, that in the hardware remaps for example F2 (which I use a lot for Rename in explorer) to Undo. You have no idea the havoc this warps your brain around early in the morning when you have forgotten the feature is enabled because Microsoft felt it was fine to reboot your computer in the middle of the night because it wanted to install the latest and greatest version of Windows Genuine Advantage (don't get me started on that).

Now, they have fixed this in Keyboards released after 2004 (the F Lock key remembers its setting between reboots), so my whining is really more of a lesson in what not to do for user interface. Do what the user expects, not what what you think they may want.

November 17, 2007

Does anyone use Perl anymore?

Always start with a provocative title, thats what I remember someone saying. Anyhow, I was thinking about this a few days ago when I was forced to to figure out something I had written 5+ years ago (the problem of working at the same company for almost 10 years is that you are constantly forced to fix the crap you created years ago -- the joy is when something you wrote years ago actually impresses you). Now I won't say this particular piece of code did anything amazing, but back then the only hooks the application offered was the ability to execute some Perl code. And after spending an hour or so with my fairly well commented (and very non-Perlesque code) I got to thinking about why anyone would want to program in this read-only language.

We, well not me, but the programming world in general, has been waiting for Perl 6 for what seems like a decade. 7+ years is a long time to wait for anything (ask Microsoft about that). And 7+ years in the scripting language space is an eternity (hell there is even a programming language for cats now). Everything that Perl can do, Ruby can do (even the new kid on the block back then, Python is taking a back seat to Ruby, at least in trendiness). And Perl 5 is still stuck with write-only code, a truly bizarre object system (inside out objects, blessing, oh my!), and why oh why can't a variable figure out how you want to access it (%@$, looks like I am swearing in cartoon). Perl's once unassailable strength: CPAN, has been duplicated in PEAR for PHP, RubyGems for Ruby, hubris for Python, and Google and others (krugle, koders, codase) for C# and every other language I use.

When I started in this business, the web was a new frontier where CGI was written in Perl (or even C), and boy did Perl look easy compared to writing CGI or ISAPI scripts (yes, I have written a few ISAPI scripts in my day -- why did Microsoft make everything in Visual C++ an impossible tangle of Wizards and generated code that if you didn't work with it every second of every day, you spent most of your time with a head in manual). This was the days of altavista.digital.com, yahoo.com, excite.com and when the last episode of Sienfield had more advertising revenue than an entire year of advertising on the internet.

Not to be the crotchety old man, but I remembering for my first Co-op job, I researched what was available for creating a web application. The choice was between Internet Application Servers (yup that was what they were called back then) where there was Borlands Intrabuilder, ASP 1.0 (which we could never get connected to the Oracle Database running on VMS), and Cold Fusion. The other choice was client side Java applets, which Oracle was pushing at the time -- the idea here was that standard Oracle forms (oh Oracle forms, how I hated thee) could be compiled into Java bytecode that would be sent to the client web browser and run as an applet. Now this is back when everyone was on dialup, and even within the facility I worked in over ethernet it would take 5 minutes to get these suckers to pop up (if they would), and it only ever worked if you had the version of Java that Oracle packaged with their Java forms, and only one Windows (never got it working on Unix, VMS or a Mac).

So I ended up sticking them with Intrabuilder, which probably would have been fine if this wasn't shortly beforethe point in history that Borland decided to self destruct.

Anyhow, when I arrived fresh on the scene in job world, there was two ways you could work on the web. Dreaded ASP on the Windows side, or Perl on the Unix side. Then I landed at a company that had bet its future on Linux and this crazy little language called PHP/FI. Every now and then I was dragged into Perl (and still am), but oh how I am glad that the company I work for (funny, they haven't updated much on their website in the past 10 years I have been working there) was using PHP and not Perl.

Not that I work all that much in the web space anymore, and not that PHP is without faults...