Subscribe: The Daily WTF
http://thedailywtf.com/Rss.aspx
Preview: The Daily WTF

The Daily WTF



Curious Perversions in Information Technology



Last Build Date: Sat, 01 Oct 2016 03:43:54 GMT

 



Error'd: Workweek Hustle Shuffle

Fri, 30 Sep 2016 10:00:00 GMT

While my co-worker JR may have gotten the most steps, I still came out on top!

(image)

 

"Not sure if I'm interested in their audience targeting rule or not," writes Tony P.

(image)

 

Paul N. wrote, "It's nice to see that it's definitely not spam, because I'm... NOT_SIGNED_UP?!"

(image)

 

"Gotta love Siri's personality -- she is kidding, right?" writes Sean.

(image)

 

Autin wrote, "I guess it does take a lot of memory to do laundry."

(image)

 

"Anyone fancy some used envelopes? Only need to cover up the old address and steam off the stamp, and they're just like new!" Dave L. writes.

(image)

 

Phil writes, "Wow! I'm really looking forward to getting 3.99TB of disk space back on my 60GB drive."

(image)

 

(image) [Advertisement] Infrastructure as Code built from the start with first-class Windows functionality and an intuitive, visual user interface. Download Otter today!
(image)



Editor's Soapbox: Programming is Hard

Thu, 29 Sep 2016 10:30:00 GMT

A bit ago, I popped into an “Explain Like I’m 5” thread to give my version of the differences between C, C++, Objective-C and C#. In true Reddit fashion, I had the requisite “no five year old could understand this” comments and similar noise. One thing that leapt out to me was that a few commenters objected to this statement: “Programming is hard.” The most thorough objection read like this: Programming is not hard(such a discouraging label). If you learned a written language, you can learn a computer language. The only thing difficult about programming is mastering the art of learning itself, which is what separates the soon-to-be obsoletes from the ever-evolving masters of the trade. Good programming, at its heart, is all about keeping up with the technologies of the industry. The fundamentals themselves are easy peasy. – /u/possiblywithdynamite Now, I don’t want to pick on /u/possiblywithdynamite specifically, although I do want to point out that “keeping up with the technologies of the industry” is the exact opposite of good programming. I’d also like to add that a positive attitude towards “life-long learning” is neccessary to be successful in general, not just programming. I don’t want to get sidetracked by those points. Instead, I want to focus on a few other related things: Programming is hard Skill has value Programming should be hard That doesn’t mean we can’t make programming accessible to non-programmers Now, what do we mean by “hard”? There’s the obvious definition: you have to do a lot of work to succeed. Time and energy have to be invested. Or, it’s a task that requires great skill and talent. These are our common ideas of “hard”, and they’re more what I meant in my original comment, but I want to highlight an alternate definition of “hard”. A task is hard when there are more ways to screw it up than to do it correctly. If you’re blundering through the world of programming and software development, there are a lot more ways to be wrong than there are to be right. Most of what we do on this site is inventory all the ways in which people can mangle basic tasks. Think about how many CodeSODs work but are also terrible. When we talk about learning a skill—be it programming, a musical instrument, writing, improvised comedy, etc.—what we’re really talking about is building habits, patterns, and practices that help us do things correctly more often than we do them wrong. And how do we do that? Usually by screwing up a bunch of times. Improvisers call this “getting your reps”, musicians call it “going to the woodshed” (because your playing is so awful you need to be away from the house so as not to disturb your family). As the old saying goes, “An expert is someone who has failed more times than a novice has even tried.” The important thing is that you can read up on best practices and listen to experts, but if you want to get good at something hard, you’re going to need to screw up a bunch. We learn best from failures. Okay, so programming is hard, and we can deal with its inherent difficulty by building skill. But should programming be hard? After all, haven’t we spent the past few decades finding ways to make programming easier? Well, I don’t want to imply that we should make programming hard just for the sake of making it hard. I don’t want to give the impression that we should all throw out our garbage collectors and our application frameworks and start making hand-crafted artisanal Assembly. Keep in mind how I defined hard: lots of ways to screw up, but only a few ways to succeed. That means difficulty and degrees of freedom are related. The more options and flexibility you have, the harder everything has to be. Let’s shift gears. I didn’t learn to ride a bike until relatively late compared to my peers. As was stand[...]



CodeSOD: Every Possible Case

Wed, 28 Sep 2016 10:30:00 GMT

(image)

From reader Frank comes this delightful Java-flavored head-scratcher:

This is from the main request-handling method for a webservice. Counting all of its interesting features is left as an exercise for the reader, but the request data is never modified and the error handling in both catch blocks is the same .... The kicker is that doCalculation() has all its logic inside try {} catch (Exception ex) anyway.


Response response = new Response();
try {
    if (request.includeFooFlag()) {
        response = doCalculation(request);
    }
    if (! request.includeFooFlag()) {
        long fooCount = getCountOfFoo();
        if (fooCount == 0) {
            response = doCalculation(request);
        } else {
            try {
                response = doCalculation(request);
            } catch (Exception ex) {
                response = createErrorResponse("Error details");
                return response;
            }
        }
    }
    return response
} catch (Exception ex) {
    response = createErrorResponse("Error details");
    return response;
}
return response;

(image) [Advertisement] Otter, ProGet, BuildMaster – robust, powerful, scalable, and reliable additions to your existing DevOps toolchain.
(image)