• (cs) in reply to Otto

    If coders were paid by the line, VBers would wear out ther _ key within the first month on the job.

    But then if coders were paid by the line, we'd all be working for like 1,000 lines per penny, because upper management would say a secretary can fill those lines easily.

    And then people in India would beat you out because they'll write 10,000 lines for 3/4th of a penny.

  • (cs) in reply to cm5400
    cm5400:

    Do programmers actually get paid by the line? 

     

    There used to be an effort to apply a technique Function Points as a metric.  It was supposed to be a standard measure of productivity that was independent of language used and didn't care how many lines of code were produced; only the amount of functionality that was implemented.

    I never met anyone that actually used the technique and haven't heard much discussion about it in a while.  Has anyone else?

  • (cs) in reply to whoisfred
    whoisfred:
    So, what is the WTF here?

    Do you have a problem with IF ELSE statements?

    Does it bother you that the IF part is the same as the ELSE part?

    Obviously the code used to do something different depending on the value of Request.QueryString("source_url").  The requirements later dictated that the same operation be performed in both circumstances.  The programmer, when making that change, didn't want to cause any unwanted side-effects that might be caused by removing the branch.  The sensible and logical thing to do, in that case, is to simply give both branches the exact same code.


    I can very nearly buy off on this argument.
    If you're doing maintenance coding, it makes a lot of sense to make incremental changes, and test to see if there are any "Cthulu calls" lurking in the code.
    That said, untidied incremental changes become excremental changes...
  • (cs) in reply to dfinster

    dfinster:
    I refactor that to:

    Response.Redirect strRedirect & "&verify=1&process=1"

    In ASP the parens are optional and mostly annoying.  Of course, my code (as the original WTF) assumes that strRedirect already has some querystring, otherwise we need to kill the leading "&".

    Frankly, after spending a lot of time refactoring ASP code, in a corporate IT shop, this is small stuff.  Hardly worth talking about.

    My favorite is when they take every field from an Oracle database and append an empty tring to it so they don't have to deal with NULL.

    It ends up looking like:

    var1 = rs("field1") & ""
    var2 = rs("field2") & ""
    var3 = rs("field3") & ""

    I ran into a lot of that from my old job.

    Can you post what you would have written in place of these three lines?

    Thanks :)

     

  • (cs) in reply to ukemigrant
    ukemigrant:

    dfinster:
    I refactor that to:

    Response.Redirect strRedirect & "&verify=1&process=1"

    In ASP the parens are optional and mostly annoying.  Of course, my code (as the original WTF) assumes that strRedirect already has some querystring, otherwise we need to kill the leading "&".

    Frankly, after spending a lot of time refactoring ASP code, in a corporate IT shop, this is small stuff.  Hardly worth talking about.

    My favorite is when they take every field from an Oracle database and append an empty tring to it so they don't have to deal with NULL.

    It ends up looking like:

    var1 = rs("field1") & ""
    var2 = rs("field2") & ""
    var3 = rs("field3") & ""

    I ran into a lot of that from my old job.

    Can you post what you would have written in place of these three lines?

    Thanks :)

     




    There is an Oracle SQL function to launder this in the SELECT clause.
    In MS Abcess, it's Nz(), and it's similar to that in Oracle, I just don't recall exactly.
  • (cs) in reply to Bustaz Kool
    Bustaz Kool:
    cm5400:

    Do programmers actually get paid by the line? 

     

    There used to be an effort to apply a technique Function Points as a metric.  It was supposed to be a standard measure of productivity that was independent of language used and didn't care how many lines of code were produced; only the amount of functionality that was implemented.

    I never met anyone that actually used the technique and haven't heard much discussion about it in a while.  Has anyone else?



    While I personally can't say much about it, that method of measuring productivity seems to be the defacto standard in the military, or at least it seems to be that way where I'm stationed. 

    I rarely hear anything about how many lines of code I've written, but much more about how well a particular section of the project works, and how much faster the optimizations make the product.

    I think the reason you haven't heard much about it is because those who think it's bunk threw it away, foolishly, IMO, and those that think it's a Good Thing took it to heart and roll along with it.
  • (cs) in reply to cm5400
    cm5400:
    Do programmers actually get paid by the line?  (cringe...Waits for flame thrower to hit)  I have never actually programmed outside of work before.  I can't see where that would be a good way to do business, on the other hand it could be very profitable...


    It used to be very common, especially in COBOL shops. It's almost unheard of today. IME, when KLOC are quoted as a productivity metric these days, it's usually part of some empire-building middle manager's attempt to boost their status with bogus 'statistics' that sound good on paper but are really meaningless.
  • (cs) in reply to smitty_one_each
    smitty_one_each:
    ukemigrant:

    dfinster:
    I refactor that to:

    Response.Redirect strRedirect & "&verify=1&process=1"

    In ASP the parens are optional and mostly annoying.  Of course, my code (as the original WTF) assumes that strRedirect already has some querystring, otherwise we need to kill the leading "&".

    Frankly, after spending a lot of time refactoring ASP code, in a corporate IT shop, this is small stuff.  Hardly worth talking about.

    My favorite is when they take every field from an Oracle database and append an empty tring to it so they don't have to deal with NULL.

    It ends up looking like:

    var1 = rs("field1") & ""
    var2 = rs("field2") & ""
    var3 = rs("field3") & ""

    I ran into a lot of that from my old job.

    Can you post what you would have written in place of these three lines?

    Thanks :)

     




    There is an Oracle SQL function to launder this in the SELECT clause.
    In MS Abcess, it's Nz(), and it's similar to that in Oracle, I just don't recall exactly.


    For Oracle, you would be thinking of the NVL function.
  • (cs)

    Poor old Burleson's getting a mention just about every WTF, now, isn't he? I'm sure we're great for business :) Note that his consultants are required to dress to standards set by financial AND banking institutions...

  • (cs) in reply to Mike R
    Mike R:
    Most of the stuff I had working, and working well was completely hosed. It took many months to get the program up and running again before the company finally went under.


    If I had been in your shoes, I would have simply rolled back the source tree to the day I left and picked up from there.

    OTOH, I've worked in far too many places which either had no source control (and refused to let us set it up), or mismanaged it so badly that they might as well not have. In such places, I took to the habit of manually snapshotting the source files periodically; it never works as well and doesn't solve the other source control issues such as merging, but it was better than the alternative.
  • (cs) in reply to JThelen
    JThelen:
    smitty_one_each:
    ukemigrant:

    dfinster:

    My favorite is when they take every field from an Oracle database and append an empty tring to it so they don't have to deal with NULL.

    It ends up looking like:

    var1 = rs("field1") & ""
    var2 = rs("field2") & ""
    var3 = rs("field3") & ""

    I ran into a lot of that from my old job.

    Can you post what you would have written in place of these three lines?

    Thanks :)

     




    There is an Oracle SQL function to launder this in the SELECT clause.
    In MS Abcess, it's Nz(), and it's similar to that in Oracle, I just don't recall exactly.


    For Oracle, you would be thinking of the NVL function.


    There's a SQL-standard
    [foo] = ISNULL(foo, '')
    too.
  • Juenemann (unregistered) in reply to Bustaz Kool
    Bustaz Kool:
    cm5400:

    Do programmers actually get paid by the line? 

     

    There used to be an effort to apply a technique Function Points as a metric.  It was supposed to be a standard measure of productivity that was independent of language used and didn't care how many lines of code were produced; only the amount of functionality that was implemented.

    I never met anyone that actually used the technique and haven't heard much discussion about it in a while.  Has anyone else?

    At a previous company that I worked for, we implemented a system to count the lines of changed code as the productivity measure.  Great, except we also had a custom tool that expanded out variable list into FORTRAN common blocks.  I inserted a variable near the start which caused all of the memory locations within the common block to shift in the tool output.  Needless to say, my two line fix appeared as an 8000 line change for less than a days work.  A week later, management abandoned that approach.

    Good times

    Dave J.

     

  • Phillip J. Birmingham, Highly Paid Consultant (unregistered) in reply to Matt B
    Anonymous:

    Now that's irony - the guy with the rigid, "professional", "females can NEVER wear anything but skirts" website posts photoshopped pictures of himself on said website.  


    I suspect that the guy realizes that the dress code game is so much bullshit, but that his clients don't think it's bullshit and will pay handsomely if he plays along.

    I'd find that sort of dress code odious, myself, but if I were billing $300-$500 an hour, I imagine that I could get used to it.
  • (cs) in reply to Phillip J. Birmingham, Highly Paid Consultant

    Just for the record, the redneck seems to have his own vanity publishing company, too:
    http://www.rampant-books.com/

    Oracle books, IT books, job interview books and the inevitable GuideHorse books.

    His wife's oddly human looking, compared to himself.

  • (cs) in reply to Paul
    Paul:

    Only if you're Response.Write(...)ing it.  If you're Response.Redirect(...)ing, then it should be & and not &

    Try it and see.

    Ah okay, thanks for mentioning that. It puts my mind at rest, because where I work, there's very few & to be found [:-)]

     

    Drak

  • (cs) in reply to Drak
    Drak:
    Paul:

    Only if you're Response.Write(...)ing it.  If you're Response.Redirect(...)ing, then it should be & and not &

    Try it and see.

    Ah okay, thanks for mentioning that. It puts my mind at rest, because where I work, there's very few & to be found [:-)]

     Drak



    OK, here's the low-down on &'s...  The W3C HTML standards (some of them, I think 4.0/4.01 in particular) define the amperand as the marker for entities, just as it defines the angle bracket as the boundary of a tag, since it will be infinitely more efficient for the parsing engine to treat them as such than, say, attempting to figure out if an ampersand is the beginning of an entity or a stand-alone character by performing multiple passes or backtracking.  Because of this, every single ampersand encountered in the HTML mark-up must (at least *should*) be translated into its entity (&amp;) -- and this includes ampersands within anchor HREF URLs.  The parsing engine of the browser is supposed to make the translation seamlessly, and it works reliably in modern browsers.  There are a few exceptions, one of them being JavaScript, where the HTML parsing engine takes the entire <SCRIPT>  section and hands it verbatim to the JavaScript interpreter; so no "&amp;"'s go in there, unless of course, you know you need them for something.

    Other exceptions are data not handled at all by the HTML parser, like POST data (the form tag values, since they are HTML must use entities, but the data itself is posted to the server as their translated characters.)  And of course, the Response.Redirect code, which will be processed by the server-side ASP/VBScript interpreter, not the client-side HTML parser, and then submitted directly to the browser in an HTTP 301 response (or is it 302?).

    I just realized that I have posted a serious and technical response to a funny forum used to poke fun at other programmers. Jeez its early....

        -dZ.

  • Anonymous (unregistered) in reply to whoisfred
    whoisfred:


    I doubt many people, (if any at all) have or do get paid by the line.  I wouldn't be surprised if in the past employers used to base an employees productivity by numbers of lines, but I would hope that most employers have wised up by now and use better methods of determing productivity and program quality.


    For a while I was working for a guy who gauged programmer productivity by their network activity.  I set up a background task to loop through greps of source code to become a hero in his eyes.

  • (cs) in reply to DZ-Jay

    Bingo, DZ-Jay.

    Only HTML-encode things that are HTML.

    Things that are not HTML:

    HTTP Headers like Response.Redirect (although meta http-equiv tags ARE HTML)
    The insides of < !CDATA[[ ... ]] > blocks including:
    The insides of comments (although this doesn't matter)
    The insides of < script > ... < /script > tags with type="text/javascript"
    The insides of < style > ... < /style > tags with type="text/css"
    etc.

  • (cs) in reply to Maurits

    The best explanation - and I mean explanation, as this code obviously cannot be justified, at least not without more information than we have - is that the code originally did something (or the programmer originally expected it would) and after changing it, the coder either overlooked the fact that the two clauses were the same, or else decided to keep it this way 'just in case' it turned out to be different after all.

    The former error is an easier mistake to make than most realize, and just about every programmer has made it at some point - but the good ones notice it and fix it. Most cases aren't as obvious as this one; more often, one will have two clauses (or functions) which are coded differently, but actually have the same result (or very nearly so). It may take a bit of observation and careful thought before it is realized that the 'unrelated functions' can be folded together. A dramatic example of this was in an early version of Scheme: the language was originally designed to study 'actors' (what would today be considered a form of object), but the developers eventually noticed that the code for supporting actors was almost exactly the same as the code for supporting closures. As a result, the language was redesigned to only support closures directly, and an idiom was developed for using closures to implement actors, drastically simplifying the language while also making it more general.

    The latter error (leaving duplicate code in case it diverges again later) is a frequently used 'technique' of questionable value to avoid losing existing code after it has been changed. It is especially common in shops without effective source control - the code is retained because there is the possibility, however remote, that the current change will have to be undone . As such, it is a defensive adaptation to the poor development environment; other common ones practice of commenting out code code rather than removing it, and making multiple duplicate copies of the source tree. The solution is to fix the source control, or all too often, implementing it in the first place.

    Finally this 'technique' also raises it's ugly head as an anticipation error - the programmers think that the code may have to handle the cases differently in the future, and so wrote it this way 'just in case' so that it will be 'easier to change in the future'. While this may seem reasonable at the time, it is really a double WTF, as it not only uneccessarily complicates the current code, it almost always incorrectly anticipates the changes that will be needed, with the result that the existing code most likely will have to be scrapped and re-written with the effort put into the 'pre-fixed' code being wasted. Having made this mistake myself, I can see how a novice programmer can do this - but I also see why it is an error.

  • (cs) in reply to Schol-R-LEA
    Schol-R-LEA:
    Mike R:
    Most of the stuff I had working, and working well was completely hosed. It took many months to get the program up and running again before the company finally went under.


    If I had been in your shoes, I would have simply rolled back the source tree to the day I left and picked up from there.

    OTOH, I've worked in far too many places which either had no source control (and refused to let us set it up), or mismanaged it so badly that they might as well not have. In such places, I took to the habit of manually snapshotting the source files periodically; it never works as well and doesn't solve the other source control issues such as merging, but it was better than the alternative.


    Heh. Yep, no source control. I advocated sourcesafe, but they wouldn't buy it.
  • (cs) in reply to Mike R
    Mike R:

    Heh. Yep, no source control. I advocated sourcesafe, but they wouldn't buy it.


    Subversion is free... Don't know if it's better than SourceSafe, but it has everything I need...
  • (cs) in reply to wtijsma
    wtijsma:
    Mike R:

    Heh. Yep, no source control. I advocated sourcesafe, but they wouldn't buy it.


    Subversion is free... Don't know if it's better than SourceSafe, but it has everything I need...


    CVS could have been a better alternative, but the only thing I knew about at the time was SS. I should have backed everything up on CD and kept it in a safe-deposit box before I left. Ohh well.

  • Oracle = One Rich Asshole Called Larry Ellison (unregistered)

    Oracle to Pay $8M to Settle Suit over Training Fees
    By Lisa Vaas
    May 16, 2005

    Oracle Corp. will pay the federal government $8 million to settle a whistle-blower suit that charged the company with overbilling
    for software training. According to a statement issued on Friday by the United States Attorney's office for the District of
    Massachusetts, the suit was set in motion by a whistle-blower who was once vice president of North American Sales for Oracle University. The whistle-blower will receive $1.58 million of the total settlement amount. In the case against the Redwood Shores, Calif., database company, the United States alleged that Oracle submitted false claims for payment from 1997 through 2003. The charges were billed to various government agencies, according to the statement, and related to a contract between Oracle and the General Services Administration. Specifically, Oracle was charged with billing to and collecting from the government in advance of providing training; of "expiring" (i.e., forfeiting to Oracle) millions of dollars paid in advance for training services that weren't used within a one-year period; and failing to comply with Federal Travel Regulations in billing the federal government for travel and expenses. Although the government's statement did not disclose which federal agencies were overbilled, it did list those that sent agents to investigate: the GSA's Office of Inspector General; the FBI; the Defense Criminal Investigative Service; the Department of the Air Force's Office of Special Investigations; the Department of the Army's Criminal Investigation Command; the U.S. Department of Agriculture's Office of Inspector General; and the U.S. Postal Inspection Service.

    Oracle Can Kiss My Ass

  • l&#234; van trung (unregistered) in reply to DZ-Jay
    DZ-Jay:
    wtijsma:
    Anonymous:
    As Edsger Dijkstra put it, one should not measure lines of code produced by a programmer, but lines of code spent.


    I get paid like that. That's why I don't use VB, because you can't put all code on 1 line.


    I believe you can put it in one line.  I think you use colon ':' to separate the commands, just like you would use a semi-colon ';' in other languages.  Don't forget the "BASIC" in the "VisuaBasic" :)

        dZ.
  • (cs) in reply to Juenemann
    Bustaz Kool:
    cm5400:

    Do programmers actually get paid by the line? 

     

    There used to be an effort to apply a technique Function Points as a metric.  It was supposed to be a standard measure of productivity that was independent of language used and didn't care how many lines of code were produced; only the amount of functionality that was implemented.

    I never met anyone that actually used the technique and haven't heard much discussion about it in a while.  Has anyone else?



    I've used FPA.  Like all attempts to make estimates rigid, it basically doesn't work terribly well.  Doesn't stop it being pushed as an ISO standard, though = http://www.isbsg.org/isbsg.nsf/weben/ISO%20Std%20for%20Functional%20Size%20Measurement

    And it's better than LOC.

    Simon
  • (cs) in reply to whoisfred

    whoisfred:

    So, basically you took time out to say one of two things to me:

    A)  You are an idiot.

      -or-

    B)  You aren't funny.

    Why be so negative?

    Actually I believe he was saying this:

    if( you were serious )

    {

       You're an idiot.

    }

    else

    {

       You're an idiot.

    }

  • shawn (unregistered)

    also, that will through an exception if the user chops off the querystring

Leave a comment on “Damned IF You Do, Damned ELSE You Don't”

Log In or post as a guest

Replying to comment #:

« Return to Article