I hate outsourcing...
-
well I'm reasonably new in my current role, 8 or so months, but have been working with c# since version 1.0 of the .net framework. It still amazes me what you see in code written by the lowest bidder, and the inexperienced, but why oh why would you do this?...
public enum YesNo { N = 0, Y = 1 }
...yes, this is live, production code, and just one of many, many examples of how not to do a job properly.Rhys "Technological progress is like an axe in the hands of a pathological criminal" "Two things are infinite: the universe and human stupidity; and I'm not sure about the the universe"
-
well I'm reasonably new in my current role, 8 or so months, but have been working with c# since version 1.0 of the .net framework. It still amazes me what you see in code written by the lowest bidder, and the inexperienced, but why oh why would you do this?...
public enum YesNo { N = 0, Y = 1 }
...yes, this is live, production code, and just one of many, many examples of how not to do a job properly.Rhys "Technological progress is like an axe in the hands of a pathological criminal" "Two things are infinite: the universe and human stupidity; and I'm not sure about the the universe"
-
Change it to this:
public enum YesNoMaybeBuzzOff
{
M = -1,
N = 0,
Y = 1,
BO = 42
}At least artificial intelligence already is superior to natural stupidity
-
Change it to this:
public enum YesNoMaybeBuzzOff
{
M = -1,
N = 0,
Y = 1,
BO = 42
}At least artificial intelligence already is superior to natural stupidity
Change it to
enum YesNo
{
N=0,
Y=1,
FileNotFound=-1
}Bill Gates is a very rich man today... and do you want to know why? The answer is one word: versions. Dave Barry Read more at [BrainyQuote](http://www.brainyquote.com/quotes/topics topic_technology.html#yAfSEbrfumitrteO.99)[^]
-
Change it to
enum YesNo
{
N=0,
Y=1,
FileNotFound=-1
}Bill Gates is a very rich man today... and do you want to know why? The answer is one word: versions. Dave Barry Read more at [BrainyQuote](http://www.brainyquote.com/quotes/topics topic_technology.html#yAfSEbrfumitrteO.99)[^]
-
well I'm reasonably new in my current role, 8 or so months, but have been working with c# since version 1.0 of the .net framework. It still amazes me what you see in code written by the lowest bidder, and the inexperienced, but why oh why would you do this?...
public enum YesNo { N = 0, Y = 1 }
...yes, this is live, production code, and just one of many, many examples of how not to do a job properly.Rhys "Technological progress is like an axe in the hands of a pathological criminal" "Two things are infinite: the universe and human stupidity; and I'm not sure about the the universe"
Without more context that seems OK to me. I might use something like that when parsing a stream of input into a database.
-
Without more context that seems OK to me. I might use something like that when parsing a stream of input into a database.
I agree; this could be useful, depending on the context. Another context I can think of that would be useful is a web service that returns what a user chose (e.g., they may select "yes" they'd like to subscribe to a service or "no" that they don't want an email newsletter).
-
Without more context that seems OK to me. I might use something like that when parsing a stream of input into a database.
Obviously the c# boolean type just isn't good enough in some places then... ...any further justification and you guys should hide your heads in shame... :rolleyes:
Rhys "Technological progress is like an axe in the hands of a pathological criminal" "Two things are infinite: the universe and human stupidity; and I'm not sure about the the universe"
-
Obviously the c# boolean type just isn't good enough in some places then... ...any further justification and you guys should hide your heads in shame... :rolleyes:
Rhys "Technological progress is like an axe in the hands of a pathological criminal" "Two things are infinite: the universe and human stupidity; and I'm not sure about the the universe"
-
Obviously the c# boolean type just isn't good enough in some places then... ...any further justification and you guys should hide your heads in shame... :rolleyes:
Rhys "Technological progress is like an axe in the hands of a pathological criminal" "Two things are infinite: the universe and human stupidity; and I'm not sure about the the universe"
Rhys Gravell wrote:
Obviously the c# boolean type just isn't good enough in some places then
Correct, it's very limited. :~
-
well I'm reasonably new in my current role, 8 or so months, but have been working with c# since version 1.0 of the .net framework. It still amazes me what you see in code written by the lowest bidder, and the inexperienced, but why oh why would you do this?...
public enum YesNo { N = 0, Y = 1 }
...yes, this is live, production code, and just one of many, many examples of how not to do a job properly.Rhys "Technological progress is like an axe in the hands of a pathological criminal" "Two things are infinite: the universe and human stupidity; and I'm not sure about the the universe"
You lucky youngster! You cannot remeber the "Good" Old Days when Booleans had to be transformed to numbers. Well, "no" or "false" was generally 0, but "yes" or "true" had many definitions: 1, -1, 255 - these are just the most important ones I still remember. And now imagine you have to write a new front end which communicates with a MUMPS server...
-
You lucky youngster! You cannot remeber the "Good" Old Days when Booleans had to be transformed to numbers. Well, "no" or "false" was generally 0, but "yes" or "true" had many definitions: 1, -1, 255 - these are just the most important ones I still remember. And now imagine you have to write a new front end which communicates with a MUMPS server...
MUMPS server, now I feel a little ill X|
Rhys "Technological progress is like an axe in the hands of a pathological criminal" "Two things are infinite: the universe and human stupidity; and I'm not sure about the the universe"