Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
R

Roger Bamforth

@Roger Bamforth
About
Posts
5
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • the hard way
    R Roger Bamforth

    Then, a few days later, i stumbled on some similar code, and at last realized, that in over a decade of using C++, i'd managed to either avoid or forget the mutable keyword... If it makes you feel any better, I've done the same! Thanks for telling me about mutable

    Regards - Roger

    The Weird and The Wonderful

  • Using Else with blank If
    R Roger Bamforth

    That's a good point and is actually something that had never occurred to me. However, whether or not you get a warning depends upon the types of x, y and b is not as simple as it seems. It is probably also language and compiler dependant. e.g in Visual C++

    bool x = true;
    bool y = true;
    bool b = (x = y);
    

    gives no warning, as you say, but

    int x = true;
    int y = true;
    bool b = (x = y);
    

    does generate a warning (forcing an int to be a bool) and

    int x = true;
    int y = true;
    BOOL b = (x = y);
    

    doesn't.

    Regards - Roger

    The Weird and The Wonderful linux help

  • Using Else with blank If
    R Roger Bamforth

    Absolutely. Along the same lines, my pet peeve is

    bool b;

    if (condition)
    {
    b = true;
    }
    else
    {
    b = false;
    }

    what on earth is wrong with

    bool b = condition;

    Regards - Roger

    The Weird and The Wonderful linux help

  • Outrageous error messages
    R Roger Bamforth

    It wasn't flagging the situation that I thought was the problem, but calling his colleagues b******s in a message that would be displayed to the users. By all means write it to an internal log file or something, but don't swear at the users, it's not very professional.

    Regards - Roger

    The Weird and The Wonderful help hardware learning

  • Outrageous error messages
    R Roger Bamforth

    I develop software to control scientific instruments. This is a different world to databases or financial software. The first rule is to insist on the electronic and mechanical designers proving that the hardware is working properly before you will consider that the software has a bug. (The first rule of the mechanical and electronic designers is, of course, "the software is faulty"). The second rule is that just when you've got it all working properly they will change the hardware. I once worked on software to control a mass spectrometer. This detects a particle beam travelling down a vacuum tube. There were two types of detectors, the instrument could either be fitted with "high detectors" or "low detectors". I was looking through the source one day when I came across this user error message (without the stars of course). "Both high and low detectors fitted. B******S, THEY PROMISED ME THIS WOULD NEVER HAPPEN."

    Regards - Roger

    The Weird and The Wonderful help hardware learning
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups