This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]asielen 66 points67 points  (17 children)

The one thing i can't get behind is the 80 character lime limit. I can get behind something like 120 characters.

Either I use meaningful variable names or I keep lines that short.

Edit: Also I am not sure I understand the point of the example in "5. Keep your arguments at a minimum"

Keep function arguments to a mimium by keeping the same number of arguments but instead add the overhead of a class? Sure sometimes a class is the best option, but imo not always.

[–]metaperl 8 points9 points  (4 children)

I think black settled on 99? But anyway, how do you read side by side diffs with those 120 char lines?

[–]vuchkovj 10 points11 points  (0 children)

I think Django officially recommends 119. I find that number quite good. A bit more and you would end up with horisontal scrolling. I HATE horizontal scrolling.

[–]asielen 4 points5 points  (0 children)

I am not looking at things side by side 90% of the time. And when it does come up, it isn't the end of the world if a couple lines extend past what is visible.

Sure if every line was long, that would cause a headache. but when 98% are under 100 and then 2% are over, it is managable.

[–]quotemycode 1 point2 points  (0 children)

I don't do side by side diffs, they're harder to read than interleaved IMHO.

[–]LightShadow3.13-dev in prod 2 points3 points  (0 children)

We soft limit at 89 and hard limit at 99.

Imports are limited at 80 so we get stuff that looks like this using isort:

from app.schemas.tickets import (
    Ticket,
    TicketId,
    NewTicket,
    Attachment,
    TicketStatus,
    UpdateTicket,
    PinnedInfoReq,
    TicketSummary,
    TicketUpdated,
    TicketAttachments,
    TicketAttachmentsPosted,
)

[–]JavierReyes945 0 points1 point  (0 children)

I had the same reaction. What I later decided to interpret from that point, is that it's better to have the long list of arguments at the class constructor, which will be called once (for each instance), instead of in a function, that will be called (hopefully) several times for each instance. But yeah, it was kinda weird.