News for hackers. Stuff that matters.
Re:Swift: The joy of sequences by wlesieutre on Wednesday June 08, 2016 @05:24PM (#11865787)
Similarly, there are people who will insist that the most "pythonic" solution to any problem is list comprehensions nested 3 levels deep.

It's OK to wonder "Can I do this one one line?" as long as you can step back and say "Yes but I'm not going to" sometimes.

Re:Swift: The joy of sequences by m_mueller on Wednesday June 08, 2016 @07:03PM (#11866387)
That was one thing I really liked about the Google Python guideline posted here a few days ago: Their rule about list comprehensions. "three lines max, one for the element, one for the list generation and one for the filter clause - no nesting". That's the sweet spot.
Re:Swift: The joy of sequences by icebraining on Thursday June 09, 2016 @03:59AM (#11868143)
And they're just wrong; that goes directly against the Zen of Python:

  Simple is better than complex.
  Flat is better than nested.
  Sparse is better than dense.
  Readability counts.
I too have a tendency to overuse list comprehensions over regular loops, but when they start nesting I know it's almost always time to break it up.