2 ms·
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() con
by mdakin 18y ago
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 ; }
- FalconNL 18y agoYeah, that works for really short methods, but for anything even a little more complex you're just replacing vertical scrolling with horizontal scrolling.
- mdakin 18y agoThat's true for one-liners in any language.
- FalconNL 18y agoNot 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)