- 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
NSDictionary comes from the Smalltalk-80 class library (Dictionary). The lineage was Smalltalk-80-> Stepstone / Brad Cox -> NeXT -> Apple.
Admin
In the real world, there are a number of issues that should be considered before copying/pasting code.
Depending upon the context, you might want to avoid claims of plagiarism in college, violation of copyright, intellectual property or licensing... These could cost your scholarship/student fees, your job and your future.
Additionally, anyone can post content to the internet. I could go onto a forum (where I see students ask questions every day) and post complete gibberish (which I also see every day). As a result of believing me, they'd fail. There ARE idiots who use their "master programming foo" on the internet to raise their self esteem. They might even be injecting vulnerabilities, whether purposely or not. By copying their code and committing it without reviewing it, you're allowing their idiocy to be projected onto you. I like to hope that people with sufficient experience who can see that keep tallies for the purpose of justifying their judgement.
CAPTCHA: Validus, n. One who produces valid code.
Admin
Admin
(Maybe I should have said that mathematical "maps" support a different set of operations instead of fewer.)
Admin
It would take a particularly shitheaded fuckwit not to be able to work out what a KeyNotFoundException is from its name.
Having said that, I've known some mathematics majors who really are unbelievably stupid, so yeah, maybe.
Admin
So what you are saying is that by doing twice the work in java, you can get half the results and half the reliability as what you get in C#.
All programmers are lazy. That is why we don't code directly to memory in binary anymore.
Admin
A dictionary is just a hashtable that accepts strongly-typed keys and values.
A regular hashtable in .NET is the same time, except it accepts "Objects" (any data type for the key and value).
A dictionary does the same thing, except it's faster because there's no boxing or unboxing involved.
For example (from memory):
That will accept strings as keys and the values are integers.
Admin
It's very easy to figure out in hindsight.
Admin
Since it wasn't mentioned in the article, I assume everyone involved was smart enough not to tell management about any of what was going on here, lest they try to decide which of the two was the problem employee.
Admin
Admin
TRWTF is that in the lately these articles end with shit like "was able to get things done 15 minutes before they went live".....
I read this as "it was never tested".
In fact, most places I've worked even the most planned change basically needs 3 days lead time and thousands of approvals to even make it from the last test environment into the real world.
Anyone who thinks it's safe to deploy something you finished 15 minutes ago (even if you're the most awesome coder on the face of the planety) is stark fucking raving mad!
Admin
Admin
caecus: that prickly feeling you get when trying to find out where the bug is.
Admin
Admin
Admin
Admin
Admin
TRWTF is that a task processing 500,000 database records needs to be run every 30 minutes. That's just begging for trouble.
Admin
There is another WTF here.
Designing an e commerce availability system around a batch process is a really REALLY bad idea. If you don't want to disappoint your customers on popular items that are in short supply, you have to use some kind of real time renting model or your availability cache
Admin
There is another WTF here.
Designing an e commerce availability system around a batch process is a really REALLY bad idea. If you don't want to disappoint your customers on popular items that are in short supply, you have to use some kind of real time renting model or your availability cache
Admin
Greg do good!
Admin
Obey!
Admin
This reminds me of the famous 'Hammer factory factory' mentioned in an article by Joel Spolsky (askismet wouldn't let me past the link, it thinks it's spam :( )
Admin
"resembel"
I see you are using the lazy man's English to post that comment!
Captcha: appellatio
Fellatio performed by an Apple fan boy.
Admin
Just wait until you see what they did with LINQ. I wonder if there's a word for that... "nomenclature genocide"? "terminology destruction"?
Admin
Always remember the Java programmer's mantra:
"Work hard not smart! What they can do in 1 line we'll do in at least two!!"
Admin
Somehow, this reminds me of a loop I saw in something once. The purpose was to allow authorization to be applied to a series of 200 items (heavily paraphrased):
The file content was, of course, something like xml (though this was before xml existed). There were a dozen or so records for every item authorization; so 2400 records or so. Opened and read through for each of the 200 devices. On a slow system.
Oddly, it performed poorly for some reason...
Admin
All things ideal, bump-count relates to the length of the shape-side over distance.
If the triangle is equilateral, and if its side is longer than the side of the square (at that other car), the triangle version will produce less bumps for the same distance (and that's provided that all 4 are synchronized to the perfection and that no road conditions make them out of sync).
If the triangle is equilateral, and if its side is shorter than the side of the square, the triangle version will produce more bumps for the same distance.
Basically, it doesn't matter what the shape is; what matters is the length of its sides. It gets more complex with shapes that have different sides. Theoretically, even the circle produces "bumps".
Layman analysis here; be gentle, please.
Admin
Last comment in reply to:
http://thedailywtf.com/Comments/From-Three-Days-to-15-Minutes.aspx#409613
Admin
No, dude = C# is for smart developers who realized that programming in JAVA is pointlessly difficult and old. The excuse of "we're covering more platforms" is bullshit. I can get the same job done in C# a lot faster than in any flavor of JAVA. There isn't a single JAVA IDE that doesnt' suck.
Admin
Admin
The Java VM has weekly exploits.
You may think C# is quick for development? Try deploying it. You'll soon realize that every Windows user has different versions of the .NET Framework and the C++ Redistributable packages in various states of disrepair.
My opinion is that most interpreted languages are bad, with PHP, JavaScript, and Python being the worst of the pack because of their duck-typed philosophy. .NET is OK for quick and dirty proof of concepts only, but I would never use it for a final product.
By the way, I use all of these languages except Java.
Admin
Sounds like you work more with desktop applications.
With web applications, the different versions of .NET are very minor. You pretty much run 1.1, 2.0, or 4.0. You have that version of the framework installed on the web server, and all is happy.
With Java, from what I've seen, a lot of apps are dependent on the exact version. You can run it with 6u21, but not 6u28. And don't even try running it with 7.
And you have to hope that Java doesn't decide to update itself.
Admin
In Python the type is actually called "dict" on account of "dictionary" being too long.
Also, technically dict is a concrete implementation, with Mapping and MutableMapping as abstract types.
Admin
I did not know this! So I do not belong to the rest of the world. And I would dare to say that a kindergarten kid does not know that either.
Admin
"No, dude = C++ is for smart developers who realized that programming in C is pointlessly difficult and old. The excuse of "It is not object oriented" is bullshit! I can get the same job done in C++ a lot faster than in any flavor of C."
Man, you must be new in the industry.
And when it comes to JAVA and its IDEs: try Netbeans. But on the other hand, JAVA might be too difficult.
Also there is a flaw in your argumentation from above. You write "The excuse of "we're covering more platforms" is bullshit." followed by " I can get the same job done in C# a lot faster than in any flavor of JAVA.". The second statement cannot be inferred from the first, which makes me think that you are not able to clearly express yourself or that you are lazy in what you write.
This leads to one conclusion: you do not care!
And that my friend is one of the most important things in the craftsmanship of code. Whether that be C#, LISP or Brainfuck.
PS:
And WTF does "No, dude = C#..." mean?
Admin
No TRWTF is that you were using [programming language] on [some platform] instead of [other programming language] on [another platform]. Because [other programming language] is awesome and a) [protects you from making bad apps] -or- b)[is too difficult for dumb people to use, and smart people only make great apps]. Didn't see that one coming, did ya?
Admin
The number of layers per-se is not a problem. I once wrote a system for real time audio processing where the source code went through nearly 20 layers on some pretty time critical elements.
The compiler optimized this into direct inline calls...
Now with .NET there is not jus the language compiler, but the JIT compiler. If you disable JIT-Inlining, you will not allow it to perform this type of work. Also if the JIT for a block of code occurs while a debugger is attached (yes, even a "Release" build with optimizations turned on), the inlining will be disabled.
Amazing how many people don't know this and then complain about performance.
That being said the implementation shown is a REAL WTF....but much of the knee jerk rationale is not.
Admin
Why would Iron man have crazy sex with them just because they are stupid?
Admin
Ah, abstraction layers and ludicrous over-engineering... I can kind of sympathize with the Abstractor here, but he's forgetting the golden rule that one should use the right tools for the right job; uber-abstraction was not needed here because the data that required processing was very well defined, hence the improved performance with standard dictionaries. That said, I've got to raise a couple points about the 'successful' implementation -- first, it takes 15 minutes to run. That is 900,000 milliseconds, or ~4500 human-brain refresh cycles, and a completely unacceptable delay for any kind of recurrent processing. Second, the use-case only required an update of 500,000 records in a (presumably) well-structures database... that should be easily doable in 15 seconds, not minutes, even with only a basic knowledge of the DB schema. Third, this process is supposed to run every 30 minutes, and it takes 15 minutes to complete-- that means that half the time records will be in an invalid state, on a live website. That would be a fail
Admin
Admin
Admin
You want to try SortedList<TKey,TValue> (Array.BinaryFind based, slow to fill, incredibly fast to find) and SortedDictionary<TKey,TValue> (Red-Black Tree based, fairly quick to fill, half as fast as SortedList to find) since both are even more performant than Dictionary<TKey,TValue> - as I recently found out when narrowing down a bottleneck to a call to a 1.3m element Dictionary.
I have to admit that in the first instance The Abstractor sounded a lot like me. I have developed most of a "Common" library for my current client - although I have been encouraging others to dip in, refactor & contribute. The "Common" library does, indeed, contain a lot of generic, business-logic-free, code. However, I'm always open to suggestions and do tend to benchmark my own code, as well as cracking open Microsoft code to see which of the Timers is better to use (it's Threading.Timer btw) or what Microsoft have done to make ConcurrentDictionary concurrent.