Comments on: 20 controversial programming opinions http://programmers.blogoverflow.com/2012/08/20-controversial-programming-opinions/ Software Engineering Stack Exchange Community Blog Wed, 14 Sep 2016 10:52:50 +0000 hourly 1 https://wordpress.org/?v=4.5.6 By: ajswssa http://programmers.blogoverflow.com/2012/08/20-controversial-programming-opinions/#comment-1008407 Tue, 06 Sep 2016 08:56:21 +0000 http://programmers.blogoverflow.com/?p=411#comment-1008407 These are uncontroversial opinions. I imagine pretty much everyone in our office would agree with most or all of them.

]]> By: Nate http://programmers.blogoverflow.com/2012/08/20-controversial-programming-opinions/#comment-706318 Wed, 07 May 2014 07:38:50 +0000 http://programmers.blogoverflow.com/?p=411#comment-706318 The pi question is solved quite easily in J:

 pi=.verb def '4*-/%>:+:i.>:y'

  pi 5

3.14159

If you tried this in a job interview, though, your interviewer would probably think you’re just BSing.

]]>
By: Greenstone Walker http://programmers.blogoverflow.com/2012/08/20-controversial-programming-opinions/#comment-687604 Wed, 30 Apr 2014 05:53:09 +0000 http://programmers.blogoverflow.com/?p=411#comment-687604 “Most comments in code are in fact a pernicious form of code duplication.”

Disagree — this is not a controversial opinion, just a symptom of bad comments.

Good comments explain who wrote this code, why they wrote it (what is the business reason for a programmer spending time writing), their chosen approach (and why this approach was chosen) and their rejected approaches (and why these approaches were rejected). None of these are “code duplication”.

]]>
By: Diego http://programmers.blogoverflow.com/2012/08/20-controversial-programming-opinions/#comment-41215 Tue, 07 May 2013 13:24:10 +0000 http://programmers.blogoverflow.com/?p=411#comment-41215 I could add that “Developer and Designer” is an oxymoron. Unless one is a real genious, he/she cannot be an excellent Developer and an excellent Designer. The two require almost opposite mindsets, and a skill set so large that it would take too long to master both. He/she could be good at one and below average at one of the two (or both), but declaring oneself expert in both is just ridiculous.

]]> By: Turkey http://programmers.blogoverflow.com/2012/08/20-controversial-programming-opinions/#comment-858 Wed, 12 Sep 2012 14:11:09 +0000 http://programmers.blogoverflow.com/?p=411#comment-858 C for the win

double mypi(double precision){
    int n = 1;
    double lrh, rh = 0;
    do{
        lrh = rh;
        rh += ((-2 * (n++ & 2) >> 1) + 1) * 1/(float)n++;
    }while (fabs(rh - lrh) > precision);
    return 4 * rh;
}

]]>
By: ww http://programmers.blogoverflow.com/2012/08/20-controversial-programming-opinions/#comment-836 Tue, 11 Sep 2012 15:47:05 +0000 http://programmers.blogoverflow.com/?p=411#comment-836 I’m basically insecure so I also wanted to provide a solution:

import operator
def mypi(places=0.000001):
    lrh, rh = 1.0, 0.0
    n = 1
    funs = [operator.add, operator.sub]
    while abs(rh - lrh) > places:
        lrh = rh
        rh = funs[n & 2 == 2](rh, 1/float(n))
        n+=2
return 4 * rh

]]>
By: Dale King http://programmers.blogoverflow.com/2012/08/20-controversial-programming-opinions/#comment-795 Mon, 10 Sep 2012 14:41:19 +0000 http://programmers.blogoverflow.com/?p=411#comment-795 One thing that all of these solutions overlook is that you are using a computer with limits on its precision. To get the most accuracy when doing the approximation you need to do the computation the other way around and start with the smallest values (the largest denominator) and work back towards the 1. In Mathematics (i.e. with infinite precision) it makes no difference, but it does make a difference when using real computers that have limited precision.

The hard part about doing it that way is knowing if that last term is a + or -. Easy way around that is just choose one of the two and take absolute value at the end to reverse it if you got it wrong.

]]>
By: Dhanasekar http://programmers.blogoverflow.com/2012/08/20-controversial-programming-opinions/#comment-794 Mon, 10 Sep 2012 12:15:07 +0000 http://programmers.blogoverflow.com/?p=411#comment-794 Almost all the opinions are acceptable but opinion about design patterns is not pretty good because applying patterns to the place where it is unnecessary then it is called over designing or a bad design.. THere is nothing that design pattern can do.

But 5/5 to all other opinions 🙂

]]>
By: Anonymous http://programmers.blogoverflow.com/2012/08/20-controversial-programming-opinions/#comment-780 Mon, 10 Sep 2012 04:39:37 +0000 http://programmers.blogoverflow.com/?p=411#comment-780 From the point of view of people not having a reasonable consensus on an opinion, the most controversial programming opinions are near the middle (to either side). From the point of view of most people disagreeing, the most controversial are from the bottom up. My two cents: http://programming-motherfucker.com !

]]> By: nomen http://programmers.blogoverflow.com/2012/08/20-controversial-programming-opinions/#comment-722 Thu, 06 Sep 2012 06:27:01 +0000 http://programmers.blogoverflow.com/?p=411#comment-722 I often see programmers doing complicated functions that will work for only one case. What is needed on that case. Manually tested. The result it’s ok. And that’s fine if we don’t want to reuse that function, or each time we have the same parameters for that function. But later we need a second case, and a third case. And we have hundred of functions, with many cases. Buggy, unstable software are born in this way.

]]>