- 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
Today's article is brought to you by the department of local variable preservation.
Filed under: You never know when you will run out unless you really save on them.
Admin
Re: code snippet; ew, icky.
Though, to be fair, even the solution I have in mind is a little :wtf: in its own way
<!-- Emoji'd by MobileEmoji 0.2.0-->Admin
Admin
... I'm just going to have to stop there.
damn almost self nerddsniped by trying to make that formatting in a SQL select statement...
Admin
Admin
OMG BUSlNESS LOGIC IN TEH DATABASE
Admin
that was going to be the joke. yes.
Admin
Translate to your barbaric languages if you must.
Admin
You should have generated JQuery-Code in the database. I heard JQuery was the new big thing on the web and we need it by tomorrow. Also where is the XML? My email said XML once so make that happen.
Filed Under: PHB
Admin
hm... i can do that. but i'm going to need a fifth of rotgut, a conference room for the day, a lot of snacks and a little bit of your special relaxin' herbs.
Admin
You can take the useless intern from the department on the upper floor. He don't know a thing about programming but I thnik he is related to friend of the big boss so you KNOW he has to be useful!
Filed Under: I expect results in 30 minutes. I already told everybody this would be great
Addendum: I didn't even notice how the intern is now useless and useful in one statement... my PHB is strong today :D
Admin
Yes, C# does allow you to omit the parentheses when there's no constructor arguments and you're using a collection initialiser :stuck_out_tongue:
Oh, and +5 using LINQ to Objects when it's not at all obvious it's the right way to go :laughing:
Single-line version:
Not actually sure it'll compile like that… :smile:
<!-- Emoji'd by MobileEmoji 0.2.0-->Admin
why wouldn't it?
oooooh.
that compiles and works correctly (for .NET4.5)
Admin
Damn girl! And I thought my solution was :wtf:y enough… :laughing:
<!-- Emoji'd by MobileEmoji 0.2.0-->Admin
well asside from the fact that it didn't compile... yeah it was. i just made it compile and removed the redundant ToList (join will happily work on a raw IEnumerable)
Admin
LINQ is always the right way to go
Admin
Who said it's on the database? I develop all my local applications in pure SQL for extra simplicity. This way I don't have to learn two languages.
Admin
Admin
Why did that require even a moment's browsing of the rest of the codebase? It was pretty obvious that was going to happen from the snipped posted:
etc.
Why not? She only had one day left on her contract — not a lot to lose, even if it did piss someone off enough to fire her.
Admin
Admin
Sentence got mangled, sorry, the browsing was to verify that it does, in fact, cause validation errors. This wasn't a throwaway object, in other words.
Admin
... suggested to me that she didn't really care all that much about keeping bridges intact.
Admin
After a couple years working as an independent contractor, I've realized that one of the greatest things about not being a wage slave is my reaction to stupid decisions made by stupid bosses.
As a full-time employee: (Head in hands, moaning) Oh my god... we're fucked...
As a contractor: (Pointing, with a smirk) Oh my god - they're fucked!
Admin
What language is that? It looks a lot like C#, except that C# uses
||
, notor
...Admin
I was wondering the same thing but with the
string
type in lowercase. If it was pseudo, theprivate
doesn't make sense either.Admin
It's not Java either.
In fact, I can't think of a single C-family language that uses
<!-- Emoji'd by MobileEmoji 0.2.0-->or
as a keyword for… well… anything.Admin
As a full-time employee on a contractor: (running away) kill it with fire already!
Admin
string
in lowercase is just an alias for theSystem.String
type.Admin
http://php.net/manual/en/language.operators.logical.php
PHP :heart:
Admin
There's still a difference between not having to live with the fallout of bad decisions vs not ever needing another contract with that person or company again, though.
Admin
was that really a burn? cause it wasn't supposed to be a burn.
Admin
Admin
C++ https://en.wikipedia.org/wiki/Operators_in_C_and_C%2B%2B#C.2B.2B_operator_synonyms
Example:
Admin
I cannot believe we've gone through close to 40 posts without someone mentioning that building HTML by concatenating raw strings without escaping special characters means problems just waiting to happen.
So without further ado: Building HTML by concatenating raw strings without escaping special characters means problems just waiting to happen.
Admin
It's because we all know it, so it doesn't need to be said ;)
<!-- Emoji'd by MobileEmoji 0.2.0-->Admin
But if their devs are that bad, do you really want to work there again. Besides, if the boss's hair isn't pointy, he just might smile and say, "Yeah, I wish..."
Admin
I think this has been linked here before:
http://spw.thefrozenfire.com/
Admin
The problem here was not the code (which is horrid), but the task. The task seemed to be "We are getting all these blank lines in our addresses. Fix the addresses so it doesn't happen".
Which is exactly what they did. Which is all they could have done.
The fix (in an OO language) is to add a method to the Address class to output the formatted address, and then change every document to use that pretty-print method. But that was likely not an option given to the offshore developers. I wonder what the penalty is for passing "That is the dumbest idea I have ever heard of" back up the managerial chain, for a lowly offshore code macaque?
Admin
What could possibli go wrong?