Comment On Status

"In late 2009, I started a new job at a large logistics corporation," Nikos writes, "it was on my first day that I learned that 'quality' and 'best practices' can mean vastly different things to different people. Within my first week, I learned that I should probably ask a lot more questions about the system I will be spending 8 hours a day maintaining. Within my first month, I started counting my days." [expand full text]
« PrevPage 1 | Page 2 | Page 3Next »

Re: Status

2010-12-22 16:30 • by frits
332813 in reply to 332801
vulputate:
frits:
Grammer Nazi:
Polar Bear:
boog:
wheaties:
That's got to be the most succinct WTF I've seen in a while. I love the longer stories but the short ones leave the rest to your imagination.

Reading comprehension fail. While you might be forgiven for not realizing their's a category called "Representative Line," your not forgiven for failing to read that fact stated implicitly in the story.


And you're not forgiven for you incorrect use of the word "your".

Captcha: Ingenium...perhaps your use of the word was "ingenium".

And you're not forgiven for your incorrect use of the word "you."


I think you got you're your's mixed up their, buddy.

Easiest way to troll on this forum is using "your" in place of "you're."
The troll has earned more comments than the article.


Whereas your mispelling, pal? Or orange you in on the joke?

Re: Status

2010-12-22 16:39 • by The Corrector (unregistered)
332815 in reply to 332810
ÃÆâ€â„:
Hieflenhiemer:
More Grandma Nazis:
Uh...:
Grammer Nazi:
Polar Bear:
boog:
wheaties:
That's got to be the most succinct WTF I've seen in a while. I love the longer stories but the short ones leave the rest to your imagination.

Reading comprehension fail. While you might be forgiven for not realizing their's a category called "Representative Line," your not forgiven for failing to read that fact stated implicitly in the story.


And you're not forgiven for you incorrect use of the word "your".

Captcha: Ingenium...perhaps your use of the word was "ingenium".

And you're not forgiven for your incorrect use of the word "you."

And you're not forgiven for misspelling "Grammar".
</pedantic>


I have to assume the mistake was deliberate....

mispelling (mis prefixed to spelling)

The wiggly red line underneath tells you that it's spelt (spelled, apparently) wrong

Man, you're stupid. How hard is it to hit dictionary.com?

They only know TDWTF. This is where they satisfy their urge to insult the articles and/or pick up bad programming tips.

Re: Status

2010-12-22 16:48 • by Fer (unregistered)
332816 in reply to 332795
pauly:
Polar Bear:
boog:
wheaties:
That's got to be the most succinct WTF I've seen in a while. I love the longer stories but the short ones leave the rest to your imagination.

Reading comprehension fail. While you might be forgiven for not realizing their's a category called "Representative Line," your not forgiven for failing to read that fact stated implicitly in the story.


And you're not forgiven for <b>you</b> incorrect use of the word "your".

Captcha: Ingenium...perhaps your use of the word was "ingenium".


Muphrey's Law... Every fuck time! It almost never fails.

PS: How can I make something bold in this forum???


you could submit a WTF clearly identifying your boss/company.

Re: Status

2010-12-22 17:00 • by Mike (unregistered)
332817 in reply to 332765
//Status (none, active, finished - default value is false)

public String status;

If the coder associated Null with False it could explain the comment and the lack of assignment?

Re: Status

2010-12-22 17:10 • by John Evans (unregistered)
"Status" probably refers to the status of the status. In other words, there's a variable called actualStatus somewhere else in the code that holds the actual status; Status holds the status of the actual status held in actualStatus. If Status is "none", then actualStatus is null or "". If Status is "active", then actualStatus does not have a final value in it. If Status is "finished" then you can safely use the value in actualStatus.

However, the default value of Status is "false"...which means that actualStatus is false. You can't trust its value. DON'T TRUST IT, MAN!

Re: Status

2010-12-22 17:28 • by oheso (unregistered)
For me TRWTF is the fact there are no statuses to indicate development and testing. Is this a developmestuction environment?

Re: Status

2010-12-22 17:40 • by Anon (unregistered)
TRWTF is that the code contains two lines.

Re: Status

2010-12-22 17:59 • by Matt (unregistered)
332822 in reply to 332820
Anon:
TRWTF is that the code contains two lines.


No you Anon. There is only one line of "code". The other line is a comment.

Re: Status

2010-12-22 18:07 • by There is rover (unregistered)
their's, askimet

Re: Status

2010-12-22 18:14 • by A C# Guy (unregistered)
So if this is Java, is it standard to make fields public and lower case?

In C# we never make fields public- they are always acceesed through properties- I assumed best practice in Java was to use getters and setters. And lower casing a public field is a good way to confuse people used to normal standards.

As for the status value being a string and uninitialized, this is totally forgivable if you are using an OR mapper that is mapping a value from the database that is stores as text. Otherwise that is an additional WTF.

It might not seem like much on it's own, but code filled with direct access to public properties that do not use standard casing conventions and favors uninitialzed strings over enumerations would be pretty painful IMO.

Re: Status

2010-12-22 18:17 • by Maurits
332825 in reply to 332801
vulputate:
The troll has earned more comments than the article.


Sadly, I can infer only that the troll was more interesting than the article.

Re: Status

2010-12-22 18:27 • by hoodaticus
332826 in reply to 332824
A C# Guy:
So if this is Java, is it standard to make fields public and lower case?

In C# we never make fields public- they are always acceesed through properties- I assumed best practice in Java was to use getters and setters. And lower casing a public field is a good way to confuse people used to normal standards.

As for the status value being a string and uninitialized, this is totally forgivable if you are using an OR mapper that is mapping a value from the database that is stores as text. Otherwise that is an additional WTF.

It might not seem like much on it's own, but code filled with direct access to public properties that do not use standard casing conventions and favors uninitialzed strings over enumerations would be pretty painful IMO.
Do OR mappers work on fields? I thought they tend to map to properties so that the getters and setters can be called....

Re: Status

2010-12-22 18:29 • by hoodaticus
332827 in reply to 332825
Maurits:
vulputate:
The troll has earned more comments than the article.


Sadly, I can infer only that the troll was more interesting than the article.
False dichotomy. We're all trolls, and we all find ourselves more interesting than the artikle.

Re: Status

2010-12-22 18:32 • by DonQHoti (unregistered)
332828 in reply to 332815
So when is someone going to go off on "their's"?

Re: Status

2010-12-22 18:42 • by hoodaticus
332829 in reply to 332824
A C# Guy:
It might not seem like much on it's own, but code filled with direct access to public properties that do not use standard casing conventions and favors uninitialzed strings over enumerations would be pretty painful IMO.
I'd wretch at the ugliness of it all. Also, maintenance of the project would stop until it could be re-written. I don't refactor utter shit; bad code usually indicates bad architecture that will haunt the project even after a full refactoring.

Re: Status

2010-12-22 19:48 • by A C# Guy (unregistered)
Oops, I meant "Public Fields", but I guess my meaning was taken.

Regarding OR mapping on fields- you are right, at least as far as nHibernate goes.
I didn't think about that since i don't generally have fields the OR mapper would be able to access. I just know we have several public status properties in our app that are strings due to OR mapping needs, but we provide enumeration conversion method that developers are encouraged to use in these cases.

Re: Status

2010-12-22 20:21 • by MarkJ
332832 in reply to 332803
LANMind:
Good Lord, what a bunch of banal replies...
The Lord has very little to do with this enterprise.

Re: Status

2010-12-22 20:38 • by Kuba
332833 in reply to 332767
Punkin Pie:
boog:
so he made the status a string. Probably not the best option

Sounds like you don't have much real-world experience (well, not experience with J2EE, anyway). When you graduate, you may find that 1) there are many things that are configured using XML, and 2) developers hate writing XSDs (or DTDs either for the pedantic). When you write objects to map to the strings found in the XML produced by outside vendors, there is literally no way to determine beforehand what string values will be. Furthermore, it may not even be necessary to know, since you later just convert back to XML and send or simply persist to the database.
Enter a table with a column full of values where false might look like any of the following: "false", "FALSE", "FLSE", "0", "0.0", "no", "-1". Good luck running reports on such "data". Who the fsck writes XSDs or DTDs by hand if it's too hard for them? There's plenty of tools, heck, what about a good craftsman making his/her own tool when in need?

Re: Status

2010-12-22 20:54 • by Pervert (unregistered)
332834 in reply to 332757
wheaties:
I love the longer stories but the short ones leave the rest to your imagination.

Just like a nice girl in underwear.

Re: Status

2010-12-22 20:59 • by random_garbage
332835 in reply to 332824
A C# Guy:
In C# we never make fields public- they are always acceesed through properties- I assumed best practice in Java was to use getters and setters.
Never/always? Those are pretty strong terms... While there is a convention of using properties in favour of direct field access, it's not an absolute...

A C# Guy:
... a good way to confuse people used to normal standards.
Normal standards vary from person to person, and from project to project. Assuming anything more than is established from the project actively being worked on is setting yourself up for confusion and trouble...

Re: Status

2010-12-22 21:02 • by Pervert (unregistered)
332836 in reply to 332805
Ouch!:
pauly:

PS: How can I make something bold in this forum???

By using the appropriate BBCode, there's a ling directly above the edit box.


That's the most cunning ling for us to use. Thank you.

Re: Status

2010-12-22 21:33 • by bgw (unregistered)
+1

I'll even go get the gun.

Re: Status

2010-12-22 22:18 • by A C# Guy (unregistered)
332839 in reply to 332835
random_garbage:
A C# Guy:
In C# we never make fields public- they are always acceesed through properties- I assumed best practice in Java was to use getters and setters.
Never/always? Those are pretty strong terms... While there is a convention of using properties in favour of direct field access, it's not an absolute...
Never/Always without a good reason. Yes, there are exception cases- but you know that is the convention right? So rather than interpreting my post as being about absolute standards maybe you ought to give me a little credit and assume that I was commenting on the code in question, which we have every reason to believe had no good reason to defy standard conventions.

And if you showed up using lower cased public fields in my project without good cause, we'd have words. Polite, instructive words because I'm a nice guy and not an internet tough guy, but I'd hope you'd be willing to come along and work with the team rather than against :)

random_garbage:
A C# Guy:
... a good way to confuse people used to normal standards.
Normal standards vary from person to person, and from project to project. Assuming anything more than is established from the project actively being worked on is setting yourself up for confusion and trouble...
I'm sure it's quite a safe assumption in this case being that we are told this is an example of code that does not adhere properly to standards.

I would never presume to know the standards of a project unless I was working on it, and the first thing I do before I start coding is find out what the standards are. But as I said, when we are told that the coder in question had issues with standards and best practices I think we can assume that the shop in question isn't going with a "hey, let's used lowercase public strings for statuses!" standard. We might assume they have NO standards, in which case a good coder is going to fall back to something fairly prevalent in the industry.

Re: Status

2010-12-22 22:19 • by Power Troll
332840 in reply to 332824
A C# Guy:
So if this is Java, is it standard to make fields public and lower case?

In C# we never make fields public- they are always acceesed through properties- I assumed best practice in Java was to use getters and setters. And lower casing a public field is a good way to confuse people used to normal standards.

As for the status value being a string and uninitialized, this is totally forgivable if you are using an OR mapper that is mapping a value from the database that is stores as text. Otherwise that is an additional WTF.

It might not seem like much on it's own, but code filled with direct access to public properties that do not use standard casing conventions and favors uninitialzed strings over enumerations would be pretty painful IMO.


Yes, of course.

Nobody would ever, you know, have multiple constructors which initialize the string before the field can even be accessed. If that ever happened, the JVM executing the code would automatically terminate the current threads, spawn a new thread that sends an email directly to James Gosling with appropriate geolocation information, who would then ride up in a chariot, with Duke as a passenger, and exclaim, "YOU! You are not worthy!!!" The developer(s) in question would then be forced to using Malbolge for the next 50 years.

Re: Status

2010-12-22 22:27 • by marsh (unregistered)
332841 in reply to 332782
Mike:

Almost:
//Result (none, active, finished - default value is false)

public String status = (true ? bool.Parse("true").toString() : bool.Parse("false").toString());


There we go. Very enterprisey.

No factory?

Re: Status

2010-12-22 22:33 • by A C# Guy (unregistered)
332842 in reply to 332840
Power Troll:
A C# Guy:
So if this is Java, is it standard to make fields public and lower case?

In C# we never make fields public- they are always acceesed through properties- I assumed best practice in Java was to use getters and setters. And lower casing a public field is a good way to confuse people used to normal standards.

As for the status value being a string and uninitialized, this is totally forgivable if you are using an OR mapper that is mapping a value from the database that is stores as text. Otherwise that is an additional WTF.

It might not seem like much on it's own, but code filled with direct access to public properties that do not use standard casing conventions and favors uninitialzed strings over enumerations would be pretty painful IMO.


Yes, of course.

Nobody would ever, you know, have multiple constructors which initialize the string before the field can even be accessed. If that ever happened, the JVM executing the code would automatically terminate the current threads, spawn a new thread that sends an email directly to James Gosling with appropriate geolocation information, who would then ride up in a chariot, with Duke as a passenger, and exclaim, "YOU! You are not worthy!!!" The developer(s) in question would then be forced to using Malbolge for the next 50 years.


I wasn't taking a swipe at Java. Given (I believe) the absence of property syntax in Java, I did not know if public fields were more accepted in the Java world.

As for initializing in the constructor- sure. It might be there, it might not be. I assume the worst from context given where this code was posted- but honestly, initialization is the least of the issues here.

Re: Status

2010-12-22 23:05 • by frits
The beauty of this WTF is that "status" could be completely unused and not even cause a compiler warning, which, of course, would simultaneously diminish and amplify the WTF-ness of this line of code.

Re: Status

2010-12-23 03:09 • by Matt Westwood (unregistered)
332845 in reply to 332808
Hieflenhiemer:
More Grandma Nazis:
Uh...:
Grammer Nazi:
Polar Bear:
boog:
wheaties:
That's got to be the most succinct WTF I've seen in a while. I love the longer stories but the short ones leave the rest to your imagination.

Reading comprehension fail. While you might be forgiven for not realizing their's a category called "Representative Line," your not forgiven for failing to read that fact stated implicitly in the story.


And you're not forgiven for you incorrect use of the word "your".

Captcha: Ingenium...perhaps your use of the word was "ingenium".

And you're not forgiven for your incorrect use of the word "you."

And you're not forgiven for misspelling "Grammar".
</pedantic>


I have to assume the mistake was deliberate....

mispelling (mis prefixed to spelling)

The wiggly red line underneath tells you that it's spelt (spelled, apparently) wrong

Man, you're stupid. How hard is it to hit dictionary.com?


How easy is it to know that you *need* to hit dicotnary.com?

Re: Status

2010-12-23 03:11 • by Matt Westwood (unregistered)
332846 in reply to 332772
Winston Ewert:
There may well be cases where a string is the best status, I'd say that in most cases its a poor choice. I prefer my types to indicate something useful. Certainly, thats no basis for impuning someone's real world experience.



That's "impugning" btw.

Re: Status

2010-12-23 03:25 • by Kohlrak (unregistered)
332847 in reply to 332763
Same here. (Although, i would disagree on how harmless it is if it turns out they use strings for almost everything.)

Re: Status

2010-12-23 07:45 • by C (unregistered)
public bool status; //default status is 3

Re: Status

2010-12-23 09:26 • by bjolling
332851 in reply to 332845
Matt Westwood:
Hieflenhiemer:
More Grandma Nazis:
Uh...:
Grammer Nazi:
Polar Bear:
boog:
wheaties:
That's got to be the most succinct WTF I've seen in a while. I love the longer stories but the short ones leave the rest to your imagination.

Reading comprehension fail. While you might be forgiven for not realizing their's a category called "Representative Line," your not forgiven for failing to read that fact stated implicitly in the story.


And you're not forgiven for you incorrect use of the word "your".

Captcha: Ingenium...perhaps your use of the word was "ingenium".

And you're not forgiven for your incorrect use of the word "you."

And you're not forgiven for misspelling "Grammar".
</pedantic>


I have to assume the mistake was deliberate....

mispelling (mis prefixed to spelling)

The wiggly red line underneath tells you that it's spelt (spelled, apparently) wrong

Man, you're stupid. How hard is it to hit dictionary.com?


How easy is it to know that you *need* to hit dicotnary.com?
What's a dicotnary?

Re: Status

2010-12-23 10:05 • by Two (unregistered)
332853 in reply to 332851
bjolling:
Matt Westwood:
Hieflenhiemer:
More Grandma Nazis:
Uh...:
Grammer Nazi:
Polar Bear:
boog:
wheaties:
That's got to be the most succinct WTF I've seen in a while. I love the longer stories but the short ones leave the rest to your imagination.

Reading comprehension fail. While you might be forgiven for not realizing their's a category called "Representative Line," your not forgiven for failing to read that fact stated implicitly in the story.


And you're not forgiven for you incorrect use of the word "your".

Captcha: Ingenium...perhaps your use of the word was "ingenium".

And you're not forgiven for your incorrect use of the word "you."

And you're not forgiven for misspelling "Grammar".
</pedantic>


I have to assume the mistake was deliberate....

mispelling (mis prefixed to spelling)

The wiggly red line underneath tells you that it's spelt (spelled, apparently) wrong

Man, you're stupid. How hard is it to hit dictionary.com?


How easy is it to know that you *need* to hit dicotnary.com?
What's a dicotnary?


It's where the dicotomies are stored.

Re: Status

2010-12-23 10:09 • by zdux (unregistered)
Where's the beef?

Re: Status

2010-12-23 10:10 • by ContraCorners
332856 in reply to 332813
frits:
vulputate:
frits:
Grammer Nazi:
Polar Bear:
boog:
wheaties:
That's got to be the most succinct WTF I've seen in a while. I love the longer stories but the short ones leave the rest to your imagination.

Reading comprehension fail. While you might be forgiven for not realizing their's a category called "Representative Line," your not forgiven for failing to read that fact stated implicitly in the story.


And you're not forgiven for you incorrect use of the word "your".

Captcha: Ingenium...perhaps your use of the word was "ingenium".

And you're not forgiven for your incorrect use of the word "you."


I think you got you're your's mixed up their, buddy.

Easiest way to troll on this forum is using "your" in place of "you're."
The troll has earned more comments than the article.


Whereas your mispelling, pal? Or orange you in on the joke?
Will no one mention Boog's mis-use of "their?"

Re: Status

2010-12-23 10:37 • by Ouch! (unregistered)
332857 in reply to 332856
ContraCorners:
Will no one mention Boog's mis-use of "their?"

I think you just did.

Re: Status

2010-12-23 10:45 • by Svenson (unregistered)
332858 in reply to 332767
Punkin Pie:
When you write objects to map to the strings found in the XML produced by outside vendors, there is literally no way to determine beforehand what string values will be.


I thought XML was self-documenting...

Re: Status

2010-12-23 11:03 • by itsmo (unregistered)
332859 in reply to 332771
Polar Bear:
boog:
wheaties:
That's got to be the most succinct WTF I've seen in a while. I love the longer stories but the short ones leave the rest to your imagination.

Reading comprehension fail. While you might be forgiven for not realizing their's a category called "Representative Line," your not forgiven for failing to read that fact stated implicitly in the story.


And you're not forgiven for you incorrect use of the word "your".

Captcha: Ingenium...perhaps your use of the word was "ingenium".


Feck - not again! Let's just cut this dead right now and replace "your" and "you're" with "yor" just for WTF comments...

Re: Status

2010-12-23 11:08 • by neminem (unregistered)
332860 in reply to 332859
itsmo:
Feck - not again! Let's just cut this dead right now and replace "your" and "you're" with "yor" just for WTF comments...

Can we replace them with "yarr" instead?

Re: Status

2010-12-23 11:08 • by itsmo (unregistered)
332861 in reply to 332805
Ouch!:
pauly:

PS: How can I make something bold in this forum???

By using the appropriate BBCode, there's a ling directly above the edit box.


A fish? - does thios go with the Unicorns and Rainbows?

Re: Status

2010-12-23 11:09 • by itsmo (unregistered)
332862 in reply to 332861
itsmo:
Ouch!:
pauly:

PS: How can I make something bold in this forum???

By using the appropriate BBCode, there's a ling directly above the edit box.


A fish? - does thios go with the Unicorns and Rainbows?


Muphry's law - too true!!

Re: Status

2010-12-23 11:19 • by itsmo (unregistered)
332863 in reply to 332860
neminem:
itsmo:
Feck - not again! Let's just cut this dead right now and replace "your" and "you're" with "yor" just for WTF comments...

Can we replace them with "yarr" instead?


if yarr must

Re: Status

2010-12-23 11:24 • by airdrik (unregistered)
The status field is used to report the status of the application. When it starts up the status is unset because the application is still initializing. When the application finishes initializing and starts processing then status gets set to active. When the application finishes then the status is set to finish. This way the developers know when they can terminate the application - they can just connect to it with a debugger and monitor the field while the application is running and when it gets set to finish then they kill the application.

The field is public (on a publicly-accessible singleton) so that any part of the application can read (and set) it so that they know if they need to be initializing, running or shutting down. Then if the developers find that something didn't finish initializing when the application started processing, they can just set status back to null and those parts will detect it and go back to initializing again; or if something didn't process when the application finished, they can set it to active and the application will go back and process what hadn't been processed yet.
They could even set it to something like "init-K2" to tell the K2 subsystem to reinitialize itself. Can you feel the power? I can!

That's such an awesome solution. I need to put some of that in the applications we have here, just in case.

grammar warrior

2010-12-23 11:31 • by Machtyn (unregistered)
Where were you?
We're here.
You're in your room of yore.
They're there in their room.
It's better to have its own thing.

Is it so hard?

Re: grammar warrior

2010-12-23 11:41 • by frits (unregistered)
332866 in reply to 332865
Machtyn:
Where were you?
We're here.
You're in your room of yore.
They're there in their room.
It's better to have its own thing.

Is it so hard?


I here ya, man.

Re: Status

2010-12-23 11:55 • by ContraCorners
332868 in reply to 332857
Ouch!:
ContraCorners:
Will no one mention Boog's mis-use of "their?"

I think you just did.
So I must be no one.

Re: Status

2010-12-23 11:59 • by Egyptian Slave (unregistered)
332869 in reply to 332853
This is turning into quite the angry pyramid of trolling, bad spelling and soapboxing. Nothing could make it more angry.

Sarah Palin writes VB code on an embedded filesystem while on her mommy and daddy's modem, but has to have a happy holiday by printing her code out on placing it on a wooden table which fristly is where she wrote unicorns and rainbows by accident while trying to write a perl script using GOTOs for her inept boss named Bobby Tables that would cut Social Security Benifits from TSA screeners on welfare.

Re: Status

2010-12-23 12:03 • by fgth (unregistered)
332870 in reply to 332822
It's one comment and one data definition. Good "code" is sometimes commented. Not that you would know.

Re: Status

2010-12-23 12:04 • by Egyptian Slave's Master (unregistered)
332871 in reply to 332853
Two:
bjolling:
Matt Westwood:
Hieflenhiemer:
More Grandma Nazis:
Uh...:
Grammer Nazi:
Polar Bear:
boog:
wheaties:
That's got to be the most succinct WTF I've seen in a while. I love the longer stories but the short ones leave the rest to your imagination.

Reading comprehension fail. While you might be forgiven for not realizing their's a category called "Representative Line," your not forgiven for failing to read that fact stated implicitly in the story.


And you're not forgiven for you incorrect use of the word "your".

Captcha: Ingenium...perhaps your use of the word was "ingenium".

And you're not forgiven for your incorrect use of the word "you."

And you're not forgiven for misspelling "Grammar".
</pedantic>


I have to assume the mistake was deliberate....

mispelling (mis prefixed to spelling)

The wiggly red line underneath tells you that it's spelt (spelled, apparently) wrong

Man, you're stupid. How hard is it to hit dictionary.com?


How easy is it to know that you *need* to hit dicotnary.com?
What's a dicotnary?


It's where the dicotomies are stored.


This is turning into quite the angry pyramid of trolling, bad spelling and soapboxing. Nothing could make it more angry.

Sarah Palin writes VB code on an embedded filesystem while on her mommy and daddy's modem, but has to have a happy holiday by printing her code out on placing it on a wooden table which fristly is where she wrote unicorns and rainbows by accident while trying to write a perl script using GOTOs for her inept boss named Bobby Tables that would cut Social Security Benifits from TSA screeners on welfare.

Silly slave, can't even quote correctly, he doesn't realize that this is a grown up place.

Re: Status

2010-12-23 12:05 • by Mayhem (unregistered)
332872 in reply to 332860
neminem:
itsmo:
Feck - not again! Let's just cut this dead right now and replace "your" and "you're" with "yor" just for WTF comments...

Can we replace them with "yarr" instead?


Only on September 19.
« PrevPage 1 | Page 2 | Page 3Next »

Add Comment