• airdrik (unregistered) in reply to Mike
    Mike:
    Zylon:
    4Reel:
    This explains very succinctly why dynamic typing bothers me. I'm sure there's a more graceful way to deal with it, and it's not like THIS is required, but still - having to fight with the interpreter so that it treats a value as the data-type I want defeats the point of an ultra-high level language.
    Are you dumb, or trolling? The only time you should have to "fight" to maintain the correct data type is when accepting unsanitized input or doing type coercision... which is the exact same thing you have to do with strictly-typed languages.

    The real issue is auto-casting, not dynamic typing. Both Javascript, which is dynamically typed, and Java, which is strongly typed, will screw you here. Java at least tells you what kind of things you're passing around though. This mostly helps the guy who shows up after you to have half a chance of understanding what you were trying to do.

    Javascript: document.write( '1' + 1 ); Output is "11"

    Java: System.out.println( "1" + 1 ): Output is "11"

    At least they're consistent! unlike php:

    <?
    echo "1" + 1
    ?>
    

    output is "2"

  • by (unregistered)

    All this crap about overpaid consultants, is just that... Crap (and bitterness/envy too). Anytime I hear this, it always brings to mind the argument that VB (.NET) is SOOO much worse than C#.

    Also, these are usually the comments of a FTer who is too weak-kneed to do the independant thing, and that's FINE (honeslty)! If your lifestyle wouldn't support it (kids, house, etc.), then do what is right for you. Just don't go that route and then thumb your nose at someone who does go independent. And remember folks, that 100 or 200 /hr (probably not directly into his pocket, but the company he works for most likely) is all that a contractor will EVER see. No bonus, no vacation pay, no sick days, no medical coverage, etc.

    And one more thing, at the end of the day there are crappy consultants and there are crappy FTers as I have worked with both types (I am a consultant). Your tax status doesn't make you a good/bad developer.

  • Spoiled Orange (unregistered)

    I could probably defend function #2 using keywords such as: encapsulation, logic containment and future feature planning.

    However my bet is that this one is some kind of ghost code. Either that or heavy case of idiocy.

  • Jay (unregistered) in reply to Lucas
    Lucas:
    About this $200/hr, do they actually charge $200/hr for everyone in the team who wrote funny lines of code, or you just see the invoice and assume that there aren't like 5 other $20/hr programmers from another continent behind this $200/hr consultant?

    Please, my question is serious. I can kind of program and I would like to go up from $20 to $200.

    The catch is that the fact that the client is billed $200 per hour does not mean that the programmer is paid $200 per hour. I used to be a consultant, and I on occassion was called on to assist in contract negotiations so that I saw the rates the company was charging, and let's say that they were charging a lot more for my time then they were paying me. I don't recall it hitting $200 per hour, but I think the rule of thumb was that they billed about twice what they paid you.

    Some of this is quite reasonable. After all, the company pays me when I'm on vacation, but they can't bill the client for my vacation time. They have to pay taxes on my salary. They supply me with medical benefits. All of that costs and the money has to come from somewhere. Plus they have to have marketing and human resources people who presumably want to be paid too, but they can't directly bill the client for them, so it all gets billed in to the rates.

    But double? That seems excessive.

  • Jay (unregistered) in reply to Zylon
    Zylon:
    4Reel:
    This explains very succinctly why dynamic typing bothers me. I'm sure there's a more graceful way to deal with it, and it's not like THIS is required, but still - having to fight with the interpreter so that it treats a value as the data-type I want defeats the point of an ultra-high level language.
    Are you dumb, or trolling? The only time you should have to "fight" to maintain the correct data type is when accepting unsanitized input or doing type coercision... which is the exact same thing you have to do with strictly-typed languages.

    In a strongly-typed language, if I want to know that data type of a variable, I look for the declaration and it tells me the data type. Period. In a weakly-typed language, I have to study every place in the code where the variable is set. As most of them are likely set from other variables, I have to check where those are set, and so on and so on. If there's a variable that sometimes contains a string and sometimes contains an integer, then to know the data type at any given point in the code I have to study every possible path to that point. And please, don't tell me that you shouldn't use the same variable to contain different data types. The question isn't what you should do but what the previous programmer actually did.

  • (cs) in reply to frits
    frits:
    Someone You Know:
    Say what you want about the first one, but at least it does something.

    The use of the var keyword in the second one makes it a no-op.

    Returning the parameter untouched makes it worse than a noop due to function call overhead.

    I believe a good compiler will actually recognize this and remove it from the compiled code. In the end you get the parameter with no function overhead.

  • EatenByAGrue (unregistered) in reply to Jay
    Jay:
    Zylon:
    4Reel:
    This explains very succinctly why dynamic typing bothers me. I'm sure there's a more graceful way to deal with it, and it's not like THIS is required, but still - having to fight with the interpreter so that it treats a value as the data-type I want defeats the point of an ultra-high level language.
    Are you dumb, or trolling? The only time you should have to "fight" to maintain the correct data type is when accepting unsanitized input or doing type coercision... which is the exact same thing you have to do with strictly-typed languages.

    In a strongly-typed language, if I want to know that data type of a variable, I look for the declaration and it tells me the data type. Period. In a weakly-typed language, I have to study every place in the code where the variable is set. As most of them are likely set from other variables, I have to check where those are set, and so on and so on. If there's a variable that sometimes contains a string and sometimes contains an integer, then to know the data type at any given point in the code I have to study every possible path to that point. And please, don't tell me that you shouldn't use the same variable to contain different data types. The question isn't what you should do but what the previous programmer actually did.

    On the flip side, in a weakly-typed language, it's far easier to reuse an algorithm for something other than its original intended purpose. It's also much easier to write unit tests, because you don't have to jump through hoops to make your mocked out test object look enough like the real thing to allow a call the the code under test using the test object.

    An example: Let's say you have some method to multiply everything in an array by 2. Simple enough, right? But in a strongly typed language, you're likely to end up with different code to do the same thing on integers, on floats, on Integer wrapper objects, on Double wrapper objects, on objects that represent an amount in US currency, or on something you hadn't even thought up that's capable of being multiplied by 2.

    You're right that the challenge in weakly-typed languages is figuring out what you actually got handed to a particular method. But it does give you a ton of flexibility.

  • Some Wonk (unregistered)

    But how do you increment by 11?

  • DWalker (unregistered) in reply to XXXXX
    XXXXX:
    Given any function for doing something, there must necessarily exist a less-efficient way of doing the same thing.

    How to sort an array:

    1. Permute the elements in random order.
    2. See if the array is sorted. If so, you're done.
    3. If not, repeat from step 1.
  • (cs) in reply to DWalker
    DWalker:
    XXXXX:
    Given any function for doing something, there must necessarily exist a less-efficient way of doing the same thing.

    How to sort an array:

    1. Permute the elements in random order.
    2. See if the array is sorted. If this is the first time sorting was successful, go to step 1. Otherwise, you're done.
    3. Repeat from step 1.
    Improved that for you.
  • Spoiled Orange (unregistered) in reply to DWalker

    Someone told me this kind of thinking has its uses:

    1. You write code on a small subset of data on Greenfield project
    2. Few months later when dataset grow you make profit on optimizing it (let's say divide set into two smaller set and sort independently)
    3. Repeat 2) until fired or sued
  • (cs) in reply to Shial
    Shial:
    frits:
    Someone You Know:
    Say what you want about the first one, but at least it does something.

    The use of the var keyword in the second one makes it a no-op.

    Returning the parameter untouched makes it worse than a noop due to function call overhead.

    I believe a good compiler will actually recognize this and remove it from the compiled code. In the end you get the parameter with no function overhead.

    I believe that your belief is liberal in its optimism.

  • Delicious pie is delicious. (unregistered) in reply to DWalker
    DWalker:
    XXXXX:
    Given any function for doing something, there must necessarily exist a less-efficient way of doing the same thing.

    How to sort an array:

    1. Permute the elements in random order.
    2. See if the array is sorted. If so, you're done.
    3. If not, repeat from step 1.

    We need to enhance this process with the cloud.

    1. Send copies of the array... to the cloud!
    2. Each node then cloud permutes its copy of the array.
    3. Nodes cloud report back whether or not their cloud copy is sorted.
    4. Through the synergy of the cloud, verify whether or not there is a cloud consensus as to the cloud-sortedness of the array.
    5. Finally, utilize the cloud to transmit a cloud-protocol report with the cloud sorted cloud array.
  • (cs)

    That first one reminds me of some of the crappiest code I ever had to become a software maintenance field service engineer for:

    int IncrementInteger (int i) { /* Function name: IncrementInteger : : : 63 more lines of mandatory function header boilerplate : : */

    return i++; }

    ... or whatever the syntax is. Long time since I wrote code.

  • Douglas (unregistered) in reply to frits
    frits:
    Someone You Know:
    Say what you want about the first one, but at least it does something.

    The use of the var keyword in the second one makes it a no-op.

    Returning the parameter untouched makes it worse than a noop due to function call overhead.

    A no-op is an operation that does nothing. There is nothing in the definition of "no-op" about how much overhead it should or should not have. A no-op can even have side effects; This is often exploited in microprocessors to byte-align instructions.

  • Refugee from another Universe (unregistered) in reply to DWalker
    DWalker:
    XXXXX:
    Given any function for doing something, there must necessarily exist a less-efficient way of doing the same thing.

    How to sort an array:

    1. Permute the elements in random order.
    2. See if the array is sorted. If so, you're done. 3. Otherwise, destroy the universe; the problem was solved in another one.

    The details of step 3 are left as an exercise for the reader.

    Much better, assures O(n) running time.

    As for the WTF itself, the first one isn't so bad. The second one is just pure WTF. I can maybe understand a function where you were too lazy to use a refactoring tool to fix every single call and just went "return input;", but this is just absurd.

  • Crash (unregistered) in reply to airdrik

    Sure, that would seem silly if you're used to Java but at least PHP's concatenation operator always means concatenate and its addition operator always means add. They are not interchangeable and they don't do different things depending on the operands' types.

  • My Name (unregistered) in reply to Hans
    Hans:
    function IncrementByOne(input) {
        var output = parseInt(input);
        return output + 1;
    }

    and then call

    IncrementByOne('08')

    and watch the sparks ...

    I do not see any sparks. The result is 9. Note: If there is a leading zero, octal interpretation is taken into consideration. Finding a non-octal character, like '8' in this case, makes parseInt drop the octal alternative. Your example does not make sense unless you go and make the string consist of three numeric characters each representing a number lower than 8. Such a string would be '017', for example.

    As for dynamic typing and auto-casting I can only quote a piece I posted here before:

    My Name:
    $root = 'Universe';
    

    $$root .= " ".!substr($root, -(false===!1)).L.substr($root, "2", true).f.substr($root, strlen($root)-strlen(true), !!$root); $of[false] = "Don't try this at home!"; $of = strtolower(substr("$of", false, true).substr($$root, true, true)); $of .= substr($of, true, true); $$of = 't'.substr("Oh my god", true, "I'm going to throw up!"+true).substr($$root, -strlen(t)); $$$of = $root; $$$of = $$of.substr($$root, false, true).strtoupper($of[0]).str_replace(substr($the, false, true), false, $$$of); $$$root = strtolower(substr($$$of, $love-1).substr($$$of, "7", true).substr(ltrim($$root), true, true).substr($$root, !!$of[true], !!$root[true])); $$$of = substr($$$of, $love, 6).substr($$$of, -(true+$of[null]+1), true).w.substr($root, $root[28]+true3+1, !null+1); $$$$root .= strtoupper(substr($$$root, -1null, pow(pi(), false))).substr($root, (!$root[128]+true)*-2.5, !null+2).y.substr($$$of, false, floor(sqrt(8))); $$$$root .= substr(ltrim($$root), true, true).$root[true].g; $$of = strtolower(substr(strstr($$$of, substr($$root, !$root[4], 1)), round(sqrt(true+true)), '1')).($root[1].d); $of = $root; $root = substr("goto hell", true+true, true+true).$$root.','; echo "PHP is $the $root $of $all $evil!";

  • ÃÆâ€à (unregistered)

    They probably got paid per line of code.

  • moz (unregistered) in reply to DWalker
    DWalker:
    XXXXX:
    Given any function for doing something, there must necessarily exist a less-efficient way of doing the same thing.

    How to sort an array:

    1. Permute the elements in random order.
    2. See if the array is sorted. If so, you're done.
    3. If not, repeat from step 1.
    I don't get you and your permutation. You've got a computer, so you may as well take advantage of it:
    1. Make a copy of the array.
    2. Write random numbers all over the copy.
    3. If the array isn't sorted (or if the comparison function gives an error), go to 2.
    4. If the copy doesn't contain the same elements as the original, go to 2.
    5. Replace the original with the copy.
  • My Name (unregistered) in reply to Crash
    Crash:
    Sure, that would seem silly if you're used to Java but at least PHP's concatenation operator always means concatenate and its addition operator always means add. They are not interchangeable and they don't do different things depending on the operands' types.

    May I present:

    Dots vs. Dots in PHP 5.3.1:
    echo "-". 1.1; // No error, output: -1.1
    echo "-". 1 . 1; // No error, output -11
    echo "-".1.1; // Error
    echo "-".1 .1; // Error
    echo "-". 1. 1; // Error
    echo "-".1. 1; // Error
    echo '

    -'. 1 .!"0". 1.-5; // No error, output: -5 echo "-". 1 .!"0". 1.-18; // No error, output: -129 echo "-". 1 .!"0". 1.-233; // No error, output: -344

    Disclaimer: I do not take any responsibility for damages caused by this code. Use at your own risk. Plea: Do not use.

  • My Name (unregistered) in reply to My Name

    Sorry, forgot to clear things up:

    addendum:
    echo "-". 1 .!"0". 1; // No error, output: -111
    For those among us who have never touched PHP and never will.
  • NH (unregistered)

    The IncrementByOne actually makes sense when you run JavaScript since there is no real typing of variables and was the input value stored in a text field between the iterations it was actually a text string.

    However I would have done parseInt(input, 10) to make sure since the regular parseInt(input) function thinks it's octal if the value is preceded by a zero.

  • Zapp Brannigan (unregistered) in reply to pfoof
    pfoof:
    octal:
    What happens if the string begins with "0" - don't you need parseInt(input, 10) ???

    And doesn't "increment" mean "add one" anyway. IncrementByOne is tautological...

    Can you not increment by two?
    Yes, call the function twice.

  • (cs)

    So here are the WTFs I see: 1)

    Now we normally don’t expect source code from vendor software, but this was specifically in our contract. Partially because they wrote it on our dime, but mostly because we needed to do some serious customization to make it work.

    So, you contracted them to do work with the understanding that you would have to customize the work you contracted them to do? What idiot writes your contracts?

    1. What language is that? It looks like Javascript. Please tell me you didn't wait months and months to get the source code to a Javascript project...
  • (cs) in reply to Delicious pie is delicious.
    Delicious pie is delicious.:
    DWalker:
    XXXXX:
    Given any function for doing something, there must necessarily exist a less-efficient way of doing the same thing.

    How to sort an array:

    1. Permute the elements in random order.
    2. See if the array is sorted. If so, you're done.
    3. If not, repeat from step 1.

    We need to enhance this process with the cloud.

    1. Send copies of the array... to the cloud!
    2. Each node then cloud permutes its copy of the array.
    3. Nodes cloud report back whether or not their cloud copy is sorted.
    4. Through the synergy of the cloud, verify whether or not there is a cloud consensus as to the cloud-sortedness of the array.
    5. Finally, utilize the cloud to transmit a cloud-protocol report with the cloud sorted cloud array.

    Shouldn't you be storing individual elements in the cloud, then each time you need to do a comparison, fetch each of the elements from the cloud to do the comparison, write them back into their new positions?

  • SG_01 (unregistered)

    If they didn't want to keep octal compatibility, would they have used this instead?

    function IncrementByOne(input) {
        return ++input;
    }
    

    CAPTCHA: similis - Because it's similar.

  • (cs) in reply to EatenByAGrue
    EatenByAGrue:
    On the flip side, in a weakly-typed language, it's far easier to reuse an algorithm for something other than its original intended purpose. It's also much easier to write unit tests, because you don't have to jump through hoops to make your mocked out test object look enough like the real thing to allow a call the the code under test using the test object.

    An example: Let's say you have some method to multiply everything in an array by 2. Simple enough, right? But in a strongly typed language, you're likely to end up with different code to do the same thing on integers, on floats, on Integer wrapper objects, on Double wrapper objects, on objects that represent an amount in US currency, or on something you hadn't even thought up that's capable of being multiplied by 2.

    You're right that the challenge in weakly-typed languages is figuring out what you actually got handed to a particular method. But it does give you a ton of flexibility.

    What madness is this? Reuse an algorithm for something other than its original intended purpose? Code to handle something I hadn't even thought up? WTF?

    It's not that anything you're saying about weakly-typed languages is wrong; it just doesn't make sense from a development perspective. Why is the flexibility you describe a top priority? How often do you write code to be used for something other than the actual reason you're writing it in the first place? Is it really expected of us developers to write code that does things we don't intend?

    I never go about designing software this way. I write code with an intended purpose in mind. If someone wants to use it for something else, it's their concern. I can't be bothered to try hopelessly to satisfy business requirements that don't exist. That only slows down development for me.

    As for your example, I have to question whether this overly-complex situation is a fault of the language, or a fault of the design. Why so many data types that need to be multiplied by 2 while in arrays? Why do the arrays need to store them as different types? Certainly there may be other solutions that depending on weak-typing to just magically solve your problems (even for objects that you hadn't even thought up that's capable of being multiplied by 2).

    Don't get me wrong, I'm a big fan of weakly-typed languages; there are some tasks that weakly-typed languages are fantastic for. But the above defense of them is just nonsense.

  • Gary (unregistered) in reply to encre
    encre:
    Could we fall back on Newspeak and describe this as double-plus-ungood?
    ungood++
    - but that would only increment ungood by one.
    ungood**
    and that squares ungood.

    I think I'm looking for

    2*++ungood
    Thus double plus ungood is equivalent to "double plus plus ungood."

  • Darth Paul (unregistered) in reply to by
    by:
    All this crap about overpaid consultants, is just that... Crap (and bitterness/envy too). ... And remember folks, that 100 or 200 /hr (probably not directly into his pocket, but the company he works for most likely) is all that a contractor will EVER see. No bonus, no vacation pay, no sick days, no medical coverage, etc. ...

    Add to this the unreliability of obtaining work may mean up to 6 months a year without income, plus having to buy all your own training, software, hardware, etc, to stay on top of things. It's a mugs game compared to being in the permanent workforce.

    On top of this, consultants are sometimes sabotaged by jealous colleagues and scapegoated (hired only to take the blame for a project that was always intended to fail).

  • (cs) in reply to My Name
    My Name:
    As for dynamic typing and auto-casting I can only quote a piece I posted here before:
    My Name:
    $root = 'Universe';
    

    $$root .= " ".!substr($root, -(false===!1)).L.substr($root, "2", true).f.substr($root, strlen($root)-strlen(true), !!$root); $of[false] = "Don't try this at home!"; $of = strtolower(substr("$of", false, true).substr($$root, true, true)); $of .= substr($of, true, true); $$of = 't'.substr("Oh my god", true, "I'm going to throw up!"+true).substr($$root, -strlen(t)); $$$of = $root; $$$of = $$of.substr($$root, false, true).strtoupper($of[0]).str_replace(substr($the, false, true), false, $$$of); $$$root = strtolower(substr($$$of, $love-1).substr($$$of, "7", true).substr(ltrim($$root), true, true).substr($$root, !!$of[true], !!$root[true])); $$$of = substr($$$of, $love, 6).substr($$$of, -(true+$of[null]+1), true).w.substr($root, $root[28]+true3+1, !null+1); $$$$root .= strtoupper(substr($$$root, -1null, pow(pi(), false))).substr($root, (!$root[128]+true)*-2.5, !null+2).y.substr($$$of, false, floor(sqrt(8))); $$$$root .= substr(ltrim($$root), true, true).$root[true].g; $$of = strtolower(substr(strstr($$$of, substr($$root, !$root[4], 1)), round(sqrt(true+true)), '1')).($root[1].d); $of = $root; $root = substr("goto hell", true+true, true+true).$$root.','; echo "PHP is $the $root $of $all $evil!";

    How the hell......................??????????????? Also, generates 13 undefined variable and undefined constant messages.

  • (cs) in reply to Darth Paul
    Darth Paul:
    by:
    All this crap about overpaid consultants, is just that... Crap (and bitterness/envy too). ... And remember folks, that 100 or 200 /hr (probably not directly into his pocket, but the company he works for most likely) is all that a contractor will EVER see. No bonus, no vacation pay, no sick days, no medical coverage, etc. ...
    I have given my consultation. Pray I don't bill you more.
    FTFY
  • Pentium100 (unregistered) in reply to immibis
    immibis:
    My Name:
    As for dynamic typing and auto-casting I can only quote a piece I posted here before: ...snip...
    How the hell......................??????????????? Also, generates 13 undefined variable and undefined constant messages.
    Interesting, I tried to run it on my web server and the output was
    PHP is the Answer to Life, Universe and Everything!
  • (cs) in reply to Sudo
    Sudo:
    bjolling:
    Non-consultant:
    This kind of thing is all too common from consultants... :S
    buji:
    That always happens with code written by $200/hr consultants..

    Captcha - populus

    http://en.wikipedia.org/wiki/Populus

    I'm €125/hr consultant and the only comments I receive from a client's code review is that my code is perfect. Of course, they also have to review what their offshore teams are checking in :-)
    Perhaps that's where so many coders are going wrong... if they stopped using dollars and switched to euros, maybe their code quality would improve?...

    I charge in GB pounds. The quality of my code is undefined.

    So true. Maybe the offshore teams charge in Indian Rupee? The quality of their code is non-existing

  • KRao (unregistered) in reply to bjolling
    bjolling:
    Sudo:
    bjolling:
    Non-consultant:
    This kind of thing is all too common from consultants... :S
    buji:
    That always happens with code written by $200/hr consultants..

    Captcha - populus

    http://en.wikipedia.org/wiki/Populus

    I'm €125/hr consultant and the only comments I receive from a client's code review is that my code is perfect. Of course, they also have to review what their offshore teams are checking in :-)
    Perhaps that's where so many coders are going wrong... if they stopped using dollars and switched to euros, maybe their code quality would improve?...

    I charge in GB pounds. The quality of my code is undefined.

    So true. Maybe the offshore teams charge in Indian Rupee? The quality of their code is non-existing

    Yes. And you're totally right about the quality of code being dependent on the geographical location of the coder. You probably ought to draw a map of all that and share it with us.

  • My name (unregistered) in reply to 4Reel

    Of course, this has nothing to do with dynamic typing. It is no problem to define in a statically typed language an operator string operator + (string, number) that return a string concatination. On the other hand, there are dynamically typed languages like Smalltalk, where '111' + 1 raises an error.

  • My Name (unregistered) in reply to Pentium100
    Pentium100:
    immibis:
    My Name:
    As for dynamic typing and auto-casting I can only quote a piece I posted here before: ...snip...
    How the hell......................??????????????? Also, generates 13 undefined variable and undefined constant messages.
    Interesting, I tried to run it on my web server and the output was
    PHP is the Answer to Life, Universe and Everything!

    Note that I neither support the statement "PHP is the Answer to Life, Universe and Everything!" nor "PHP is the root of all evil!". In my opinion, PHP can be used in a good way, and might be helpful at times, but it is by far not the best (not even script) language out there. The root of all evil, however, sits in front of the computer and/or in that person's environment. I, for example, have been given a book as a present that suggests using PHPs ability to parse variables inside of strings, e.g. $root = "bar"; $tree = "foo$root"; wherein $tree == "foobar"; would evaluate as true. I'm happy to have learned about this possibility's downsides; luckily I never even used it. So, do not always see the scripter/programmer as the only one at fault, but also his environment.

  • (cs) in reply to Sudo
    Sudo:
    I charge in GB pounds. The quality of my code is undefined.
    I also charge in GB pounds. My code is of sterling quality.
  • A Concerned Citizen (unregistered)

    The problem isn't dynamic typing, it's weak typing.

    Python is a dynamic language but throws an error if you attempt to add an int to a string. The same operator is used for adding ints, floats or Decimals, and concatenating strings, sets or lists. You can even overload operators where appropriate. Python has strong typing.

    In PHP and JavaScript this doesn't quite work. If you slap random values together, you might end up with very different types depending on what the language decides you intended. The concatenation operator in PHP is based on the language's desperate attempts to avoid ambiguity.

  • (cs) in reply to A Concerned Citizen
    A Concerned Citizen:
    The problem isn't dynamic typing, it's weak typing.

    Python is a dynamic language but throws an error if you attempt to add an int to a string. The same operator is used for adding ints, floats or Decimals, and concatenating strings, sets or lists. You can even overload operators where appropriate. Python has strong typing.

    In PHP and JavaScript this doesn't quite work. If you slap random values together, you might end up with very different types depending on what the language decides you intended. The concatenation operator in PHP is based on the language's desperate attempts to avoid ambiguity.

    Desperate, and yet failed. See examples a few comments before. They probably said "ah, that cannot fail" and used it. What is next, if at all? Comma? Underscore? Colon? Two colons? Spaces? Who knows ... Ah, I know the best alternative! Circumflex ftw!

    PS: It was about time to register...

  • (cs) in reply to Mike
    Mike:
    Javascript: document.write( '1' + 1 ); Output is "11"

    Java: System.out.println( "1" + 1 ): Output is "11"

    C++: std::cout << "1" + 1 << std::endl; Output is a blank line.
  • Stefan (unregistered)

    At least now you know why they don't want to deliver their source code. Though it's definately "Enterprise release standard" and might be supportable by their $200/hr consultants.

    :-D

  • Amardeep Kolawar (unregistered)

    Will above code work with jQuery ? Pls post example .

  • Thomas (unregistered) in reply to XXXXX
    XXXXX:
    Given any function for doing something, there must necessarily exist a less-efficient way of doing the same thing.

    Thus I submit the following as a 1000 fold improvement to their design.

    function AssignStringInToOut(input) {
        for (var i = 0; i < 1000; i++) {
          var output = input;
        }
        return input;
    }
    

    You've reinvented the speed-up loop: http://thedailywtf.com/Articles/The-Speedup-Loop.aspx

  • wito (unregistered)

    At least it's clear. captcha: eros

  • (cs) in reply to KRao
    KRao:
    bjolling:
    Sudo:
    bjolling:
    Non-consultant:
    This kind of thing is all too common from consultants... :S
    buji:
    That always happens with code written by $200/hr consultants..

    Captcha - populus

    http://en.wikipedia.org/wiki/Populus

    I'm €125/hr consultant and the only comments I receive from a client's code review is that my code is perfect. Of course, they also have to review what their offshore teams are checking in :-)
    Perhaps that's where so many coders are going wrong... if they stopped using dollars and switched to euros, maybe their code quality would improve?...

    I charge in GB pounds. The quality of my code is undefined.

    So true. Maybe the offshore teams charge in Indian Rupee? The quality of their code is non-existing
    Yes. And you're totally right about the quality of code being dependent on the geographical location of the coder. You probably ought to draw a map of all that and share it with us.
    Yeah, I'll add it to the slide deck that proves that consultants produce inferior code than full time employees

  • Jay (unregistered) in reply to boog
    boog:
    What madness is this? Reuse an algorithm for something other than its original intended purpose? ... Is it really expected of us developers to write code that does things we don't intend?

    I routinely expect the code written by developers I work with to do things other than what they intend. (Not mine, of course!)

  • 4Reel (unregistered) in reply to Zylon
    Zylon:
    4Reel:
    This explains very succinctly why dynamic typing bothers me. I'm sure there's a more graceful way to deal with it, and it's not like THIS is required, but still - having to fight with the interpreter so that it treats a value as the data-type I want defeats the point of an ultra-high level language.
    Are you dumb, or trolling? The only time you should have to "fight" to maintain the correct data type is when accepting unsanitized input or doing type coercision... which is the exact same thing you have to do with strictly-typed languages.

    How about option 3 - student? I'm still working on my bachelor's degree in Computer Science. I visit this website because I enjoy learning about software development, and I posted my opinion. If it's based on incorrect information (which is debatable - I disagree with you), I'd appreciate being corrected.

    ...but please, continue to be obnoxious - nobody should ENJOY learning.

  • drobnox (unregistered) in reply to Ken B.
    Ken B.:
    frits:
    I wonder if Jose C's middle intial is B.
    Actually, his middle name is "Cañu".

    He lives in Donzerly near the lighthouse.

  • iceykitsune (unregistered) in reply to Scott

    J2EE?

Leave a comment on “Enterprise Incrementation”

Log In or post as a guest

Replying to comment #:

« Return to Article