CodeBetter.Com
CodeBetter.Com
RSS 2.0 via Feedburner
           Do you Twitter? Follow us @CodeBetter

Eric Wise

Business & .NET

January 2005 - Posts

  • Available for work

    If anyone in the Cleveland area is looking for a .NET contractor with a specialty in ASP .NET feel free to contact me.

    If you're not in cleveland, and don't mind a virtual employee feel free to contact me.

  • Avoiding Try - Catch

    Grant Killian has a good article about why a coder shouldn't use try-catch blocks in just any situation.  I am ashamed to admit that back when I first started using .NET I was guilty of the sin he speaks of.

    What I wanted to add to his post was another very common poor usage of try-catch I have seen many inexperienced coders (including myself at one point in time) do.

       try

       {

          ddlMyDropDownList.Items.FindByValue(myValue).Selected = true;

       }

       catch(Exception ex)

       {

          //Do nothing or display some kind of warning message

       }

    Bad Bad Bad!  Try this instead:

       ListItem li;

       li = myDropDownList.Items.FindByValue(myValue);

       if(li != null)

           li.Selected = true;

      
    Posted Jan 29 2005, 08:31 AM by Eric Wise with 1 comment(s)
    Filed under: ,
  • Coming Soon - Easy Assets .NET: Source

    I have a personal goal for my Micro-ISV product Easy Assets .NET in two new flavors by April 2005:

    1. Local install version for those clients who do not need their data hosted.  This will also come with a programmer's reference for importing the business layer .dll to build your own interactions with existing systems customers may have.

    2. Local install version + full sourcecode disclosure for those customers that want a fixed asset management system and rather than start from scratch would rather “gut” mine.

    Both of these versions will be available for much less than your traditional packages like TrackIT and FAS!  Add to that the ability to write your own custom interfaces and you have one hell of a bargain!

     

    Installation Requirements

    Web Server running Windows Server 2000/2003 with IIS 5.0/6.0 and .NET Framework 1.1

    SQL Server 2000

     

    I am going to be looking for some companies to beta test the new product so if any of you developers out there know any companies that need a fixed asset management / helpdesk system send them my way.  The companies that do get involved in the beta will receive a hefty discount on the MSRP when the live version rolls out.

  • A splash of organizational management

    So, it's that time of year again, Fortune has listed the 100 best companies to work forRanjan D Sakalley is making statements about developing talent.  I'm currently taking a MBA class on Organizational Behavior.  All this is building up to a commentary on business and IT that I hope is Joel Spolsky-like

    There are some very serious problems in the business world today.  Most of them apply to all the workers out there, but since I'm an IT guy I'm going to focus on IT.  All the problems I'm going to address boil down to one final conclusion that should have employers very concerned:

    There is almost no incentive for loyalty in corporate america

    A bold and troubling statement!  Now I have to back it up.  Recent polls have shown that somewhere between 35 and 40% of workers plan on changing jobs.  That is a troubling figure for any company, given the following information:

    According to an anecdotal cost-per-hire survey by SHRM's Employment Management Association, the cost per hire in exempt positions is $10,400 through an agency, $2,100 via print, $1,000 by means of a job fair, and $392 via an employee-referral program. For nonexempt positions, the overall cost per hire is $14,498. (Office.com)

    Basically that means that if your IT department has high turnover and your employees aren't happy, you can end up paying tens of thousands of dollars to replace staff.  This doesn't even include the amount of time a developer will spend on the job getting acquanted with your systems and fitting into the team environment.  IT workers are not 100% effective when they walk in the door so you are losing money there too.

    So now I have established a definate cost to staff turnover.  This doesn't cite why turnover is so high in the first place however.  Here are what I believe are the main culprits of job disatisfaction and the relatively low average tenure of employment for workers in my generation.

    1. Elimination of pension plans
    2. Overtime Exemptions / Overwork / Burnout
    3. Declining benefits
    4. Shareholder (stock market) pressure
    5. Executive Compensation

     

    Elimination of Pension Plans

    This is a pretty simple one to piece together.  Back in the day, a company had a nice pension program so that you knew that by staying with your employer you were going to get benefits after retirement.  In today's market, your retirement funds are for the most part based upon your own contributions so the loyalty incentive has been replaced with another incentive: Making as much money as you can as soon as you can.

    To their credit, many employers do some form of 401K matching to help you out with your retirement savings but the problem is that 401K matching is a fairly standard benefit.  That means that 401K matching has almost no impact on employee retension because the next company down the line will probably offer that benefit as well.

    Overtime Exemptions / Overwork / Burnout

    If you are a white collar worker, it is likely that you are exempt from overtime pay.  What this sets up is a system that rewards companies for poor planning and inefficiency.  If your employer can agressively schedule a project and not have to pay you for extra hours you put in when the project gets behind, why should they bother trying to schedule things properly?  Add the perception (reality?) that employees are not loyal and embracing the idea that your turnover will be high regardless and you breed an environment where management seeks to squeeze every drop of productivity out of their workers before attrition kicks in.  In my very humble opinion a great way to make American businesses better managed is to increase the penalties of poor management!

    Also, our paid time off is some of the lowest figures in the world.  How come companies like Airbus in Europe can give 3 times the time off that American companies do and still remain competitive?  I've wrote it before and I'll write it again: After a certain point, the number of hours worked has an inverse relationship to the amount of productivity.

    Declining Benefits

    When you get to the point where medical coverage contributions are costing you out of pocket almost what it would cost you to buy your own and become a contract worker... enough said.  This is something of a national problem than a corporate problem... but when you think about the above cost of over $10,000 to hire a new employee through an agency, don't you think it's worthwhile to kick some extra money into benefits?

    Look to companies like SAS for an example of a company that treats its employees very well.  SAS, if you're in need of .NET developers, you can call me anytime.

    Shareholder (stock market) pressure

    I see a definate trend between publicly held companies and declining benefits.  This is because of a stock market system that demands gains in the short term.  Executive compensation is deeply tied to the market.  All this adds up to motivation to be short-sighted as far as company goals are set.  Hurting your employee benefits just to drive costs down so the company can make an extra cent per share is a horrible long term strategy and eventually it will come to haunt management and investers both.

    It is already well documented that the demographics of the employment landscape are shifting and after the baby boomer generation is unable to work anymore there are going to be some enormous holes in organizations.  Without having built a culture of satisfaction and loyalty companies are going to be paying enormous fees to attract the talent they need to survive.  The retension process needs to start very soon, or you'll be left behind.

    Executive Compensation

    Yeah, you guys are the head honchos.  You've worked hard to get to the top positions in the company and you certainly deserve a robust salary.  But come on, it's getting a little ridiculous:

    In 2003, the average CEO of a major company received $9.2 million in total compensation, according to The New York Times.

    Think about it, that's average, some CEOs are making more than that amount.  Just think about the impact on job satisfaction if every CEO took a 50% paycut and dumped that money right into employee benefits programs.

    *** End Transmission***

  • Of Patterns and SQL Stored Procedures

    Some people have been discussing SQL Stored procedures lately.  I figured I'd weigh in. 

    As with most things programming, it really depends on what you're trying to accomplish.  There are certain situations when lots of stored procedures are appropriate (application designed to run on a single database, higher security, speed, etc), and certain situations where they are not (dynamic queries, multiple database types supported, etc).

    The most helpful thing you can do in any type of programming is pick a pattern and stick with it!  Real world however, it's just doesn't seem to work out that way- there's always some wierd case that pops in.  When this happens you need to make sure to document it thoroughly.

    At the end of the day, pattern or no, if your code is easy to read, understand, debug, and the application works; you have been successful.

  • Can't... resist... stupid... quiz

    Am I in the wrong line of work?

    Your Dominant Intelligence is Linguistic Intelligence
    You are excellent with words and language. You explain yourself well. An elegant speaker, you can converse well with anyone on the fly. You are also good at remembering information and convicing someone of your point of view. A master of creative phrasing and unique words, you enjoy expanding your vocabulary. You would make a fantastic poet, journalist, writer, teacher, lawyer, politician, or translator.
  • Broadband?

    You know, I'm so freaking tired of my “broadband” internet provider.

    My eSuite supposedly provides me broadband internet over cable modem.  I've complained and they've sent techs out several times to “check“ and the techs have reported that my max speed of 37 KB/sec “isn't too bad“.  This is after living in Albany, NY where I had roadrunner and a blazing 150-300 KB/sec.  I feel like I've been hamstrung!  My eSuite has a virtual monopoly on my apartment complex because no other cable companies are allowed in here and SBC Yahoo DSL isn't available yet though they have a switch a few miles away.

    Attention SBC!  There are over 100 residents in this complex who are suffering with this 20 - 30% of the time:

    Posted Jan 13 2005, 08:50 PM by Eric Wise with 152 comment(s)
    Filed under:
  • HOWTO: Configure a datagrid template postback from a textbox

    I wrote this bit of code today and I thought it was neat so I figured I'd post it here.

    Lets say you have a datagrid filled with addresses which are editable in-grid.  In addition you have a footer with an add button that displays the same style of edit boxes as the line items.  This is all well and good and fairly well documented in the community so let's add a twist: When a user types in a zip code, grab a list of cities in that zip code and display them as a dropdownlist and populate the city and county for that zipcode.

    Here's a screenshot of the grid as it comes out of the gate:

    Here's what it looks like in add mode.  Edit mode would be the same except the data items would be filled in.

    Now, let's talk code.

    1. We need to set the autopostback property on the zip code textboxes (add and edit) to True.
    2. We need to wire up the TextChanged event for the zipcode controls
    3. We need to be able to parse the datagrid editindex row or the footer row depending on which onchanged event was fired.

    Wiring up the onchanged event is fairly simple, we do it in the ItemCreated() event of the datagrid.

       Private Sub Grid1_ItemCreated(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs) Handles Grid1.ItemCreated
            If e.Item.ItemType = ListItemType.EditItem Then
                AddHandler CType(e.Item.FindControl("ZipCode"), TextBox).TextChanged, AddressOf ZipCode_TextChanged
            End If

            If e.Item.ItemType = ListItemType.Footer Then
                AddHandler CType(e.Item.FindControl("AddZipCode"), TextBox).TextChanged, AddressOf AddZipCode_TextChanged
            End If
       End Sub

    Notice I have two sub routines to handle the TextChanged for the zipcode boxes.  Here's the code for them.  You will see a difference between how to manipulate controls in the footer versus how to manipulate controls in the current edititemindex.  The FooterIndex is always the last record in the controls(0) collection found as such:

    Dim FooterIndex As Integer = Grid1.Controls(0).Controls.Count - 1

    Note that I have stripped out the code populating myZipCodes, just accept that myZipCodes is a collection of ZipCode objects that have the properties necessary to populate the grid.  =)

       Private Sub ZipCode_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs)
            Dim myZipCodes As New UltraCareBLL.ZipCodes

            If myZipCodes.Count >= 1 Then
                CType(Grid1.Items(Grid1.EditItemIndex).FindControl("City"), TextBox).Visible = False
                Dim myDDL As DropDownList = CType(Grid1.Items(Grid1.EditItemIndex).FindControl("ddlCity"), DropDownList)
                myDDL.DataSource = myZipCodes
                myDDL.DataTextField = "City"
                myDDL.DataBind()
                myDDL.Visible = True
                CType(Grid1.Items(Grid1.EditItemIndex).FindControl("State"), TextBox).Text = myZipCodes(0).State
                CType(Grid1.Items(Grid1.EditItemIndex).FindControl("County"), TextBox).Text = myZipCodes(0).District
            Else
                CType(Grid1.Items(Grid1.EditItemIndex).FindControl("ddlCity"), DropDownList).Visible = False
                CType(Grid1.Items(Grid1.EditItemIndex).FindControl("City"), TextBox).Visible = True
            End If
       End Sub

       Private Sub AddZipCode_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs)
            If myZipCodes.Count >= 1 Then
                CType(Grid1.Controls(0).Controls(FooterIndex).FindControl("AddCity"), TextBox).Visible = False
                Dim myDDL As DropDownList = CType(Grid1.Controls(0).Controls(FooterIndex).FindControl("ddlAddCity"), DropDownList)
                myDDL.DataSource = myZipCodes
                myDDL.DataTextField = "City"
                myDDL.DataBind()
                myDDL.Visible = True
                CType(Grid1.Controls(0).Controls(FooterIndex).FindControl("AddState"), TextBox).Text = myZipCodes(0).State
                CType(Grid1.Controls(0).Controls(FooterIndex).FindControl("AddCounty"), TextBox).Text = myZipCodes(0).District
            Else
                CType(Grid1.Controls(0).Controls(FooterIndex).FindControl("ddlAddCity"), DropDownList).Visible = False
                CType(Grid1.Controls(0).Controls(FooterIndex).FindControl("AddCity"), TextBox).Visible = True
            End If
       End Sub

    So the final result is that if the zipcode collection has 1 or more records, it will hide the edit textbox and present the user with a dropdownlist of choices for city and auto populate the county and state.  If the zipcode is not found in the collection (empty collection) it leaves edit textbox there and hides the dropdown list so the user can type in a city manually.

  • Nerd Score

    I'm not quite as nerdy as Sahil Malik I sure can't resist these stupid tests though.

    13% scored higher,
    1% scored the same, and
    86% scored lower.

    What does this mean? Your nerdiness is:

    High-Level Nerd. You are definitely MIT material, apply now!!!.

    I am nerdier than 86% of all people. Are you nerdier? Click here to find out!

  • Thoughts on Joel

    I was reading the latest post from Joel Spolsky and I got to thinking about a few comments that were made within.

    • “Most college students, fortunately, are brash enough never to bother asking their elders for advice, which, in the field of computer science, is a good thing, because their elders are apt to say goofy, antediluvian things like 'the demand for keypunch operators will exceed 100,000,000 by the year 2010' and 'lisp careers are really very hot right now.'“
    • “programming is incredibly good training for all kinds of fabulously interesting jobs, such as business process engineering, even if every single programming job does go to India and China.“
    • “there's still an incredible shortage of the really good programmers, here and in India.“

    The first quote I only somewhat agree with.  One must realize that humans are creatures that generally take comfort in what is known and are apt to slip into predictable patterns of behavior.  As a programmer, one must be wary of falling into the habit of accepting something as true or a best practice just because it has worked before or is the commonly accepted way of doing something.  Change can and will happen and we must train our minds to be able to research the latest trends and be able to apply (or not apply) them logically into our organization.  On the other hand, I think there is no match in the developer world for good old fashioned experience.  Let experience be a guide though, not a rule.

    I have based almost my entire career path on the second quote.  I think that as programmers we are able to focus on details while keeping a solid grasp on the “big picture” of what is going on in the business.  I started out college in computer engineering, dropped it and went into business information systems because I believed I would be a more valuable programmer for a business if I could speak to accountants, finance workers, managers, etc in their own language.  Outside of my programming job I am an avid reader of business magazines like Business 2.0 and Fortune.  I'm also currently pursuing my MBA.  Since the beginning I have perceived the role of Information Technology within an organization to be one of implementing technology in such a way that it improves the efficiency of the business freeing up the various departments to focus more on customer service and the bottom line rather than time-consuming mundane processes.  The more I understand about business and how all the pieces work together the better I can be at recognizing the areas that can be improved with technology and the better I can gain support for these ideas by communicating to the organization in a language they can understand!

    In my various jobs and contracts I have seen an astounding amount of poor decisions made when it comes to technology.  Companies have bought off the shelf systems that don't meet their needs and don't match their business processes when they should have custom built.  Other companies have spent a fortune custom-building software to match a business process that is poorly thought out and inefficient instead of reworking their process to be more within the “norm“ of business.  Behind all of these situations I see a management staff that has little or no IT savvy.  Because of this, I believe that eventually companies will come to realize that having some members of upper management that are both business and IT savvy is a must-have to create a harmony between business and IT.

    The final quote I have been on board with since the beginning.  I have never feared offshoring and I welcome the international development community to the table.  Having picked up quite a few legacy systems and having gotten involved with struggling or failing IT initiatives I can attest to the amount of code out there that is complete crap.  Having watched the hiring process for developers in my last few positions I am absolutely astonished at the poor quality of the “average developer“.  I have seen “developers“ applying for senior positions that don't know anything about OOP.  Once, a computer engineering grad couldn't tell me what an object was but had received an 'A' in c++ programming class. 

    It really blows my mind how much software out there that I consider to be crap is quite successful either because of good sales-people (liers), a lack of alternative choices, or a general lack of understanding by implementers and users.  I really hope that if my business ends up being successful that no one ever sees my work or my product and views it in this way.

More Posts