- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
The examples from the guidelines doc are month names, day names, and gender names. The counterexamples "Helluary? Wtfday? SheMale?" perfectly match the type and order of the silly examples. The counterexamples "Helluary? Wtfday? Octember?" sound like the author wasn't paying attention to his own prose even as he was writing it. It had been changed by the time I first read it, and I actually was going to suggest changing "Octember" to "Shemale" for smoother reading.
I am a straight and somewhat prudish adult man, and the presence of a flamboyant gay or a brutal dyke can make me uncomfortable. But -- but -- if the heat failed and we were freezing to death, and I had to choose between cuddling naked with a shemale, or with a person who thinks that his personal discomfort at certain words entitles him to ceaselessly chip away at beautiful and effective language -- I would rather share body heat with the shemale.
Admin
You have the right idea, but you're drawing the line wrong. On the plus side, you do seem to broadly agree that gender is a social construction (i.e., "behavior" -- admittedly, I am putting some words in your mouth with respect to nature versus nurture)
But sex, as it is known to science and medicine, is not binary -- at least not in terms of "male" and "female". Functional hermaphroditism, asexual birth, chromosomal disease (being born with YY, say) -- all of these are counter-examples to simple tests. So either there is some other binary test medicine has not discovered, or sex is a combination of characteristics.
P.C. comes in because it would be nice if we could treat these people with respect. If they choose project masculinity, great. If they choose femininity, awesome. If they choose something else, perfect. The idea extends to "regular" people. If a sexual male decides to project femininity, that is his business. If he asks you nicely to call him a her, that is between you and her. It does not seem like a particularly costly task, to me.
But going around projecting roles onto people -- people you know nothing about, except for some vague and useless classification -- is the opposite of respect.
Admin
Admin
Admin
For me, it's a matter of semantics. A method performs some significant action, while a property simply gets or sets a value. "foo.x = 5" provides that small bit of extra information over "foo.setX(5)" - the only thing you're doing is setting a property of the object.
I admit that this is really just a personal preference, but that's one possible reason for using getters/setters.
Admin
Admin
Otherwise I never would have posted about what happened when the heat failed and we were freezing to death.
Admin
And you end up with unit tests that don't test what they are actually supposed to be testing.
Admin
And how do you test this? I think some people are just incapable of understanding the reasons for unit tests: To detect the cases where you mess up. It's obvious that you can write correct code, but unit tests are for the cases where you don't. For example, is the underlying variable capable of holding the value INT_MAX? How do you test that without testing it?
Admin
Hopefully, these tests are auto-generated; otherwise you're paying hundreds of dollars an hour for a software engineer to write these tests when they could be writing production code.
Admin
Isn't that quite a strong indication you are the true person behind the Zunesis posts?
More evidence that you are Zunesis!Admin
It's simple, of course. You use a language that doesn't care about silly things like types or sizes. You know, like Python.
See? It doesn't care about the type of the members, whether or not you assign ludicrous values to them, or even whether or not you add arbitrary members to instances of classes that don't have those members. It's the Perfect Language!
Admin
He was talking about one aspect of the language. If he wanted to talk about a perfect language, he'd use Haskell.
Admin
Was the problem here boyz?
Admin
They call that an "addadictomy", right?
Captcha: facilisis - another name for Octember
Admin
Actually, gender is set in stone as soon as the egg is fertilized, and it depends entirely on whether the fertilizing sperm cell has an X or Y chromosome. Hormone concentrations in utero after that have been shown to have some effect on sexual orientation, but have absolutely no effect on physical gender.
It doesn't matter which set(s) of equipment you choose to have surgically removed or added later. You are what you are. Anything else is just pretending.
Also, telling other people what words they can and can't use on their own website lest they make you uncomfortable is narcissistic, divisive, and incredibly self-centered. Nobody has a moral obligation to avoid offending you.
Admin
There will no manipulating of members, while I am on this forum.
Admin
Making point is only secondary. Primary thing is story did take place.
Admin
Read, wtf? Read, wtf? Read, wtf? Think: Who the hell could this really happen too? Scroll up. Scroll up. Read, Oh, Snoofle. Think: Of course. Scroll down. Scroll down. Read, wtf? Read, wtf? Read, wtf?
Admin
Admin
Every day is WTFDay!
Admin
On unit tests...
They can be useful, but CAN lead you astray. In one case, a contract builder decided to just copy the address prom from the master example (instead of the properly serialized one from a particular vendor) of a network card into all the units he built. They worked just peachy in "unit test" and did well. The problem arose when you used two such cards on the same network, and all hell broke loose to fail miserably.
Kinda like counterfit bills having the same serial number. Not too smart!
Don't ask me how I know about this problem.
Admin
O yes there is many reasons to test them
What if the setter is expected to enforce a limit on which values you can set, for example only 0-4 to prevent invalid values to find it's way into some legacy code.
NOT testing that 5 causes an error is a major mistake.
Tests should not only check for valid uses, but also make sure that invalid uses throw exception or in some other way prevent misuse.
Admin
I've actually done that. Works quite well, actually. In Java, it's not too hard to find and load every application class in the system. And then, using Java Bean conventions, find all the getter-setter pairs, check their types, and go into different code for each type to check the proper values.
This might seem kind of useless and crazy -- except for the fact that the GxdDxmmxdUsxlxssPxxcxOfShxt(TM) CASE tool we were forced to use had a bad habit of "randomly" replacing method bodies with nothing or "return null" or likewise. It can be a real nightmare to debug a system where getter and setter methods are "killed" randomly by your CASE tool. So the ONE AND ONLY ONE gettter-setter test quickly isolated the REALLY STUPID cases where the CASE tool killed a getter or setter method. :-/
(Yes, the single master getter-setter test "knew" about the small number of getter-setter pairs that had really creative functionality -- and handled them appropriately. It's not hard. Really.)
Admin
As an Australian male, I refer to all my colleagues, friends, family, strangers... everyone really, as (CAPTCHA) caecus
Admin
Admin
You think you're being all clever and sarcastic, but you're not. You're just a dick.
Admin
You're thinking of octmember, not Octember.
Admin
[quote user="ShachMaT"][quote user="merb"]
The real WTF is starting with Sunday?[/quote]http://www.timeanddate.com/calendar/days/ Ask no more.
From the website: "Sunday is regarded as the first day of the week ..." which isn't a fact carved in stone as most of Europe counts differently. It refers to the bible and I find it amusing that God started to rest and then worked. (Not a bad idea, really!)
Admin
Making them look exactly like the desktops from which secure material is accessible, thus depriving potential attackers of a covert channel that they could otherwise use to identify machines it would be worth concentrating their attacks on.
Admin
Which is exactly what he was talking about. For example C#
public int X;
Usage: someObject.X = 5;
now your requirement change comes into play so you turn the public variable into a property:
int x; int X { get {return x;} set { if(value <6) { x = value; } } }
Usage: someObject.X = 5;
Because C# does not rely on a stupid getSomething() setSomething()the syntax for using a property and using a public variable stay identical. Even though it's nothing but syntactical sugar this makes alle the difference in the world, because it allows you to change the behavior of your porperties without a syntactical breaking change that will force you to change every piece of code that references that variable.
Of course the above example is still a behavioral breaking change that has to be communicated to all the consumers of your API. They still won't be happy, but at least they won't murder you because if you know what you're doing chances are there was a good reason why you made the behavioral change.
Captcha ingenium: What I take every day before plotting world domination.
Admin
And by "breaking behavioral change" you mean that everything that references that variable (now property) has to be recompiled because the CIL for properties is different than the CIL for variables. Which is why MS recommends using properties from the start (and why Sun/Oracle recommends using setters/getters in Java).
Admin
I'll bet the Security Complaince Department gets a lot of 'em after this missive...
Admin
An enum in one place in code is at least as convenient as an enumeration of values in a DB table - IMO, more convenient - if you only have one system/app accessing the enums. If you have multiple apps, written in different languages, that need that enumeration, then the DB is one possible convenient place to store that enumeration.
In the example of physical paint colors, these are most probably a property/attribute of paint that can change over time - the name of it can change, there can be varying hues/compositions/etc., and you wouldn't delete the color just because you ran out, you would mark the item in inventory as "out of stock" and/or "back-ordered".
The time to move enums from a DB to code is when the items rarely, if ever, change - like the days of a week (for which many languages already have an enum), months, holidays, etc.
However, if some SQL query needs to depend on the enum (for good reason, not just because it is there), then having it in a DB table is often not a bad idea. But having it in a DB table simply because it can be read into the code is not - in my experience it leads to a lot of unnecessary code, and often the dev who thought this was a good idea didn't think about caching or the cost of one, much less multiple repeated DB reads.
Admin
The part that I don't understand is "Unit tests must cover the full range of values for affected variables/methods". If that is the case, then shouldn't their unit test cover the entire range of an int?
class SomeObject { private int x; public void setX(int x) { this.x = x; } public int getX() { return x; } } @Test // for: member: int x public void memberXtest() { SomeObject o = new SomeObject(); int i; // test the entire range of integers for (i = Integer.MIN_VALUE; i <= Integer.MAX_VALUE; ++ i) { o.setX(i); assertEquals(i, o.getX()); sleep(10); if (i >= Integer.MAX_VALUE) break; // avoid an infinite loop } }
Admin
Yet a majority of people are clearly male or female based on their...parts. Sure, some are exceptions to this rule, but that can be just as easily attributed to a breakdown of nature in some way vs a license to redefine clearly defined roles.
Admin
Forgot the quote...
Admin
[quote user="Yep, srsly!"][quote user="srsly"]Right. And biologists know that physical gender is set as a function of how much testosterone a fetus receives in the early stages of pregnancy.[/quote]
Actually, gender is set in stone as soon as the egg is fertilized, and it depends entirely on whether the fertilizing sperm cell has an X or Y chromosome. Hormone concentrations in utero after that have been shown to have some effect on sexual orientation, but have absolutely no effect on physical gender.
It doesn't matter which set(s) of equipment you choose to have surgically removed or added later. You are what you are. Anything else is just pretending.[/quote] [/quote]
Or two Y chromosomes. Or no sex chromosomes.
Or sometimes, you get an embryo with XY chromosomes (so it's chromosomally male), but that doesn't respond to androgens and therefore doesn't develop male genitalia and is physically female.
Or sometimes you get people who have a penis, but ovaries instead of testes.
And there are intersex people, whose genitalia are ambiguous (at best) and are often assigned a gender by the obstetrician which might not represent their chromosomes at all.
It's really not a binary situation.
[quote]Also, telling other people what words they can and can't use on their own website lest they make you uncomfortable is narcissistic, divisive, and incredibly self-centered. Nobody has a moral obligation to avoid offending you.[/quote]
Personally, I didn't read it that way. I read it as "hey, some people will be offended by that; you might want to think about changing it".
Obviously, everyone has the right to be deliberately offensive if they so choose, but I've never understood people taking pride in this right. Why wouldn't you want to be considerate of others?
Admin
Admin
I'm not sure whether you want to say that Sunday is the 1st day of the week or not.
It would have been easier and unambigious to refer to ISO 8601 which declares Monday as the 1st day of the week.
Admin
Sunday is the first day of the week because 'Murica.
Admin
0/1 constants for Male / Female? OK, maybe 0/1/2 for Unknown / Male / Female. OBSOLETE! Last I heard Facebook was up to some 40 different sex designations.
Every time I fill out a government form, and there is box labelled "Sex: [ ] Male [ ] Female", I wonder if I should enter what I am or what I want.
Admin
Admin
Also it depends on which country you're in. This is year 26 but years of previous eras didn't just disappear from history.[*]
[* Though some malicious actions undertaken during previous eras do just disappear from history, because every year is 1984 in Japan.]
Admin
Why would you need to lock the spreadsheet just to edit your row? Excel allows shared spreadsheets, and as long as multiple people don't edit the same cell it works pretty well.
At least until one person accidentally deletes the sheet.
Admin
I admit, being from the frozen tundra of Minnesota, I LOL'd at "Helluary"
Admin
Actually, that should be Female/Male/Unknown so that the 0 and 1 symbolically represent female and male sexual organs, and so that *ists have something to complain about.
Admin
I think it's a bit more accurate for us in Australia, when during February we consistently beat Hell's own temperature records for every day of the month
Admin
Admin