Rotten Code

it can always work better - but at least it should work

  Home  |   Contact  |   Syndication    |   Login
  17 Posts | 0 Stories | 6 Comments | 2 Trackbacks

News



Archives

Recommended Podcasts

Wednesday, August 06, 2008 #

So you want to determine if a folder or file exists with PowerShell? You can invoke the same scripting object you might remember from VB....


#set a var for the folder you are looking for
$folderPath = 'C:\Temp\'

#instantiate the FileSystemObject
$objFSO = New-Object -ComObject Scripting.FileSystemObject

#check to see if it is missing
if($objFSO.FileExists($folderPath -eq $FALSE))
{
     echo "The folder does not exist."
     exit
}
else
{
    echo "The folder exists."
    exit
}

Monday, August 04, 2008 #

I gotta admit, I really like PowerShell. No, that's not accurate. I love PowerShell. I love PowerShell like babyback ribs love sauce. My relationships with PowerShell has bloomed from piqued interest to full blown infatuation.

PowerShell fits the bill of what I look for with tools - not overly engineered, actually useful, lightweight and extensible.

But since I have taken such a liking to PowerShell, that makes me wonder...isn't PowerShell supposed to be designed for admins who aren't programmers?

Becuase I'm not an admin, I'm a programmer. And almost all the blog and articles I've come across so far are written by programmers or DBA's. So I do wonder if admins are actually adopting it.

I mean, I really like using it and I like the lightweight implementation. I am curious if most of the user base is programmers like me.

Wednesday, March 19, 2008 #

Came across this article of Five Financial Rules for Geeks. I would have thought that many tech guys are also interested in finance, but now I realize that many are not.

This list if funny, but pretty accurate.

Friday, October 05, 2007 #

A quick note to Chad Johnson:

I hate to be the one to tell you this, but 'ocho cinco' doesn't mean 'eighty-five'. It means 'eight five'. Just thought I'd let you know.

Thursday, July 26, 2007 #

Clang, clang clang! The warning bells are going off.

I can report that Google has finally contacted me, although it's probably too late for us- we already are in negotiations with other vendors. but regardless, it seems I'm not alone in my thoughts about the potential stumbling of Google. Digg is announcing that they are breaking away from Google as well.

Of course, I really don't want to seem like I'm hoping for the demise of Google, and Google is big enough now, and it's hard to sink a big ship - meaning big companies usually have the reserves to last when they hit bumps in the road. And Google is still my home page by default, becoming so after Yahoo! introduced some sort of confused design.

Thursday, July 19, 2007 #

So a few days ago I was ranting about how Google might not be such a great company to invest in if their management is as bad as I think it might be. And now, we have more possible proof that Google is not exactly Fortune 500 material.

Hey, I love tech companies, but just why is Google so lauded? Their search results are horrible, the app looks like something college kids threw together over a weekend. What really baffles me is why no one else has really improved on the search engine either. Before some open source evangelist starts railing about how I should shut and build one myself, I'd like to point out that dozens of companies do just that every year, and yet none off them seem to have any better ideas. Since I spend my time writing other, more productive software, I would think I could leave it to such a crowded field to produce one decent offering.

Monday, July 16, 2007 #

Update...it has now been 17 working days without any response from Google's business sales team. And that's working days.

Thursday, July 12, 2007 #

I have to build a new mapping application and replace an existing one. We are looking at three possible options: MapQuest, Microsoft's Virtual Earth, and Google Maps. The first two companies were easy to contact and get pricing, but I never realized just how horrible Google's support is until I attempted to get actual commercial pricing numbers from them.

First, the information for businesses is not on their website. I need hard numbers for a Fortune 500 company, not some sample HTML code for a personal web site. I need to talk to the person in sales who negotiates and manages these big contracts. Nowhere on the web site is there information on who to talk to. There is an online email form to fill out and hope they  contact you...but after three weeks of trying that and no response, the executives wanted hard numbers and I didn't blame them. I figured I would just get on the horn and speak to someone in sales. No luck. No numbers on the web, no listing for business contacts. I finally found a general number and then was routed through numerous voice prompts which sounded promising but all ended in 'visit the website'. What a joke. Why even have multiple options for customer support, web support and sales when all it does is tell you to visit the website? Couldn't they have just told you that before you waded through the phone menu?

Finally I got through to the operator who told me all the information is 'on the website'. When I pointed out that I've been trying to get someone to contact me and that I needed to speak to someone about commercial usage, she told me to fill out the online contact form. Which I had already done, previously. To this, she simply told me to 'fill it out again'.

So basically, I have a big blank check in my hand and no one at Google even wants to talk to me. It's like dealing with a company managed by high school kids. Domino's Pizza gives better customer service. Heck, Yahoo!, Microsoft, Sun and Oracle all have actual people to talk to. I think I need to sell my Google stock. No company run this poorly with applications that are just basic technology can be a wise investment, can it?

Thursday, June 07, 2007 #

Some quick notes from Tech Ed 2007(Not a technical review in any way):

1. Free T-Shirts from the vendors and the Shirts for sale in the Tech Ed store are often way too small. It's no secret that attendees at Tech Ed are often - ahem - overweight. I'm not obese but I am tall and usually the shirts are useless. Also, the chairs in the sessions are too close together. Put 500 fat guys in a room in tiny seats and watch how early people start walking out.

2. For some reason, the snack tables seemed nonexistent until the fourth day. The lunch buffets are handled pretty well but most of the days, all you could get was coffee, water or soda all day. The coffee was better than last time.

3. It seems more crowded. It could be the vast amounts of unused floor space, or it could be the lines in the bathrooms due to the better coffee. Honestly, by the fourth day people were lounging everywhere, and it was hard to find a place to sit or to check email.

4. Some of the sessions could have been shortened to 45 minutes. I know it's hard to preview the talk content in it's entirety, especially for speakers that have spoken so much that they have more leeway, but it really needs to happen.  I would like Microsoft to split down some of the sessions into smaller chunks.

5. Just like last time I attended, too many similar sessions were scheduled concurrently. Typical day for me was having to pick from four interesting sessions in the morning and then having huge gaps later in the day where no sessions interested me. I know Microsoft is not going to schedule around my interests, but I'm pretty sure that if one afternoon is all hardware sessions, more of us developers aren't going to attend.Of course, if Microsoft wants to set up the whole conference around my schedule, they should contact me and I will give them a detailed list of what I want to see, where to put the snack tables and what I want for lunch.

6. The exhibit hall is massive. The main hall is about 1500 feet across, and Microsoft puts down all new carpet in the whole place. It's pretty awesome, smells nice, looks nice. But too many sessions are one opposite ends of the hall, up a flight of stairs and down a concourse. It can take literally ten-fifteen minutes to walk from one session to another, and then when you arrive, the session might be canceled. The event planners should try harder to maybe place all developer sessions on one side and hardware on the other.

7. A cool thing is some new 'Interactive Theaters' that microsoft placed in the main exhibit hall. These are small walled off areas with limited seating. The only problem is, some very interesting sessions were held in those theaters and they were far too crowded. There was so much unused space in the hall that these theaters could have easily been bigger, OR of varying size so that more popular sessions would have more rooms.

8. The Hands On Labs were better, with dual screen setups to allow one side for the lab manual and the other for the lab itself. Unfortunately, the lab was on a virtual machine running Vista, and that means it was SLOW. The more I use Vista the more I hate the idea of upgrading.

9. There is one good thing about Vista that I know of, and that's the implementation of Suite B, a new set of Cryptography tools. The current Crypto API is difficult to use, and the new one is easier and more robust. I will be writing more about that in the future.

10. I would suggest Microsoft use the extra exhibit hall space better with more 'plugged-in' sitting areas. There were more than last time, but not enough. Wireless connectivity was better but still spotty at times.

11.  My own personal takeaways: More developers are interested in architecture now, the new Visual Studio  has one key thing I like: The ability to target specific frameworks. None of the releases are major shifts like SQL Server 2005 or ASP.NET 2.0.

12. It looks like Tech Ed will be in Orlando again next year, which is probably a good idea. Orlando is a great place for a conference, but the content at Tech Ed is getting to the point where I'm only attending to see what the latest releases look like. I might look at PDC if they reschedule it.

Friday, May 04, 2007 #

I've come to the conclusion that I value programmers with some experience working for non-technical companies more than those who have only worked for technology companies. I've worked for both. I've worked as a consultant and as a full time employee, for software companies, dot-coms, insurance and manufacturing companies. And although tech companies are more fun (read: easier), the brick and mortar experience grounded me in reality.

This is not to say that someone who has only worked for Microsoft or ABC software isn't a good programmer. This is to say too many of the methodologies that are pumped out (like pair programming - HA!) come from people who work for companies whose entire culture involves technology.

For a software company, IT is a profit center. Period. Almost everyone who works for a software company is technically inclined and/or interested. I know there are exceptions, but it's different if you work for a company whose focus is manufacturing widgets or stocking retail stores. For those companies, running 50 plants on 30 year old code is not only acceptable, it's the norm. And there's no business reason to change it. If you want to start writing .NET or Java code, you'd better have a real business case.

Wednesday, May 02, 2007 #

I ran into an AJAX problem this morning. I tried to make a callback using the same

code I’ve used dozens of times, but the callback wouldn’t execute, giving me a message that

 ‘WebForm_DoCallback’ had not been initialized. After pounding my keyboard for far too long,
I discovered that I had to place the javascript within <form> tags in order for it to work.

Just when you think you've done something so many times you can do it in your sleep,
you discover some minor detail that you should have already known.


Wednesday, April 18, 2007 #


Oh, how we lament the lack of savvy users in the IT industry!

Everyone who has been in IT for a while has a story about users, bad users, dumb users, arrogant users, users with bad smells, and users who sleep through meetings and drool on their keyboard. We’ve all heard about the user who used the CD tray as a cup holder and the call to tech support about why the unplugged computer wouldn’t work.

And yeah, there are some users that probably shouldn’t even be allowed to touch a computer. There are people that shouldn’t be allowed to drive either, but idiots still race up and down the highway everyday.

Every time a new methodology or concept comes out in IT, such as SOA, there is talk of ‘aligning’ with the business side, and of ‘educating’ the business user. Those of us who don’t work for technology companies know that if the methodology comes from IT, it usually only matters to IT. Why would the business care about SOA?

Before you shoot your hand up, remember the business only cares about one goal: making a profit. Although we know that SOA can make businesses more flexible, and possibly more profitable, we would be in denial if we didn’t admit that SOA could be implemented successfully without any immediately visible monetary benefit. Sure, we could say that IT being able to maintain the various applications and swapping them out can save man-hours, but again, unless your business views IT as a profit center, it’s not going to show up on the annual report. Most large non-technical companies are too worried about managing defects and overtime in the manufacturing plant, or increase in percentage of same-store sales to worry about whether IT’s new process saved one hundred man hours – all the business cares about is that when IT said something would be done, it got done. It doesn’t matter how.

I’ve been in meetings where IT people talked about how we could get the business people ‘on board’ with a new SDLC or deployment. But in reality, the few business users we have that ‘get’ IT are few and far between, and they didn’t need any special training or coaxing from us to get there. Those users had something special, in that they made an effort, on their own, to learn enough about IT to ‘get’ IT. And even those users probably don’t care about IT.

The last time I heard someone mouthing off about business users who don’t understand IT, it was a programmer who had just come from a requirements meeting with the sales department. He complained that the business users didn’t even understand why we used read-only data to populate their data marts for reporting.

I asked, “how much do you know about our sales process?”

“What’s to know? You sell our product to the stores. You get your commission check. That’s it,” my colleague retorted.

“Really?” I asked, “What about the velocity of the products? Are the sales reps in charge of recording that? What about balance of share? Do our sales reps manage or report on that for the independent retailers? And how do either of those get reported for contract sales?”

My coworker looked at me like I’d asked him to swallow a giraffe.

“What? I don’t know any of that. What are you talking about?” He was defensive.

My point was that he was griping about the sales department business users being willfully ignorant, but he didn’t have any more knowledge of the sales world than they had of the IT world. I can only imagine how ticked he’d have been if he’d happened to overhear the sales reps later, talking about him:

“I met with this IT guy earlier. I just don’t know about him. He didn’t even know that we record our delivery distance based on the manufacturing plant, not on the sales location. Can you believe that?”

Or even better, what about when the sales force implements a new ‘coffee talk program’ for clients, where each month the top clients get invited to have breakfast with the sales force. Does IT even care? No. All we care about is that the sales reps have found another way to deliver.

My overall point here is that we in IT have got to stop pointing fingers at the business users and whining that they aren’t savvy enough. It would be great if they all were, sure. The ones that already ‘get it’ are a dream to work with. But most aren’t and will never be. So we have to step up and learn more about their business. While we might not get more business users to educate themselves about IT, we’ll get past the us-versus-them mentality – eventually – and become far more valuable to the business.

I could equate it to hiring a roofing contractor or plumber or mechanic, or anything you don’t have time to do or don’t know how to do. Anyone who has hired a contractor who left a job half-finished will attest that it’s better to pay more for someone who always just gets the job done, on time and on budget. If I hire a roofer, do I care that the roofer just found a new hammer that results in 20% less mashed thumbs than before? No. I just care that the roof was put on correctly, in the time stated and for the money quoted.


Friday, April 13, 2007 #

"Never having been able to succeed in the world, they took revenge by speaking ill of it."
             -Voltaire

I've got a new term for people who flock to sites like Digg, but don't really comment on the content of submitted stories or headlines. Instead, they comment on the post itself, complaining about duplicate submissions or wording. I call these people Diggnats - (pronounced 'Dig - natz') because that's the impression I get- little whiny flies buzzing around and offering nothing substantive.

It's not just limited to Digg, of course - YouTube, Yahoo! or any platform for commentary has these insects loitering about. For every comment of real discussion, there are ten with little quips attempting to be humorous, grammer police, wisecracks and ingnorance.

I don't have an issue with real discussion, or even dissention - I think it's great, we have to be willing to ask ourselves the hard questions and invite intellectual challenges. But this stuff is just nonsense.

It's probably best summed up brilliantly by this XKCD comic strip.

The only solace is that people who spend so much time posting this stuff will probably also get in in on that 'great Nigerian money deal'.

Thursday, April 12, 2007 #

Since the proliferation of client-server architecture, enterprise developers have generally learned to develop in a specific language for application code and another for database manipulation. Application code might be Java, C#, VB, C++, PHP and so on, but for databases it’s pretty much a flavor of SQL. I’ve written in three flavors of SQL: Oracle, MSSQL and MySQL. Well, four flavors if you consider MS Access’s own special blend.

Project LINQ, Microsoft’s Language Integrated Query, is supposed to re-invent how programmers interact with data. In other words, developers won’t absolutely need to know SQL anymore. LINQ is apparently championed by Microsoft’s Anders Hejlsberg as solving the ‘problem’ of programmers being forced to understand SQL in addition to their own programming language.

You can see this philosophy growing throughout Microsoft’s implementations. Visual Studio now comes in several flavors, one for Software Developers, one for Database Developers, one for testers, and so on. It seems as though Microsoft believes that we IT people are stepping on each other’s toes as we try to implement enterprise systems. Or maybe they think we need to be quarantined into our technology pigeonholes.

The issue I see is that the underlying n-tier architecture hasn’t changed (I’m not even sure it should), in that in the ‘real world’ of business applications, choices are made whether to put logic in the application or database level. Flexibility is the key, of course. A simple example might be a customer response form on a web app that has drop down values driven from a database. This decision would be made if the values change often, and rather than modifying the HTML/ASP/ASPX/PHP of the web app, records would simply be added or changed in the database and the changes instantly reflected without a code roll.

So why does this matter to LINQ? Well, if the database logic is badly written, the application’s performance will suffer, and of course, the opposite is also true, in that a stored procedure might return data quickly but the application performs poorly due to application code that could be more efficient. In the LINQ world, programmers are relying on precompiled code to retrieve data. Not necessarily a bad thing, but it also appears to put a lot of the logic that should go in the database potentially in the application. If a programmer has no idea how the SQL should work, he will always use the LINQ. This kind of code is why we still have massive, clunky corporate applications still being written in Access or even –shudder- Excel. After millions of dollars and research and hundreds of thousands of man hours have been poured into making relational databases that return data in the quickest, most efficient way, now we’re talking about ignoring all of that and running a layer of abstraction.

I don’t completely disagree that LINQ might serve a useful purpose to unify queries across databases and languages. However, I do wonder how extensive it is – I know that in the past I have written simple SELECT data queries and then performed sorts and gyrations in the app code – only to realize later I should have done it all in the database, making use of the more efficient SQL code and the database server hardware.

I’ll continue to review and test out LINQ, but right now I’m reserving judgment and wishing that Hejlsberg would go and add the ‘With’ keyword to C#. And make XML parsing faster while you’re at it! I need that more than a SQL abstraction layer.

Thursday, March 22, 2007 #

Previously I mentioned the AJAX.NET library from Microsoft – I thought I’d add that this is an open source – that’s right, open source – project from the Redmond Giant. Works in Firefox, because it’s all JavaScript, baby. At least, enough of it is to matter.

The tool is available at http://ajax.asp.net/