• (cs) in reply to coyo
    coyo:
    WTF?

    DIM X as variant DIM Y as variant X = true; Y = false; if( val(X) = val(Y) ) THEN MSGBOX("Visual Basic is AWSOME") END

    (should quit while I'm ahead)

    You can write crap in any language. You can't blame VB for your lack of strongly typing variables, coercing booleans to numbers, or using built-in functions that were obsoleted four versions ago. The IDE will also take your intentionally childlike capitalization and make is more professional.

  • Billy Mac (unregistered) in reply to Xenon Xavior
    Xenon Xavior:
    I thought the original reason to port to Windows was so that all the engineers could run their own copy of the software...
    No -- the original reason to port to Windows was so that all the engineers could play Solitaire in Windows.
  • potiguar (unregistered) in reply to Hired Gun
    Hired Gun:
    Anonymous:
    Using VB for scientific computing is like hiring a 3rd grader as a research assistant.

    Oh, come on. Do you REALLY think that the language an application is written in makes any difference?

    Yes, there were a lot of things that couldn't be done in VB that were available in C, but that doesn't invalidate VB as a platform. My motorcycle can't pull my boat, but my truck can. That doesn't invalidate my motorcycle as a method of transportation, does it?

    Here are the criteria for choosing a language to develop a project in:

    1. Does the customer's existing hardware support the platform, or are they willing to purchase the necessary hardware?

    2. Is the language anticipated to be supported for the duration of the program's life cycle?

    3. Does the language include all the functions necessary to meet the requirements of the application and the customer's security/distribution requirements?

    4. Is there a supply of programming talent sufficiently proficient in the language available to the customer to maintain the project for the duration of the program's life cycle?

    If your choice meets those requirements, then it's a valid choice.

    If you give a master carpenter a job to do, he may prefer his DeWalt tools over the Ryobi, but he can still do every bit as good a job with the Ryobi tools.

    Enough of this prima-donna "My language is better than yours" crap. We're supposed to be programmers, not evangelists. Anyone who knows what they're doing in programming should be able to function in anything from Q-BASIC to assembly, if given time to learn the syntax.

    Programming is about problem solving. If you can't think critically and solve problems, then you can't program. If you can solve problems, then the language doesn't mean squat as long as you learn it.

    Best... post... ever!

  • (cs) in reply to coyo
    coyo:
    WTF?

    DIM X as variant DIM Y as variant X = true; Y = false; if( val(X) = val(Y) ) THEN MSGBOX("Visual Basic is AWSOME") END

    (should quit while I'm ahead)

    Proper VB:

    Dim x = True
    Dim y = False
    If x = y Then
      MessageBox.Show("Visual Basic is AWESOME")
    End If
    --------------------

    Proper C#:

    var x = true;
    var y = false;
    if (x==y)
    { 
      MessageBox.Show("C# is AWESOME");
    }
    VB is only 2 bytes longer and actually takes fewer vertical lines and fewer keystrokes with Intellisense. Of course, I'm discounting the fact that "C#" is shorter than "Visual Basic".
  • swordfishBob (unregistered) in reply to Hired Gun
    Hired Gun:

    Oh, come on. Do you REALLY think that the language an application is written in makes any difference? ..... 1)2)3)4) ... If your choice meets those requirements, then it's a valid choice.

    If you give a master carpenter a job to do, he may prefer his DeWalt tools over the Ryobi, but he can still do every bit as good a job with the Ryobi tools...

    I was agreeing with you up to this point. Try driving a lot of tek screws with a Ryobi, and you'll discover why they're cheaper than DeWalt. If you said "cabinet maker" then sure. I guess that still illustrates there are situations where basic (ahem) tools are fine, and situations that they don't scale to as well.
  • AA (unregistered) in reply to Jaime
    Jaime:
    Yup. Also, in VB.Net you use the following line of code to round:
    x = Math.Round(12.5)

    It rounds to the nearest even whole number. In C#, the equivalent code is:

    x = Math.Round(12.5);

    It also rounds to the nearest even number. If you want to round to up, use:

    x = Math.Round(12.5, MidpointRounding.AwayFromZero)

    Of course, in C#:

    x = Math.Round(12.5, MidpointRounding.AwayFromZero);

    I fail to see any eveidence that VB is a toy language because it doesn't round properly and C# is a professional language because it rounds properly.

    Do you really not know the difference between VB and VB.NET?

  • AA (unregistered) in reply to Jaime
    Jaime:
    VB is only 2 bytes longer and actually takes fewer vertical lines...
    That's because two of the C# lines are braces. Which you don't actually need in your example.

    Claiming that one language is more "compact" than another when you're deliberately adding cruft to one of them kind of invalidates your position.

  • coyo (unregistered) in reply to Jaime
    Jaime:
    You can write crap in any language. You can't blame VB for your lack of strongly typing variables, coercing booleans to numbers, or using built-in functions that were obsoleted four versions ago. The IDE will also take your intentionally childlike capitalization and make is more professional.

    No doubt, but that's still a crappy way to handle boolean values. The VB from 'versions ago' changed it from my favorite language to a big headache source. The code in question was to detect state change, but let "100" be equivalent to "10E1".

    It's rather dogmatic to say "variables should always be strongly typed". Other languages get it right. VB never did, it was always just off.

    Makes it feel like a toy.

    It could not handle more then 64k/module. This occasionally meant stripping out comments and formatting whitespace.

  • coyo (unregistered) in reply to potiguar

    [quote user="potiguar"][quote user="Hired Gun"][quote user="Anonymous"]Using VB for scientific computing is like hiring a 3rd grader as a research assistant. [/quote]

    Oh, come on. Do you REALLY think that the language an application is written in makes any difference? .... Best... post... ever![/quote]

    It was a good post.

    1. Is the language anticipated to be supported for the duration of the program's life cycle?

    That was a problem with VB. Write something in VB2, it would run until VB3 came out. At that time, you would need to not only recompile the app, but rewrite parts of it to follow the changing syntax and COM updates. If your users updated windows, the program would often break or worse yet, behave subtly different.

    I'm sure .NET is a lot less of a headache now, but I'd been burned to much to put any trust in the VB team.

  • Krenn (unregistered) in reply to ed
    ed:
    What do those variables fire?

    10mm explosive tipped caseless hex codes. Standard light armour piercing round. Why?

    Well do you see where your primary keys are? They're right under the primary heat exchangers.

    Alright, everyone. Give me your IDE's. XML and perl scripts only.

  • coyo (unregistered) in reply to Krenn
    Krenn:
    ed:
    What do those variables fire?

    10mm explosive tipped caseless hex codes. Standard light armour piercing round. Why?

    Well do you see where your primary keys are? They're right under the primary heat exchangers.

    Alright, everyone. Give me your IDE's. XML and perl scripts only.

    Do vi, pico and emacs count as IDEs?

  • Anonymously Yours (unregistered) in reply to Yaos
    Yaos:
    The engineers were just making the program memory efficient, back in those days memory was expensive. Why take up memory for a background color and a variable when you can use both to do the same thing?
    Probably because it means the form's color will fluctuate wildly. After 186 entries, the form will be bright blue. After 187 it will be dark grey. One can only hope all of the labels have separate background colors apart from the form (unlikely with these guys), or users will wind up running extra checks just to get the damned thing readable again.
  • coyo (unregistered) in reply to Anonymously Yours
    Anonymously Yours:
    Yaos:
    The engineers were just making the program memory efficient, back in those days memory was expensive. Why take up memory for a background color and a variable when you can use both to do the same thing?
    Probably because it means the form's color will fluctuate wildly. After 186 entries, the form will be bright blue. After 187 it will be dark grey. One can only hope all of the labels have separate background colors apart from the form (unlikely with these guys), or users will wind up running extra checks just to get the damned thing readable again.

    I was not about being efficient. It was about being clever and cute or at best out of habit. Memory in the 90s was more than sufficient for the use in question. It made debugging...unlikely.

  • Billy Mac (unregistered) in reply to Jaime
    Jaime:
    You can write crap in any language. You can't blame VB for your lack of strongly typing variables, coercing booleans to numbers, or using built-in functions that were obsoleted four versions ago. The IDE will also take your intentionally childlike capitalization and make is more professional.
    I'm speaking as someone who has coded for 20+ years in assembly, C, C++, C#, Java, etc, etc and VB (with my latest specialties being porting VB6 apps to Java as well as porting multi-threaded Windows programs written in C to the various UNIX platforms also in C.)

    Whenever I am asked for my opinion of VB, my standard reply is: "The best thing about VB is that everyone can write a program in VB while the worst thing about VB is that everyone can write programs in VB." In other words, I agree with you. If you're a crappy programmer, you will write crap in VB and any other language. If you're a good programmer, you will be able to write good programs in VB, that is, good programs that are within the limitations of VB. Substitute the name of any programming language with "VB" in the previous sentence and it will still be true.

    And please don't forget - - my opinions here are worth every penny that you're paying me.

  • Robert Hanson (unregistered) in reply to Hired Gun
    Hired Gun:

    Oh, come on. Do you REALLY think that the language an application is written in makes any difference?

    Not to start a flame war, but one important consideration is the amount of time it takes to write the code. My time is not cheap. If I can do it in assembly, fine; but why not write it in ruby, where I get orders of magnitude of productivity improvement? There is a reason for all these languages. Some languages make expressing certain concepts much easier than others.

  • The Bytemaster (unregistered) in reply to Fedaykin
    Fedaykin:
    The real WTF here is VB, and I say that not only becuase it's a toy language, but because it's not a language appropriate for scientific calculation.
    Of course now microsoft is dropping the .NET from "VB.NET" and just calling it VB 10, so it seems - so this will get more confusing.

    Modern VB is very powerful and useful, as told by a C# programmer. Still prefer C# for most tasks, though.

  • (cs) in reply to AA
    AA:
    Jaime:
    Yup. Also, in VB.Net you use the following line of code to round:
    x = Math.Round(12.5)

    It rounds to the nearest even whole number. In C#, the equivalent code is:

    x = Math.Round(12.5);

    It also rounds to the nearest even number. If you want to round to up, use:

    x = Math.Round(12.5, MidpointRounding.AwayFromZero)

    Of course, in C#:

    x = Math.Round(12.5, MidpointRounding.AwayFromZero);

    I fail to see any eveidence that VB is a toy language because it doesn't round properly and C# is a professional language because it rounds properly.

    Do you really not know the difference between VB and VB.NET?

    I do. ".Net" is a marketing term used for the current generation of a subset of Microsoft products. Currently it only applies to developer products, but for a short time, Windows Server was to be called "Windows .Net Server 2003". VB.Net is the marketing term used for versions 7, 8, 9, and 10 of Visual Basic. Just because you want to freeze the term VB at the state of the product in 1998 doesn't make it true.

  • RandomUser423689 (unregistered) in reply to The Bytemaster
    The Bytemaster:
    Fedaykin:
    The real WTF here is VB, and I say that not only becuase it's a toy language, but because it's not a language appropriate for scientific calculation.
    Of course now microsoft is dropping the .NET from "VB.NET" and just calling it VB 10, so it seems - so this will get more confusing.

    Modern VB is very powerful and useful, as told by a C# programmer. Still prefer C# for most tasks, though.

    That may be in part to their (apparent) plans to finally retire the VB6 runtimes. Supposedly there are no plans to distribute them on Windows versions after Windows 7. No more living classic VB, no more need to call out the ".NET" in VB.NET.

  • (cs) in reply to AA
    AA:
    Jaime:
    VB is only 2 bytes longer and actually takes fewer vertical lines...
    That's because two of the C# lines are braces. Which you don't actually need in your example.

    Claiming that one language is more "compact" than another when you're deliberately adding cruft to one of them kind of invalidates your position.

    Doesn't matter. In VB, I simply hit enter after the if condition and the IDE puts in the "Then" and "End If" and positions my cursor in the block, already indented. VB still doesn't require more typing than C#. All of the stuff that's seen as verbose in VB is auto-typed by the IDE. Also, as soon as the if contains more than one statement, the braces are required in C# and my example suddenly contains no cruft. VB gains no extra syntax for an if block with multiple statements.

  • (cs) in reply to Fedaykin
    Fedaykin:
    The real WTF here is VB, and I say that not only becuase it's a toy language, but because it's not a language appropriate for scientific calculation.
    Microsft has pledged to never introduce a feature in C# that they don't simultaneously introduce in VB.
  • coyo (unregistered) in reply to Jaime
    Jaime:
    AA:
    Jaime:
    VB is only 2 bytes longer and actually takes fewer vertical lines...
    That's because two of the C# lines are braces. Which you don't actually need in your example.

    Claiming that one language is more "compact" than another when you're deliberately adding cruft to one of them kind of invalidates your position.

    Doesn't matter. In VB, I simply hit enter after the if condition and the IDE puts in the "Then" and "End If" and positions my cursor in the block, already indented. VB still doesn't require more typing than C#. All of the stuff that's seen as verbose in VB is auto-typed by the IDE. Also, as soon as the if contains more than one statement, the braces are required in C# and my example suddenly contains no cruft. VB gains no extra syntax for an if block with multiple statements.

    I had used perl programs to generate VB forms based on a simple config, then used the VB IDE to fine tune their positioning. Rather fast development cycle there.

  • Darius (unregistered) in reply to Anon
    Anon:
    I inherited a program that my company had hired an outside company to produce. They wrote the whole think in VB (but at least it was VB.Net, but I don't think they changed any of their old habits when they moved from plain VB to VB.Net). One of the shocking things I discovered while vainly attempting to improve it was that they stored a bunch of settings in the registry, but the strings they used for the keys in the registry where read from labels on one of the forms. Change one of the labels and you break the program because it can't find the right registry key anymore! Needless to say, we never used them again.

    It's close to being a good idea - reusable code module that iterates controls and saves values to registry without coding each registry operation by hand - but if you do this, it should be anchored to the control names not the label text...

  • Darius (unregistered) in reply to Raedwald
    Raedwald:
    senior engineers... their skills didn't translate into in the realm of computer science
    QFT. I've been in a 10 person development team in which I was the only member without a PhD. And the only member who had ever read a book on software engineering. Or had programmed in other than FORTRAN-77. It was a WTF-generator.

    Been in the opposite situation - the only member with a Phd (in non-computer science) and the only person who has studied coding. Some of the WTF produced by computer science graduates were priceless.

    One of the common problems was lack of user-friendly interface design and the other was overestimation of their own skills - "why use an established web server when you can write your own - should only take a day to write one - you can even write your own encryption protocol..." etc.

  • Xythar (unregistered)

    _<

  • Cheong (unregistered)

    Given that back in those days most people have EGA (and very limited number of VGA) monitor installed, I doubt the scheme of #444445 or#444446 would work.

  • (cs) in reply to Cheong
    Cheong:
    Given that back in those days most people have EGA (and very limited number of VGA) monitor installed, I doubt the scheme of #444445 or#444446 would work.
    It said the late nineties, not the late eighties. Most of the monitors would probably have been SVGA.
  • Verilong (unregistered) in reply to skeptical hippo
    skeptical hippo:
    But that would be silly, because you could instead code the whole thing in transistors that cover the entire surface of the moon just to prove that it can be done.

    Now that would be beyond foolish.

    The propagation delay of such a system would be enormous - you would have to use a clock rate under 100kHz. The performance would be awful!

  • (cs) in reply to Flurgle
    Flurgle:
    zidar:
    Yaos:
    The engineers were just making the program memory efficient, back in those days memory was expensive. Why take up memory for a background color and a variable when you can use both to do the same thing?
    Yea, just think of how much memory would be saved if all variables were saved like that. Each var being one pixel, and the color would be its value.

    That would make for some really pretty programs and easy debugging!

    Especially on embedded devices with no filesystem...

    These days they'd just use XML anyway...

    Hey! Morbs was right!

  • (cs) in reply to BBT
    BBT:
    Just to get them out of the way,

    TRWTF is Access. TRWTF is Visual Basic. TRWTF is Windows. TRWTF is senior citizens who are clearly senile still having jobs. (that's what Senior Engineer means, right?)

    I thought it was Hispanic train drivers.

  • SW (unregistered) in reply to RandomUser423689
    RandomUser423689:
    Homer:
    Back in the 90's, you didn't need to study computer science to write code. These were simpler and hopeful times where you could raise millions of dollars in investment capital just by prepending an ancient idea with the letter e. Code didn't need to be regression tested, or even show that it could perform its intended task in any way.

    The culmination of this philosophy, of course, came with Windows ME.

    Ike:
    Thank goodness those days are over. Now, of course, only those who have passed a rigorous certification process are allowed to write code. The end result? Windows Vista.
    Sadly, those days will never be over (as I'm sure you know, noting the sarcasm). Economic factors will always push large amounts of work with as low a barrier to entry as "coding", onto the untrained and the self-taught. The only (obvious) thing that might stop it would be wide-spread unionization of such work, but all I can say is, "good luck with that." An old discussion for the regulars here, but I figured I'd mention it for the passers-by.

    Oh Yea because union = quality Riiight.

  • is0lated (unregistered) in reply to zidar
    zidar:
    Yaos:
    The engineers were just making the program memory efficient, back in those days memory was expensive. Why take up memory for a background color and a variable when you can use both to do the same thing?
    Yea, just think of how much memory would be saved if all variables were saved like that. Each var being one pixel, and the color would be its value.

    That would make for some really pretty programs and easy debugging!

    Please don't go giving me ideas like that, it's only going to end horribly for everyone involved. That being said, I have an old MMX pc I've been meaning to do something with...

    CAPTCHA: cogo Colourful Organised Graphical Output

    attempt #2

  • db (unregistered) in reply to AA
    AA:

    Do you really not know the difference between VB and VB.NET?

    Let's see - one is pascal these days and the other is java?

  • (cs) in reply to DOA
    DOA:
    "instead of storing the information in a variable, the values were stored in the background color of the form."

    Let me guess, the engineers who built it were the ones that routinely forgot to wear hardhats in construction areas. One too many dropped wrenches have hit them on the head over the years...

    I would say, not enough wrenches has hit them over the head. Maybe next time. MOHAHAHAHAHA

  • Adam (unregistered) in reply to Someone like Kevin
    Someone like Kevin:
    Hired Gun:
    If you can't think critically and solve problems, then you can't program. If you can solve problems, then the language doesn't mean squat as long as you learn it.
    +1

    -1 Languages impose limits. If you can solve a problem, doesn't mean the language can too.

    +1 I agree that the language does not make the programmer.

  • maht (unregistered) in reply to BBT
    BBT:
    TRWTF is Access. TRWTF is Visual Basic. TRWTF is Windows. TRWTF is senior citizens

    TRWTF : With the project deadline looming

  • Anonymous (unregistered) in reply to Hired Gun
    Hired Gun:
    <All sorts of whining>
    Aww, butthurt VB fanboy alert! Aren't they sweet when they're pretending to be real coders?!
  • rfoxmich (unregistered)

    Dunno working with a bunch of physicists that tend to write software from time to time... all this seems rather standard, and sort of tame stuff ;-)

  • (cs) in reply to Verilong
    Verilong:
    skeptical hippo:
    But that would be silly, because you could instead code the whole thing in transistors that cover the entire surface of the moon just to prove that it can be done.

    Now that would be beyond foolish.

    The propagation delay of such a system would be enormous - you would have to use a clock rate under 100kHz. The performance would be awful!

    It's okay, the aliens have FTL circuit technology.

  • Edward Royce (unregistered)

    Hmmm.

    The horror of my life that involved VB was when some legacy escapees, sorry programmers, from COBOL discovered the wonder and joy of ... 3D visual controls.

    Ever see a user interface that had the majesty and appearance of a mountain range? Because when the documentation tells you to "navigate" they MEAN "navigate" as in Sir Edmund Hillary.

  • Ziplodocus (unregistered) in reply to rfoxmich
    rfoxmich:
    Dunno working with a bunch of physicists that tend to write software from time to time... all this seems rather standard, and sort of tame stuff ;-)

    TRWTF:I first read this as psycics that tend to write software

  • (cs) in reply to Anonymous
    Anonymous:
    SenTree:
    Anonymous:
    Er, right... I'm in safety critical so I'm rigorously certified in... well... you know what, I write flight control systems and I have absolutely no certifications of any kind. Sure I have a CS degree but that's pretty much all theory - I certainly don't have any certifications to prove that I can actually put it into practice. Anyway, enjoy your next plane journey.
    DO-178B or equivalent ? If not, name of company so I can never set foot on their aircraft !

    [Edit] Hah! Just noticed the previous comment which beat me to it.

    Don't worry, the company I work for is DO-178B certified. But that's the company - personally, I'm not certified in anything.
    That's what I expected you'd say. I'm heading towards a similar situation regarding IEC61508 Functional Safety - if this place ever gets its act together - except my degree is EE, not CS, so even less relevance !

  • sheepdan (unregistered) in reply to Hired Gun
    Hired Gun:
    Anonymous:
    Using VB for scientific computing is like hiring a 3rd grader as a research assistant.

    Oh, come on. Do you REALLY think that the language an application is written in makes any difference?

    Yes, there were a lot of things that couldn't be done in VB that were available in C, but that doesn't invalidate VB as a platform. My motorcycle can't pull my boat, but my truck can. That doesn't invalidate my motorcycle as a method of transportation, does it?

    Here are the criteria for choosing a language to develop a project in:

    1. Does the customer's existing hardware support the platform, or are they willing to purchase the necessary hardware?

    2. Is the language anticipated to be supported for the duration of the program's life cycle?

    3. Does the language include all the functions necessary to meet the requirements of the application and the customer's security/distribution requirements?

    4. Is there a supply of programming talent sufficiently proficient in the language available to the customer to maintain the project for the duration of the program's life cycle?

    If your choice meets those requirements, then it's a valid choice.

    If you give a master carpenter a job to do, he may prefer his DeWalt tools over the Ryobi, but he can still do every bit as good a job with the Ryobi tools.

    Enough of this prima-donna "My language is better than yours" crap. We're supposed to be programmers, not evangelists. Anyone who knows what they're doing in programming should be able to function in anything from Q-BASIC to assembly, if given time to learn the syntax.

    Programming is about problem solving. If you can't think critically and solve problems, then you can't program. If you can solve problems, then the language doesn't mean squat as long as you learn it.

    QFT.

    I've seen as many WTFs with C++ or C# as with VB. The only difference is that any idiot can (and does) write VB, whereas the C++/C# guys should know better.

    Though I usually work in C#, I've wrote some perfectly good stuff in VB years ago, and still write the odd bit of perfectly useful and concise stuff in VBA (adding missing features to Word). But I do miss my {}.

  • Anon Too (unregistered)

    From the first paragraph my thought was... why the hell not just connect to the HP-UX via a terminal session from the windows desktop????

    Don't break it if it's not broken.

  • Matt Westwood (unregistered)

    If only the app had been written originally in FORTRAN on a VAX then the whole world would have been happy for ever after.

  • Anon (unregistered) in reply to Jaime
    Jaime:
    BTW, "round-even" is used to eliminate the aggregate effects of consistently rounding 5 up. With "round-even", half of your 5s will round up and half will round down. This method also has the advantage of being determinate. Altenatives are "alternate rounding", where each 5 does the opposite of what the previous one did and "random rounding", which has obvious problems.

    I'm sorry, but round-even is the single most retarded thing ever. .5 rounds up, always. The point of rounding is that you have limited accuracy and you don't know what comes after the digit you are rounding on. So, if you have .5 it could really be:

    0.59 0.51 0.501 0.500000000000000000000000001

    All of which are closer to 1 than they are to 0, so why, in the name of all that's holy, would you ever round it to 0?

    The only place where it might make sense is in finance if you don't ever deal with a fraction of a cent. But the article was about a scientific calculation which should never use the retarded round-even bullshit.

  • (cs) in reply to KittyKat
    KittyKat:
    So are they going to next embed an emulator of the actual machine to run the program?

    Sounds like the obvious next step. And the best one they could forsee at the time too.

    Obviously, nowadays the best path would be to replace those Unix machines with Linux ones, and use X to access the server.

  • (cs) in reply to Anon
    Anon:
    Jaime:
    BTW, "round-even" is used to eliminate the aggregate effects of consistently rounding 5 up. With "round-even", half of your 5s will round up and half will round down. This method also has the advantage of being determinate. Altenatives are "alternate rounding", where each 5 does the opposite of what the previous one did and "random rounding", which has obvious problems.

    I'm sorry, but round-even is the single most retarded thing ever. .5 rounds up, always. The point of rounding is that you have limited accuracy and you don't know what comes after the digit you are rounding on. So, if you have .5 it could really be:

    0.59 0.51 0.501 0.500000000000000000000000001

    All of which are closer to 1 than they are to 0, so why, in the name of all that's holy, would you ever round it to 0?

    The only place where it might make sense is in finance if you don't ever deal with a fraction of a cent. But the article was about a scientific calculation which should never use the retarded round-even bullshit.

    Rounding 5s up inserts a bias into your data, and will create problems on every program that agregates such data. On this case, it may quite easily overestimate the dissipating power of a radiator (what would be very bad).

    The best thing to do is simply not to round numbers that will be agregated. But on most applications you only discover that another team took your results and made some critical calculations with it too late. So, the safest way is to use an unbiased rounding algorith, even if it means you'll need to output one non-representative algarism.

  • (cs) in reply to Anon
    Anon:
    Jaime:
    BTW, "round-even" is used to eliminate the aggregate effects of consistently rounding 5 up. With "round-even", half of your 5s will round up and half will round down. This method also has the advantage of being determinate. Altenatives are "alternate rounding", where each 5 does the opposite of what the previous one did and "random rounding", which has obvious problems.

    I'm sorry, but round-even is the single most retarded thing ever. .5 rounds up, always. The point of rounding is that you have limited accuracy and you don't know what comes after the digit you are rounding on. So, if you have .5 it could really be:

    0.59 0.51 0.501 0.500000000000000000000000001

    All of which are closer to 1 than they are to 0, so why, in the name of all that's holy, would you ever round it to 0?

    The only place where it might make sense is in finance if you don't ever deal with a fraction of a cent. But the article was about a scientific calculation which should never use the retarded round-even bullshit.

    VB round all of those to 1. It only rounds exactly 0.5 down to 0.

  • Anon (unregistered) in reply to Jaime
    Jaime:
    Anon:

    0.59 0.51 0.501 0.500000000000000000000000001

    VB round all of those to 1. It only rounds exactly 0.5 down to 0.

    You missed the point. The value you see is 0.5, unless you know that it really is exactly 0.5, it could just as easily been any of the values above, and therefore should be rounded up.

  • Anon (unregistered) in reply to Mcoder
    Mcoder:
    Rounding 5s up inserts a bias into your data

    No, it doesn't.

    If you are rounding 0.x then:

    0.0 -> 0 0.1 -> 0 0.2 -> 0 0.3 -> 0 0.4 -> 0 0.5 -> 1 0.6 -> 1 0.7 -> 1 0.8 -> 1 0.9 -> 1

    Notice that for half the values of x, it rounds to 0, for the other half, it rounds to 1. That is unbiased. But the point about not round prematurely is absolutely true. The computer has no problem dealing with large numbers of decimal places, even if most of them are meaningless.

Leave a comment on “A Terminal Condition”

Log In or post as a guest

Replying to comment #308705:

« Return to Article