News for hackers. Stuff that matters.
Re:C-style vs. Python-style syntax: which one would you pref... by FalconNL on Sunday December 14, 2008 @01:40PM (#397520)
Completely agree. The main reason for my preference is that one of the things I hate most in C-style languages is that one-line functions take up three or four lines (depending on whether or not you use K&R style). This greatly increases the amount of scrolling you have to do.
Re:C-style vs. Python-style syntax: which one would you pref... by mdakin on Sunday December 14, 2008 @04:18PM (#397665)
Put it all on one line then! :) I just grepped some of my C/C++ code and my one-liners consistently look like this:

virtual const std::string& getCommand() const throw() { return m_command ; }

Re:C-style vs. Python-style syntax: which one would you pref... by FalconNL on Sunday December 14, 2008 @05:01PM (#397693)
Yeah, that works for really short methods, but for anything even a little more complex you're just replacing vertical scrolling with horizontal scrolling.
Re:C-style vs. Python-style syntax: which one would you pref... by mdakin on Sunday December 14, 2008 @06:56PM (#397780)
That's true for one-liners in any language.
Re:C-style vs. Python-style syntax: which one would you pref... by FalconNL on Monday December 15, 2008 @02:18AM (#398136)
Not necessarily. In Haskell the oneliners are frequently short enough to fit on one screen.

For example, I recently needed to do some Run-Length Encoding:

    import Control.Arrow
    import Data.List
    
    encodeRLE :: (Eq a) => [a] -> [(Int, a)]
    encodeRLE = map (length &&& head) . group
    
    decodeRLE :: [(Int, a)] -> [a]
    decodeRLE = concatMap (uncurry replicate)