News for hackers. Stuff that matters.
Re:On the evolution of programming style: How far C++ has mo... by dxbydt on Monday March 26, 2012 @12:52PM (#3757526)
if you are comfortable with returning tuples, perhaps the inputs should be a tuple as well...

     def findRoot(p:(Double,Double,Double)) = {
       assert(p._1 != 0)
       val n = sqrt(p._2*p._2-4*p._1*p._3)
       val d = 2*p._1
       ( (-p._2+n)/d, (-p._2-n)/d )
     }
      ----
      scala> findRoot((6,-6,-36))
      res0: (Double, Double) = (3.0,-2.0)
Re:On the evolution of programming style: How far C++ has mo... by ajross on Monday March 26, 2012 @01:48PM (#3757789)
Not sure how we got to Scala, but in (non-varargs) C linkage the whole metaphor of "funtion arguments" is inherently a "tuple" to begin with. They only exist in tandem with each other, never in isolation. There's no real value I can see to trying to double-abstract it.
Re:On the evolution of programming style: How far C++ has mo... by nooop on Monday March 26, 2012 @02:05PM (#3757862)
> if you are comfortable with returning tuples, perhaps the inputs should be a tuple as well...

why should they?