3 ms·
That is a straw man. No one actually thinks 80 character displays are the reason to use 80 characters. I think 80-100 is fine. More than 100 and you probably
by NateDad 13y ago
That is a straw man. No one actually thinks 80 character displays are the reason to use 80 characters.
I think 80-100 is fine. More than 100 and you probably need to refactor the line some, because you probably have too much logic on a single line (or you need to choose names that aren't hugely long).
- collyw 13y agoThe beauty of expressive languages like Python is that you can fit a lot of logic into one line with list comprehensions and the likes. When it isn't obvious what it is doing straight away, add a comment.
- NateDad 13y agoThis is almost always a bad idea. I've extracted many a python line into 2-4 lines to make it a hell of a lot more clear. Packing logic into a line is not a good thing. It may be fun and a challenge, but it makes for fragile code that is easy to get wrong and/or misunderstand.
- collyw 13y agoI often use list comprehensions where I would have previously used a for loop. It means you have less variables and are less likely to have side effects. I wouldn't say it is always a bad idea.
- Nursie 13y ago>> No one actually thinks 80 character displays are the reason to use 80 characters. Err, yeah they do, I have been given exactly that reason on a few occasions, generally by older engineers who had experience with old-school machines that had precisely those screen dimensions. I don't disagree with your main point, but it's really not a straw man.
- NateDad 13y agoWell, for most people it's a straw man. I've worked with some greybeards, and they are smart enough to know that they can resize the terminal on their modern laptop :)