• (cs) in reply to Cyprian
    Anonymous:

    Two people interview for the same position and they both look about the same in terms of experience and skill. Money is not a problem. One has a degree (from a real school, not Devry, Joe Blow CC or ITT Tech or something) and one does not. Who do you hire?

    The girl with big (o)(o) eyes.  ;-)

    I would hire the one with a degree from a real school 10 out of 10 times. This at least shows some sort of commitment and investment (time and money).

    I'd choose the guy that fits into the team. I don't care for "commitment" or "investment", just for skills (technical and social) and personality (reliability etc.).

    A degree does not guarantee that the person will be good, and not having a degree does not mean they will be bad (one of the better programmers I have known does not have a degree), but generally speaking, self-educated people take shortcuts and are not forced to do the hard things in many cases.

    Which hard things? Drawing UML diagrams full of stickmen without bursting into laughter?

    To take a different route: would you let a doctor operate on you if they were self taught? Would hire a lawyer that didn't goto law school?

    Doctors and lawyers have to get it right the first time, every time. Programmers have reviews, tests and debuggers. If someone (degree or not) produces crap, chances are I recognice that immediately.

    This phenomenon where we allow accountants to become programmers just because they want to without any formal education is what gives us some truly crappy projects. Think back to the .com days when everyone was becoming a developer overnight because the money was there....it only hurt the field as a whole.



    If someone has no talent, he shouldn't do the job. A degree doesn't make him much better, only harder to get rid of.

  • Cyprian (unregistered) in reply to ammoQ




    Which hard things? Drawing UML diagrams full of stickmen without bursting into laughter?


    Have you been to college? A real college for CS (not MIS or CIS or something stupid)? I have a BS and an MS and UML wasn't even broached until you get to software methodologies. Math (lots of math...a minor in math), Physics, OO, hardware, parallel processing, AI, DB, OS I and II, Compiler Design, statistic, EE....

    you know...those.


    Doctors and lawyers have to get it right the first time, every time. Programmers have reviews, tests and debuggers. If someone (degree or not) produces crap, chances are I recognice that immediately.


    (note: wife is a doctor, 2 uncles who are lawyers) Doctor's and lawyer's do not have to get it right the first time and everytime. There is peer review, sessions to talk over procedures and what not. Sure, in a operating room they have to be very precise and methodical, but that is why there are about 10 of them in there at all times.

    I firmly believe that becoming a developer/programmer should be as hard to become as an engineer (exams, certifications and recertifications), or a doctor or a lawyer. Someone should not be allowed to say they are a programmer just because they goto chapter 7 of learning VB in 21 days, which is what we have now.

    Think of it this way: would you want some accountant turned programmer to design the flight controller on a plan you were riding in? Hell no!


    If someone has no talent, he shouldn't do the job. A degree doesn't make him much better, only harder to get rid of.

    How is that person harder to get rid of? and where did anyone say they were better? you are takinga  chance on someone in the hiring process. Hire the person that gives you the best chance of succeeding, and 9 out of 10 times that will be the person who at least studied the subject matter long enough to get a 4 year degree.

  • pmagill (unregistered) in reply to Cyprian

    Cyprian,
    Needing a degree I believe is only good for the first few years of development work.  I believe after about 5 years a degree becomes needless.  The reason?  The self taught guy has possibly matrured into a good programmer, and the college guy has learned all the bad mistakes from the field and adopted them.  I find schooling to be good for theory but bad for practical knowledge.

    My main question would be what have you learned in the last five years and can you provide examples both theoretical and practical.
    Anyone that can give reasonable answers to that is hirable regardless of degree.

    As far as the doctor or lawyer business, my programs won't be cutting you open so the doctor reference isn't a good one.  The lawyer side of things can get a bit more close to home though, as the security and reliability of my applications or the lack thereof can drop someone into legal trouble, so I don't have a retort for that argument.

    CAPTCHA = zork  loved that game

  • Cyprian (unregistered) in reply to pmagill
    Anonymous:
    Cyprian,
    Needing a degree I believe is only good for the first few years of development work.  I believe after about 5 years a degree becomes needless.  The reason?  The self taught guy has possibly matrured into a good programmer, and the college guy has learned all the bad mistakes from the field and adopted them.  I find schooling to be good for theory but bad for practical knowledge.

    My main question would be what have you learned in the last five years and can you provide examples both theoretical and practical.
    Anyone that can give reasonable answers to that is hirable regardless of degree.

    As far as the doctor or lawyer business, my programs won't be cutting you open so the doctor reference isn't a good one.  The lawyer side of things can get a bit more close to home though, as the security and reliability of my applications or the lack thereof can drop someone into legal trouble, so I don't have a retort for that argument.

    CAPTCHA = zork  loved that game



    Actually, the doctor analogy is quite applicable. Think if you were designing a system for a doctor's office that they depended to track patients and their medical needs. What if they gave the wrong dosage to a patient because of YOUR sloppy math or mistake. You just killed someone.

    Practical vs theoretical is always one of those sticky subjects. I firmly believe that theory helps you in the long run. If someone doesn't understand the theory behind OO design, the practicality of it will be way above them as well. Think of this on a higher level as well (compilers for languages, OS for which system to use etc etc)

    As I said earlier...if the two people were the same except for degree...I would take the degree each time. But I have and will hire people without degrees that are capable of doing the work I need them to do. That isn't the issue. But I also encourage those employees to go to school. It will only help them in the long run.
  • (cs) in reply to pmagill
    Anonymous:
    Cyprian,
    Needing a degree I believe is only good for the first few years of development work.  I believe after about 5 years a degree becomes needless.  The reason?  The self taught guy has possibly matrured into a good programmer, and the college guy has learned all the bad mistakes from the field and adopted them.  I find schooling to be good for theory but bad for practical knowledge.

    My main question would be what have you learned in the last five years and can you provide examples both theoretical and practical.
    Anyone that can give reasonable answers to that is hirable regardless of degree.


    I concur with this.

    As far as the doctor or lawyer business, my programs won't be cutting you open so the doctor reference isn't a good one.


    Do a Web search on "THERAC-25".

    Sincerely,

    Gene Wirchenko

  • Cringer, He-Man's Battlecat (unregistered) in reply to JohnO
    JohnO:

    How right you were. :) 

    Have you ever considered not using stupid ifs? IE if ( x ) as opposed to if ( x == true) or if ( !x ) as opposed to if ( x == false ).

    That really bugs the hell out of me.

    I don't understand how your comparisons are better than mine.  if (x).  If x what?  There's an assumption behind that line of code - about how the comparison will be evaluated, about people reading your code, about the status of x.  if (x == true) spells it out.  It leaves no doubt as to the intent of my code, or the comparison I'm wanting to make.  if (true == x) is debatedly better (assuming you're using a constant to compare against and your language of choice allows for assignment and equality tests to be easily typoed), but I find the reversed logic does nothing more than confuse the code written.

    As for if (!x) - same as above.  You're simply hiding the true comparison behind a clever bit of code that doesn't matter once the compiler has finished with it.  I only use not expressions when it makes logical sense in reading the code - if (!overdrawn) - read as not overdrawn - as compared to if (overdrawn == false).  Both make sense.  Just using ! to negate a variable doesn't - it's not clear what your intent is, it's not clear what value you're comparing against, it's not clear at all.

    I just recently helped an associate out of a bind who was trying to be clever and using the ternary operator.  He had code like this...

    return Session["Key"] != null ? null : Session["Key"];

    See a problem there?  It won't leap out at you, that's for certain, although if you're experienced you've probably solved more than your fair share of similar problems - he has the results of the comparison reversed.

    if(Session["Key"] != null)
    {
         return Session["Key"];
    }
    else
    {
         return null;
    }

    Oh no!  It's long!  It takes up screen real estate!  And it's ENTIRELY CLEAR as to what's occuring and the reversal in the first example would've never happened.  Once the optimizer gets finished there is no difference.  Some of you will complain about the unneeded braces.  Others will complain about multiple exit points.  Hey, at least I'm not using exceptions as flow control (NullReferenceException)!

    (The original code included a cast to the original object type, else he could've simply returned Session["key"] whether it was null or not.  I'm aware of this.)

    Oh well.  I am beginning to think there are hidden messages in the CAPTCHA though.  This one is bozo...

  • (cs) in reply to Cyprian
    Anonymous:


    Have you been to college? A real college for CS (not MIS or CIS or something stupid)? I have a BS and an MS and UML wasn't even broached until you get to software methodologies. Math (lots of math...a minor in math), Physics, OO, hardware, parallel processing, AI, DB, OS I and II, Compiler Design, statistic, EE....

    you know...those.


    I live in Austria, our school and university system is slightly different. Suffice to say that my education was focused on IT, took 5 years and is highly reputable at least in Austria. But, to point out a major difference (and probably shortfall), it was not CS in terms of math, theory of complexity and similar stuff. Probably too focused on real work, real systems, much of it what you would call dinosaurs (COBOL, PL/1 etc.) I've been some time to the University of Technology, focusing on math, logic and similar theoretical stuff; but eventually dropped out for some reasons.


    (note: wife is a doctor, 2 uncles who are lawyers) Doctor's and lawyer's do not have to get it right the first time and everytime. There is peer review, sessions to talk over procedures and what not. Sure, in a operating room they have to be very precise and methodical, but that is why there are about 10 of them in there at all times.


    Well, I'd choose the doctor that describes the right medication the first time and everytime without peer review; and also the lawyer that wins the case in the first instance.
    (note: father in law is doctor, brother in law is lawyer ;-)


    I firmly believe that becoming a developer/programmer should be as hard to become as an engineer (exams, certifications and recertifications), or a doctor or a lawyer. Someone should not be allowed to say they are a programmer just because they goto chapter 7 of learning VB in 21 days, which is what we have now.


    IMO you worry too much. If the job description is "maintain a crappy VB program", the "VB in 21 days" guy may just be the right person. Anyway, you might be right in 50 years from now. Currently, the whole IT field is too new. Paradigms change every few years. Once the IT has a long-lasting tradition of accepted best practices, it might be the right time to become more stringent. Currently I don't see that.


    Think of it this way: would you want some accountant turned programmer to design the flight controller on a plan you were riding in? Hell no!


    Chances are the flight controller is not programmed by a CS graduate, but e.g. by a electrical engineering graduate. Anyway, I would worry much more about the guy who does the specs and the guy who does QA.



    If someone has no talent, he shouldn't do the job. A degree doesn't make him much better, only harder to get rid of.

    How is that person harder to get rid of?

    More able to bullshit the pointy haired boss etc.

    you are takinga  chance on someone in the hiring process. Hire the person that gives you the best chance of succeeding, and 9 out of 10 times that will be the person who at least studied the subject matter long enough to get a 4 year degree.

    Some self-taught programmers I know started programming when they were 12 years old. But they are so focused on doing it (writing programs) that they don't feel like going through college.
  • (cs) in reply to Cringer, He-Man's Battlecat

    if (x).  If x what?

    if (File.Exists("test.txt")) is pretty self explanatory (code is C#).  I think in most cases, properties and methods returning boolean have names that reflect that and make it obvious what is happening.  If not, then it's a poorly named member.

    OTOH, this only deals with situations where x is boolean.  For example, in the code
    if (i > 5), i is an integer.  Therefore you have to check it against a value (such as 5, though 5 would obviously be a constant or another variable), in which case it becomes a moot point.  Unless someone's suggesting the above code should be rewritten as if ((i > 5) == true), which would obviously be silly.

    On the subject of exceptions, sometimes an exception is the only/quickest/easiest/best way to make a decision.  A couple of examples: 

    1.  Say you are writing a configuration app, that stores values in an XML file (such as a .NET app using an app.config file).  Post-installation, this file may or may not exist, and it may or may not contain sensible values (depends on what the installation is capable of - maybe it can't easily write to XML files).  When the config app starts, you need to pick up the existing values, or if those values don't exist, write default ones.

    Now, what's the easiest way of checking whether a value exists within an XML file?  Trying to query that value and catching the NullReferenceException that gets created if it doesn't exist.  Bad, I know, but the only other way to do it is to walk through the XML document until you find the node you're looking for, or can't continue because that node doesn't exist, and that's just too much work if you're just putting together some simple utility.

    2.  (Already been mentioned, but what the heck)  The user has entered login details for a database server (we could again use the config app example), and
    you want to check that they're correct.  How can you check that the database server address is correct, the user name and password are valid and that the database you want to connect to actually exists, let alone has permissions for your user?

    Again, the only way to do it is to try and get the exception if they failed.

    Now, in both of these situations, it might be nice to have a boolean property that tells you whether the data is valid or not.  Similar to the if (File.Exists("test.txt"))concept, an if (dbConnection.IsValid)concept might be useful.  However, internally it would most likely use a try-catch structure, exactly as if I tried it myself.  I would use exceptions in these situations, though I would look pretty hard for alternatives that weren't a lot harder (I think it's useless to do things the 'proper' way if that way ends up significantly more complex and harder to understand than the 'hack'). 

    In neither of these situations, though, do I want a stack trace getting back to the user.  The reason is that the people who will be running this app will not know how to handle that information.  Whatever useful information there might have been in the exception is buried in the stuff they can't understand.  Errors like "Invalid username/password" should not give the user a stack trace.  As for the first one, it's not really an error, it just happens that it's the easiest way to handle that situation.

  • (cs) in reply to ammoQ

    IMO you worry too much. If the job description is "maintain a crappy VB program", the "VB in 21 days" guy may just be the right person.

    I agree with ammoQ on this one.  Further to that, what does someone who's spent 5 years training in university do when he gets told "well, actually, we don't need any more C# or Java guys.  We do need a really good installation guy".  I chose installations because that's why my predecessor left - he got lumbered with installation and that wasn't why he went to uni, and he was fed up and demotivated because of that.

    The less academically qualified programmer may also prove more useful in other ways, such as being more adaptable and more open to new ideas.  If you've spent 5 years in university, then you risk mistakes due to a lack of exposure to the real world.

    Degrees do have their plus points, but they have their weak areas too.  To say that you must have one to be able to program is just nonsensical.

  • (cs) in reply to johnl
    johnl:

    The less academically qualified programmer may also prove more useful in other ways, such as being more adaptable and more open to new ideas.  If you've spent 5 years in university, then you risk mistakes due to a lack of exposure to the real world.


    That is complete nonsense. More open to new ideas? Ignoring the poor use of English (more open? Something is either open or closed.) There's no reason to suspect that someone who has attained a degree is not open-minded. In fact, given that a student must learn from a number of different professors along the way with different styles and expectations, I would say that a student with a degree has already demonstrated adaptability and willingness to listen to others. You're just wrong.

    sincerely,
    Richard Nixon
  • john bigbooty (unregistered) in reply to sika
    Anonymous:
    Offcourse a  degree does not  guarantee that one does not make stupid  things, but at least the chances are smaller than with some self-educated guy who just walked in from the street and proclaimed to be a professional programmer.


    But that doesn't stop the outpouring of CS graduates that come into a dev shop with no real world/business experience and rewrite several hundred of thousands of lines of code the "right" way. And then it all comes crashing down on them when they deploy, while they jump up and down pouting, "But I did it academically!"

    I've met many more self taught programmers that are exceptionally bright compared to accredited CS grads. With maybe the only thing lacking in them being a little discipline.

    The thing i think we mostly need to try and prevent are the guys who were once "workin' as a mortgage broker, decided I need a career change, and saw that this Internet thing was pretty hot."

  • john bigbooty (unregistered) in reply to Gene Wirchenko
    Gene Wirchenko:
    Do a Web search on "THERAC-25".

    There is always this too... http://en.wikipedia.org/wiki/Ariane_5_Flight_501

    CAPTCHA = Freedom (how appropriate)

  • john bigbooty (unregistered) in reply to Cyprian

    (Roll's the dice) I hope the forum softar doesn't mangle my post this time!

    Anonymous:


    I firmly believe that becoming a developer/programmer should be as hard to become as an engineer (exams, certifications and recertifications), or a doctor or a lawyer. Someone should not be allowed to say they are a programmer just because they goto chapter 7 of learning VB in 21 days, which is what we have now.

    Think of it this way: would you want some accountant turned programmer to design the flight controller on a plan you were riding in? Hell no!

    Maybe this contradicts my last post, but I don't think this is really the reason the industry sucks today. Sure these guys/gals are annoying and cost time and money sometimes. But eventually, they get weeded out. The industry is being run so tight these days. Hence, most of our jobs are being outsourced to India, which also doesn't produce any better code either.

    I think the biggest problem to date is that software is so market driven now. More and more I see Marketing people charge how architects design new versions. Couple that with short development cycles, and you get put into a situation where new features always win over bugfixes and stability/performance/manageability improvements. This is because they see a direct result in profit with new features, whereas fixes/improvements are harder to gauge their long term value.

    While I think it's important for marketing to be involved in being able to recognize industry trends and what the market desires, I think it's important to keep also the existing users and developers involved in the design process.

    Where did i go with this post?

  • (cs) in reply to Cyprian
    Cyprian:

    Actually, the doctor analogy is quite applicable. Think if you were designing a system for a doctor's office that they depended to track patients and their medical needs. What if they gave the wrong dosage to a patient because of YOUR sloppy math or mistake. You just killed someone.


    One more thought about that: Given the example of a system for a doctor's office, is someone with a CS degree really sufficiently qualified to build it? Why mnot also require a degree in medicine? Can we trust someone who knows all about compilers and operating systems and finite state machines to know the difference between orthopedy and autopsy?


  • LarsW (unregistered) in reply to JohnO
    JohnO:

    Talk about the tail wagging the dog.  So forced declarations in Java are good because they made you realize how poorly modularized your initial design was?  Sorry, but you should have had modular design, regardless of exception handling.  Are you saying that if you tried to code in c# you wouldn't write good, modular code because you weren't forced to handle or declare exceptions at the method level?



    Yes, that is exactly what I am saying. This was a trivial example perhaps, but now that I have learned to recognize it, I won't make the same mistake again. So the language helped me become a better programmer.


  • (cs) in reply to kipthegreat
    kipthegreat:

    I do all my HTMLs in ASM, on a processor I designed myself with parts from Radio Shack.  I don't trust high-level languages or processors.  Sure, it takes up my whole basement, runs at 0.000133MHz, and crashes after a good 15 minutes of processing, but if something breaks I don't have to ask M$ or Int€£ what's broken.


    You'd like this then: http://www.homebrewcpu.com/

    Some guy running a webserver on a home built machine with a CPU cobbled together of 74 series TTL chips and wire...

    (The actual webserver is at http:///www.magic-1.org/)

  • UberGeek (unregistered) in reply to masklinn
    masklinn:
    SeekerDarksteel:

    Anonymous:
    What would you use as a Web Development Platform?
    ASP?
    ASP.NET?
    PHP4?
    PHP5?
    Perl?
    Ruby?
    Plain HTML with some AJAX with a SOAP Server?


     

    Fortran.net.  That way everyone else I work with would actually have a shot at understanding how these newfangled webthingamajigs are programmed.

    Fortran.Net is for the weaklings, Real Programmers use CGI/Fortran (or CGI/ASM if you prefer).

     

    Wimp. REAL programmers use CGI/EPROM (Burning the raw binary direct into the hardware. By hand. With a very small soldering iron).

  • UberGeek (unregistered) in reply to triso

    triso:
    Djinn:
    ...Just as with becoming a programmer in general, you should have to get a license to use design patterns. You get a license for driving, guns, and hunting, because we don't want people mishandling these things and getting hurt. Same principle here.

    People  don't get hurt using crap software--unless they put their fist through the CRT in a fit of rage.

     

    ...or the aircraft, on which they are a passenger, falls out of the sky because the crap software happens to be part of the avionics system.

  • (cs) in reply to UberGeek
    Anonymous:

    triso:

    People  don't get hurt using crap software--unless they put their fist through the CRT in a fit of rage.

    ...or the aircraft, on which they are a passenger, falls out of the sky because the crap software happens to be part of the avionics system.



    I definitely hope that "written by a licensed design pattern user" is not the only quality requirement for a piece of software to become a part of the avionics system. IMO, People are not hurt by crap software, but by crap softare put into production without proper quality assurance.
  • (cs) in reply to Richard Nixon

    more open? Something is either open or closed.

    Only in electronics.  Every other open/closed condition (at least, that I can think of - can you think of other exceptions) in the universe is analogue, not digital.  A door can be open a crack or wide open.   A valve (for controlling fluids, not the electronic type) can be open or closed to different degrees.  Similarly, people can be ready to embrace any new idea (known as open-minded), opposed to any new idea (closed-minded or, possibly more correctly, narrow-minded).  Or any state in between.  People who have been drilled in a specific idea will be more opposed to other ideas.

    Obviously, either extreme is very very bad.  People who are open-minded to a fault will constantly change their minds about things, always wanting to use the latest thing, even before they understand what it is or whether it would work for them - witness some of the XML WTFs for evidence of a fairly decent system abused by people who jumped in with both feet.  People who are too narrow-minded will not be able to adapt to a changing world, and will find themselves as obsolete as the programs they code before they know what's happened.

    There's no reason to suspect that someone who has attained a degree is not open-minded.

    There's also no reason to suggest they are open-minded.  If the only evidence is the presence of a degree, then I would be more inclined to suspect that they would be opposed to ideas not covered by that degree. 

    Whether that's because
    they've had all their  adaptability used up in uni or whether it's because they are annoyed at having to learn something else when they've already spent 5 years learning something depends on the person, I guess.  I've already given you a perfectly good example of this, and you can go back to my previous post if you want to read it.

    However, I'd never accuse someone of not being adaptable just because they have a degree.  You're right that it's not conclusive evidence in that way, but you do have to it bear in mind if you want to hire a good developer. 

    I would say that a student with a degree has already demonstrated adaptability and willingness to listen to others.

    That's an over-simplified view if ever I saw one.  Adaptability isn't a constant state.  You can be very adaptable when you're doing your degree, then not adaptable at all once you've graduated.  Sure they've adapted to one idea, say OOP in C++, but when they actually get out into the world, they are just as likely to end up dealing with something like C#, in which case a lot of them go "where are my pointers, I want my f**king pointers! Waaa!".  In cases like that, you get WTF's like every piece of code marked as unsafe just so they can use pointers.

  • (cs) in reply to johnl

    Just had another thought on the open/closed isue.  I've always considered "open-minded" to be an analogy to terrain.  In open terrain, there are many different paths that you can take.  As a situation changes, you can adapt your plans and maybe take another path.  In narrow terrain, or what Sun Tzu translations typically called constricted terrain, such as a mountain pass (this is probably why "narrow-minded" is used rather than "open-minded"), you can only take one path, and you are limited to that path only.  You cannot adapt effectively to changing situations because that adaptation will often involve taking another path.  In narrow terrain, there is no path available.

    On this site (and others), I always see people confusing English with a programming language.  The term open is not digital or boolean because the term arose before the concept of a digital condition existed.  This is the difference between a formal language (such as C++) , and an informal language (such as English, or any other spoken language).

  • Somebody (unregistered) in reply to Cyprian

    Anonymous:




    I have a BS and an MS and UML wasn't even broached until you get to software methodologies. Math (lots of math...a minor in math), Physics, OO, hardware, parallel processing, AI, DB, OS I and II, Compiler Design, statistic, EE....

    you know...those.


    Doctor's and lawyer's do ...



    Pity you didn't learn how to use apostrophes in amongst all that other ...stuff

  • (cs) in reply to Cringer, He-Man's Battlecat
    Anonymous:
    JohnO:

    How right you were. :) 

    Have you ever considered not using stupid ifs? IE if ( x ) as opposed to if ( x == true) or if ( !x ) as opposed to if ( x == false ).

    That really bugs the hell out of me.

    I don't understand how your comparisons are better than mine.  if (x).  If x what?  There's an assumption behind that line of code - about how the comparison will be evaluated, about people reading your code, about the status of x.  if (x == true) spells it out.  It leaves no doubt as to the intent of my code, or the comparison I'm wanting to make.  if (true == x) is debatedly better (assuming you're using a constant to compare against and your language of choice allows for assignment and equality tests to be easily typoed), but I find the reversed logic does nothing more than confuse the code written.

    As for if (!x) - same as above.  You're simply hiding the true comparison behind a clever bit of code that doesn't matter once the compiler has finished with it.  I only use not expressions when it makes logical sense in reading the code - if (!overdrawn) - read as not overdrawn - as compared to if (overdrawn == false).  Both make sense.  Just using ! to negate a variable doesn't - it's not clear what your intent is, it's not clear what value you're comparing against, it's not clear at all.

    I just recently helped an associate out of a bind who was trying to be clever and using the ternary operator.  He had code like this...

    return Session["Key"] != null ? null : Session["Key"];

    See a problem there?  It won't leap out at you, that's for certain, although if you're experienced you've probably solved more than your fair share of similar problems - he has the results of the comparison reversed.

    if(Session["Key"] != null)
    {
         return Session["Key"];
    }
    else
    {
         return null;
    }

    Oh no!  It's long!  It takes up screen real estate!  And it's ENTIRELY CLEAR as to what's occuring and the reversal in the first example would've never happened.  Once the optimizer gets finished there is no difference.  Some of you will complain about the unneeded braces.  Others will complain about multiple exit points.  Hey, at least I'm not using exceptions as flow control (NullReferenceException)!

    (The original code included a cast to the original object type, else he could've simply returned Session["key"] whether it was null or not.  I'm aware of this.)

    Oh well.  I am beginning to think there are hidden messages in the CAPTCHA though.  This one is bozo...

    Your whole post shows a fundamental misunderstanding of boolen types and logic.  The if statement takes a boolen expression.  If x is a boolen, then it's a boolen expression without the use of additional operators.  There's nothing "clever" about that.  By always comparing booleans to literals, you might as well never use a boolean type in the first place.

  • (cs) in reply to JohnO

    I love these arguments about degrees.  You can tell it's always people without a degree or without a "relevant" degree supporting this silly hypothesis.  Come on.  Do you really believe that you are superior because you lack education in the field that you are working in?  Exactly.  Neither do we.

  • (cs) in reply to Cringer, He-Man's Battlecat
    Anonymous:

    I don't understand how your comparisons are better than mine.  if (x).  If x what?  There's an assumption behind that line of code - about how the comparison will be evaluated, about people reading your code, about the status of x.  if (x == true) spells it out.  It leaves no doubt as to the intent of my code, or the comparison I'm wanting to make.  if (true == x) is debatedly better (assuming you're using a constant to compare against and your language of choice allows for assignment and equality tests to be easily typoed), but I find the reversed logic does nothing more than confuse the code written.

    The problem is my language doesn't define a constant. In C/C++ TRUE is a constant defined as 1, but if(x) is true when x is not 0, not just when x==TRUE. There is a vast difference. In many cases if(x) will work correctly, but if(x == TRUE) is incorrect.

    I suppose someone will correct me if I'm wrong, but I'm pretty sure that there is nothing in the C standard that requires !x to be 1 when x is 0. !x could legally be any non-zero number. (From a hardware point of view no compiler will do this, but the language does not enforce any value)

    IIRC VB uses -1 for true, all else for false. (Or something like that - I don't have to use VB so I'm not sure, just repeating what others have told me) Here is it more important to not check for x==FALSE, because of the way logical operators work in VB false values will often be other than whatever the constant FALSE is defined as.

    The ternary operator is very useful. Messing up the order of the operators is a logic problem, not a WTF. Once you know how to use them and read them they can make code more readable. Your inability to understand some obscure part of the language does not make use of that part a WTF.

  • (cs) in reply to john bigbooty
    Anonymous:
    Gene Wirchenko:
    Do a Web search on "THERAC-25".

    There is always this too... http://en.wikipedia.org/wiki/Ariane_5_Flight_501

    CAPTCHA = Freedom (how appropriate)



    Quite.  While working on my diploma, I wrote a paper on computer-related risks and wrote of both the THERAC-25 and Ariane 5 fiascos.  There is fascinating reading on both.  I especially liked Dr. Nancy Leveson's -- there were co-authors, too -- write-up on the THERAC-25 fiasco.  I forget the title, but it is about fifty pages long and very informative.

    As to the Ariane 5, my conclusion is that software reuse was a large factor.  (Yes, I know this conclusion is putting the cat in with the pigeons.)  In brief, a certain assumption was no longer valid.

    Sincerely,

    Gene Wirchenko

  • (cs) in reply to ammoQ
    ammoQ:
    Cyprian:
    Actually, the doctor analogy is quite applicable. Think if you were designing a system for a doctor's office that they depended to track patients and their medical needs. What if they gave the wrong dosage to a patient because of YOUR sloppy math or mistake. You just killed someone.


    One more thought about that: Given the example of a system for a doctor's office, is someone with a CS degree really sufficiently qualified to build it? Why mnot also require a degree in medicine? Can we trust someone who knows all about compilers and operating systems and finite state machines to know the difference between orthopedy and autopsy?


    With a sufficiently complex system, it can require people from more than one discipline.  I would not trust a medical program just because it was written by a medical doctor.  Who has not had to rip out end user code that did not handle all cases, did not scale, had bugs, etc.?  The author may well have known his area very well indeed, but there is also our area.

    Sincerely,

    Gene Wirchenko

  • (cs) in reply to JohnO
    JohnO:
    I love these arguments about degrees.  You can tell it's always people without a degree or without a "relevant" degree supporting this silly hypothesis.  Come on.  Do you really believe that you are superior because you lack education in the field that you are working in?  Exactly.  Neither do we.


    No, it is not.

    People without degrees can be superior for other reasons.  It is also possible that they have spent even more time studying in a given area than someone formally educated in it.  When I was working on my diploma, I found plenty of times that I would have liked to work on something more deeply, but there was not the time.

    The argument can easily be reversed: Studying on ones own shows real commitment.  Taking what an institution hands you for your education shows a lack of initiative.  Obviously, degree-holders should never be hired.

    Maybe, the truth is somewhere in between.

    Sincerely,

    Gene Wirchenko

  • TB3 (unregistered) in reply to JohnO

    I almost hate to bring this up, but JBoss Application Server throws 'bad password' exceptions. Try it sometime, and watch the stack trace. I want to bring this up on their forums, but I somehow doubt I'll get too far with the Ph.D. at JBoss.

  • (cs) in reply to Gene Wirchenko

    Gene Wirchenko:
    JohnO:
    I love these arguments about degrees.  You can tell it's always people without a degree or without a "relevant" degree supporting this silly hypothesis.  Come on.  Do you really believe that you are superior because you lack education in the field that you are working in?  Exactly.  Neither do we.


    No, it is not.

    People without degrees can be superior for other reasons.  It is also possible that they have spent even more time studying in a given area than someone formally educated in it.  When I was working on my diploma, I found plenty of times that I would have liked to work on something more deeply, but there was not the time.

    The argument can easily be reversed: Studying on ones own shows real commitment.  Taking what an institution hands you for your education shows a lack of initiative.  Obviously, degree-holders should never be hired.

    Maybe, the truth is somewhere in between.

    Sincerely,

    Gene Wirchenko

    We are talking about generalizations here.  Sure, it's possible, but not probable.  David beat Goliath but we all would have bet on Goliath.  We can add additional factors ad infinitum.  But that's not what were discussing.

  • Jon (unregistered) in reply to JohnO
    JohnO:
    We are talking about generalizations here.  Sure, it's possible, but not probable.  David beat Goliath but we all would have bet on Goliath.
    Sir, I regret to inform you that your analogy license has been revoked.

    -- The Internet Police
  • (cs) in reply to Gene Wirchenko
    Gene Wirchenko:

    With a sufficiently complex system, it can require people from more than one discipline.  I would not trust a medical program just because it was written by a medical doctor.  Who has not had to rip out end user code that did not handle all cases, did not scale, had bugs, etc.?  The author may well have known his area very well indeed, but there is also our area.


    Yes, you need both skills, plus it must be people who have the ability to communicate with each other efficiently. Or you find a person who has both skills.

    JohnO:
    I love these arguments about degrees.  You can tell it's always people without a degree or without a "relevant" degree supporting this silly hypothesis.  Come on.  Do you really believe that you are superior because you lack education in the field that you are working in?  Exactly.  Neither do we.


    In real life, you choose the guy who has successfully completed ten similar projects before.

    Not getting someone like this (or unable to pay him), you choose the graduate with a CS degree or another renowned IT focused education (if such a thing exists in your country). If this option fails, you choose a graduate from another engineering discipline, mathematics or physics with some experience in programming. Next in the row is a self-taught programmer who is a real geek and was just to busy writting his programs to ever finish a formal education. And so on. And only if you are very very desperate and must fill the position to keep your budget/importance, you choose the untalented retrained accountant with the "VB in 21 days" book.

    Anyway, not having a degree is not necessarily the same as having no formal education.
  • (cs) in reply to Gene Wirchenko


    As to the Ariane 5, my conclusion is that software reuse was a large factor.  (Yes, I know this conclusion is putting the cat in with the pigeons.)  In brief, a certain assumption was no longer valid.

    Cat, dog, and small mountain lion ;)  I'm reading a book called Object Oriented Software Construction.  Quite old (1997), but very interestin.  It talks about code reuse and how it helps maintainability, and my first thought was "it can also get you into a lot of trouble", which seems to be what you're talking about. 

    I had similar issues when two parts of our software used the same database, so I got them to use the same connection string.  Then it was decided that one of these modules would access the database under a separate user account, since it only used a small selection of the stored procedures and they wanted to have more granular control over the rights of this module.  But it was a pain to make the switch, just because I had to find the different places where that connection string was set in my build script.

  • (cs) in reply to .*
    Anonymous:
    Anonymous:
    What would you use as a Web Development Platform?
    ASP?
    ASP.NET?
    PHP4?
    PHP5?
    Perl?
    Ruby?
    Plain HTML with some AJAX with a SOAP Server?


    Python, of course. Maybe if this forum was coded in Python instead of ASP it would work without Javascript.


    Give me REBOL or give me AREXX (Or give me death)

  • (cs) in reply to johnl
    johnl:
    Gene Wirchenko:
    As to the Ariane 5, my conclusion is that software reuse was a large factor.  (Yes, I know this conclusion is putting the cat in with the pigeons.)  In brief, a certain assumption was no longer valid.


    Cat, dog, and small mountain lion ;)  I'm reading a book called Object Oriented Software Construction.  Quite old (1997), but very interestin.  It talks about code reuse and how it helps maintainability, and my first thought was "it can also get you into a lot of trouble", which seems to be what you're talking about.


    A good read, eh?

    Yes.  The danger is that systems analysis and design can be short-circuited just because code already exists.  The question needs to be asked whether the existing code meets the needs.

    In the case of the Ariane 5, the cause of the problem was a hot-standby handler that was required for the Ariane 4, but not for the Ariane 5.  The Ariane 5 has more powerful engines.  In consequence, an arithmetic overflow that was not possible on the Ariane 4 occurred with the Ariane 5.  Debug data was interpreted as navigational data.  The strains created caused the rocket to start breaking up.  Good bye, rocket.

    Sincerely,

    Gene Wirchenko

  • (cs) in reply to johnl
    johnl:

    As to the Ariane 5, my conclusion is that software reuse was a large factor.  (Yes, I know this conclusion is putting the cat in with the pigeons.)  In brief, a certain assumption was no longer valid.

    Cat, dog, and small mountain lion ;)  I'm reading a book called Object Oriented Software Construction.  Quite old (1997), but very interestin.  It talks about code reuse and how it helps maintainability, and my first thought was "it can also get you into a lot of trouble", which seems to be what you're talking about. 



    That's what pointy haired bosses too often have to learn the hard way: If you want to make a sculpture of a dog, it's probably easier and faster to start with a fresh piece of clay than taking the sculpture of a cat and try to make the body larger, the feet longer, the head longish... Only because both are four-legged mammals doesn't mean that "reuse" is better than "start-from-scratch".
  • pmagill (unregistered) in reply to Gene Wirchenko
    Gene Wirchenko:

    People without degrees can be superior for other reasons.  It is also possible that they have spent even more time studying in a given area than someone formally educated in it.  When I was working on my diploma, I found plenty of times that I would have liked to work on something more deeply, but there was not the time.


    Thank you Gene, you just proved my point here, even if you were being sarcastic in the next paragraph.  Please note, that I did mention that the degree, in my mind, is only valid for the first 5 years.  Hopefully anyone in the fields that long, degree or not, has learned the real world way of doing things and those that couldn't cut it have either left or been replaced and not hired again.  Regretfully we see that this is not the case, but we can not assume that the bad code here is written only by those without a degree, I'm sure just as much of it is written by someone with a degree but it is so far in the past that they just can't seem to grasp new concepts such as OOP.

    I mean seriously, when I was in scool, I was taking COBOL, this was in the 90's mind you and COBOL was on it's way out, but it was required for a CS major at the time.  The DB platform of choice for a PC was DB3 and most applications were written to interface with a mainframe somewhere.

    Immediatly after entering the market I found that my training did almost nothing for me as the world was turning to SQL as a DB platform and PC's as the hardware of choice rather than mainframes.  How did my time in school help me?  Only by getting me my first job, and then I was just like the guy that learned on his own, needing to start from scratch with the new languages of the day and the new environment.  The main difference?  I had a debt to pay and he didn't, he had been writtingreal world applications for the past few years and I haven't.  In truth, he was more qualified.

    In short a degree can help you get in, but it could help you unfairly as you really aren't that good.  You can read a book and follow instruction, but what happens when you are faced with a new problem your experiance never showed you?  This is where I place that five years of experiance at.  Hopefully in this time you have experianced enough things in the wild to finally think for yourself and hopefully know the right way to do things.  I will still, given two candidents with 0 experiance, but one has a degree give the job to the degree, but remember he is still a green, unexperianced, junior maintainence developer.
  • (cs) in reply to johnl

    johnl:

     I'm reading a book called Object Oriented Software Construction.  Quite old (1997), but very interestin. 

    Old?!? 1997?!? That's pretty new as far as I'm concerned.

    You need to read some of the classics: Constantite, Jackson, DeMarco, Yourden, etc, back from the late 60's and 70's. Not only will you realize that very little has changed in software development, but that all the new books are just a lame rehash (or reinvention) of the concepts of those guys pioneered.

  • (cs) in reply to Alex Papadimoulis
    Alex Papadimoulis:

    johnl:

     I'm reading a book called Object Oriented Software Construction.  Quite old (1997), but very interestin. 

    Old?!? 1997?!? That's pretty new as far as I'm concerned.

    You need to read some of the classics: Constantite, Jackson, DeMarco, Yourden, etc, back from the late 60's and 70's. Not only will you realize that very little has changed in software development, but that all the new books are just a lame rehash (or reinvention) of the concepts of those guys pioneered.


    IMO the new books rework the original "structured" methods to the object-oriented paradim.
    Let me recommend one more "classic" book (1984): McMenamin, JF Palmer: Essential Systems Analysis

    <font style="font-family: times new roman;" size="-1"></font>
  • (cs) in reply to Alex Papadimoulis

    Old?!? 1997?!? That's pretty new as far as I'm concerned.

    Well, yeah, that's the difference between "quite old" and "prehistoric"  ;)

    Just kidding, though to be fair it is 10 years old, which for OOP is quite old.  It actually talks about Ada and Fortran in it's OOP/procedural comparisons, and there's almost no C++/C#/Java code.  It reads like a book that's a lot older, but that's probably a combination between it being a 2nd edition (not sure when the 1st edition was printed) and the fact that it goes back and talks about OOP in a sort of proposal "this is an interesting idea we could try out" way.  In very few places (at least, so far as I've got in the book) does it talk about newer languages or OOP shortfalls.  For example, there's a section on multiple inheritance, and it talks about it as an aspect of OOP.  However, beyond a little footnote, it doesn't really say "you can use OOP without multiple inheritance".  That makes it seem older than 1997.

    So far, I've spotted a few cases like this, but the overall descriptions of OOP are interesting in their own right, so I'm persevering.  And it might deal with these issues later on in the book.

  • (cs) in reply to johnl

    Just kidding, though to be fair it is 10 years old, which for OOP is quite old

    Sorry, that should have read "nearly 10 years".

  • Barefoot (unregistered) in reply to Shadow_x99

    Ruby on rails would be nice.

    Of course it's like wit han electronic calculator:

    You are only allowed to use one if you ar able to do it without it. (meaning: if you can think of creating such a system yourself, but know that inventing the wheel twice is stupid as hell. ;)


    btw: this "design" editor is stupid as hell too. there's not even a selection functionality (like using shift-strg-left to mark a word)
    2nd btw: why does the first captcha not work EVERY first time i want to send a message? is this some "preview" hack? wtf?

  • (cs) in reply to JohnO
    JohnO:
    Anonymous:
    JohnO:

    How right you were. :) 

    Have you ever considered not using stupid ifs? IE if ( x ) as opposed to if ( x == true) or if ( !x ) as opposed to if ( x == false ).

    That really bugs the hell out of me.

    I don't understand how your comparisons are better than mine.  if (x).  If x what?  There's an assumption behind that line of code - about how the comparison will be evaluated, about people reading your code, about the status of x.  if (x == true) spells it out.  It leaves no doubt as to the intent of my code, or the comparison I'm wanting to make.  if (true == x) is debatedly better (assuming you're using a constant to compare against and your language of choice allows for assignment and equality tests to be easily typoed), but I find the reversed logic does nothing more than confuse the code written.

    As for if (!x) - same as above.  You're simply hiding the true comparison behind a clever bit of code that doesn't matter once the compiler has finished with it.  I only use not expressions when it makes logical sense in reading the code - if (!overdrawn) - read as not overdrawn - as compared to if (overdrawn == false).  Both make sense.  Just using ! to negate a variable doesn't - it's not clear what your intent is, it's not clear what value you're comparing against, it's not clear at all.

    I just recently helped an associate out of a bind who was trying to be clever and using the ternary operator.  He had code like this...

    return Session["Key"] != null ? null : Session["Key"];

    See a problem there?  It won't leap out at you, that's for certain, although if you're experienced you've probably solved more than your fair share of similar problems - he has the results of the comparison reversed.

    if(Session["Key"] != null)
    {
         return Session["Key"];
    }
    else
    {
         return null;
    }

    Oh no!  It's long!  It takes up screen real estate!  And it's ENTIRELY CLEAR as to what's occuring and the reversal in the first example would've never happened.  Once the optimizer gets finished there is no difference.  Some of you will complain about the unneeded braces.  Others will complain about multiple exit points.  Hey, at least I'm not using exceptions as flow control (NullReferenceException)!

    (The original code included a cast to the original object type, else he could've simply returned Session["key"] whether it was null or not.  I'm aware of this.)

    Oh well.  I am beginning to think there are hidden messages in the CAPTCHA though.  This one is bozo...

    Your whole post shows a fundamental misunderstanding of boolen types and logic.  The if statement takes a boolen expression.  If x is a boolen, then it's a boolen expression without the use of additional operators.  There's nothing "clever" about that.  By always comparing booleans to literals, you might as well never use a boolean type in the first place.



    Oh well. I guess from now on we should all turn to JohnO when we have trouble understanding "boolen" logic.
  • (cs) in reply to c--

    You mean with your spelling questions :)

  • (cs) in reply to Cyprian
    Anonymous:

    I have a BS and an MS....


    Doctors and lawyers have to get it right the first time, every time.


    Doctor's and lawyer's do not have to get it right the first time and everytime.


    "Doctor's" and "lawyer's"?  Didn't you just say you have multiple degrees?  I guess basic English grammar and spelling weren't part of the curriculum, huh?

  • (cs) in reply to Cringer, He-Man's Battlecat
    Anonymous:
    JohnO:

    if ( x ) vs. if ( x == true), if ( !x ) vs. if ( x == false )

    I don't understand how your comparisons are better than mine.  if (x).  If x what?  There's an assumption behind that line of code - about how the comparison will be evaluated, about people reading your code, about the status of x.  if (x == true) spells it out.  It leaves no doubt as to the intent of my code, or the comparison I'm wanting to make.

    But there's an assumption behind "if (x == true)" as well.  What if the reader doesn't know what the "if" statement does?  Or what "true" means?  I think it is perfectly acceptable to expect that the reader of a computer program be familiar with the programming language it is written in.

    Anonymous:

    I just recently helped an associate out of a bind who was trying to be clever and using the ternary operator.  He had code like this...

    return Session["Key"] != null ? null : Session["Key"];

    See a problem there?  It won't leap out at you, that's for certain, although if you're experienced you've probably solved more than your fair share of similar problems - he has the results of the comparison reversed.

    if(Session["Key"] != null)
    {
         return Session["Key"];
    }
    else
    {
         return null;
    }



    But what if he got the "then" and "else" sections of the if statement mixed up?  If he can mix up the two values of the ternary operator, why couldn't he get the two blocks of an if-else statement turned around?

    By the way, both pieces of code can simply be replaced by:

    return Session["Key"];


  • (cs) in reply to Cringer, He-Man's Battlecat
    Anonymous:

    (The original code included a cast to the original object type, else he could've simply returned Session["key"] whether it was null or not.  I'm aware of this.)



    Sorry, I missed this.  In that case, you could write:

    return (Whatever) Session["key"];

    null is a member of every type.

  • (cs) in reply to hank miller
    hank miller:

    I suppose someone will correct me if I'm wrong, but I'm pretty sure that there is nothing in the C standard that requires !x to be 1 when x is 0. !x could legally be any non-zero number.


    You're wrong.  Section 6.3.3.3 of the ISO C standard (I believe this is 3.3.3.3 in ANSI C) says:

    C Standard:

    The result of the logical negation operator ! is 0 if the value of its operand compares unequal to 0, 1 if the value of its operand compares equal to 0.  The result has type int.  The expression !E is equivalent to (0==E).



    Needless to say, the == operator is also defined elsewhere in the standard as resulting in a value of 1 or 0.  I believe this is true all the way back to K&R C.

    hank miller:

    The ternary operator is very useful. Messing up the order of the operators is a logic problem, not a WTF. Once you know how to use them and read them they can make code more readable. Your inability to understand some obscure part of the language does not make use of that part a WTF.


    Well said.  Although it also means that the learning curve for a language that has too many obscure corners can be unreasonably high, hence the following quote:

    Dennis M. Ritchie:

    A language that doesn't have everything is actually easier to program in than some that do.



  • Cryptic (unregistered) in reply to DrCode
    DrCode:
    Anonymous:

    I have a BS and an MS....


    Doctors and lawyers have to get it right the first time, every time.


    Doctor's and lawyer's do not have to get it right the first time and everytime.


    "Doctor's" and "lawyer's"?  Didn't you just say you have multiple degrees?  I guess basic English grammar and spelling weren't part of the curriculum, huh?



    I love it when people attack grammar, spelling and punctuation. This just shows that a person is most likely not smart enough to counter the argument, so you must try to discredit the source with irrelevent topics.

    BTW. This is a logical fallacy called Genetic Fallacy (the most common form is Ad Hominem):

    http://www.logicalfallacies.info/geneticfallacy.html

    Thanks again for the quick lesson DrCode!

Leave a comment on “Exceptional Singleton”

Log In or post as a guest

Replying to comment #:

« Return to Article