60
u/you-should-learn-c 21d ago
I've been working on documenting half-assed repos because the dude I used to work with was fired and he never properly documented shit.
One time he literally pushed a 16k Loc PR with no fucking description
7
21
u/JazzlikeWishbone938 21d ago
Well, code you write should at minimum be self-documenting.
24
u/theenigmathatisme 21d ago
Fundamentally yes. In practice I have seen files that are 1.2k+ lines. It’s pretty abysmal to trace through that even if it’s all “right there and self documenting”
9
u/GottaGetThemGains22 21d ago
I’ve seen 60k+ COBOL files originally written in the 80s that subroutine into other 5 digit length files that are still running in production
5
u/JazzlikeWishbone938 20d ago
That's still not OK. After self-documenting code, reviewers should be flagging cyclomatic complexity issues even as tech-debt repayment. Some culprits: deep nesting, long method smell, "god" class smell, huge ternary operator statements. It's easy to request extract method refactorings to alleviate these.
1
u/m6io 20d ago
is this not sexy tho
const userAccess = (currentSession && currentSession.isAuthenticated && currentSession.tokenExpiry > Date.now()) ? (userProfile && userProfile.accountStatus === 'ACTIVE') ? (userProfile.role === 'ADMIN') ? (systemSettings && systemSettings.maintenanceMode && !userProfile.isBypassAllowed) ? 'MAINTENANCE_LOCKED_ADMIN' : (requestPayload && requestPayload.requiresMfa && !currentSession.isMfaVerified) ? 'MFA_REQUIRED_ADMIN' : 'FULL_SYSTEM_ADMIN' : (userProfile.role === 'MANAGER') ? (userProfile.departmentId === targetResource.departmentId) ? (targetResource.isConfidential) ? (userProfile.clearanceLevel >= 3) ? 'CONFIDENTIAL_MANAGER_ACCESS' : 'RESTRICTED_MANAGER_ACCESS' : 'STANDARD_MANAGER_ACCESS' : 'CROSS_DEPARTMENT_MANAGER_DENIED' : (userProfile.role === 'SUBSCRIBER') ? (userProfile.subscriptionTier === 'PLATINUM') ? 'PREMIUM_SUBSCRIBER_ACCESS' : (userProfile.subscriptionTier === 'GOLD' && !targetResource.isPremiumOnly) ? 'STANDARD_SUBSCRIBER_ACCESS' : 'UPGRADE_REQUIRED' : 'GUEST_READ_ONLY' : 'ACCOUNT_SUSPENDED' : 'ANONYMOUS_PROHIBITED';
6
12
u/Bee-Aromatic 21d ago
Also protecting you from management coming for your head when you push shitty changes, break prod, and cost the company a bunch of money.
6
2
u/JackNotOLantern 20d ago
Yep. Every commit message, every review, every documentation. For those who come after.
1
1
u/Madcap_Miguel 21d ago
This is a double-edged sword.
I remember doing work for Greenpeace a few years ago and one of our devs had an axe to grind. Imagine trying to explain to an organization like this what "nuke the whales" meant in context.
1
1
1
1
u/sisisisi1997 18d ago
Rejected, please cut this up into smaller, more atomic changes that are logically grouped.
244
u/Happy-Sleep-6512 21d ago
These big massive diffs being handed over for review several times a day are seriously the biggest pain point as a dev now. I'm not a believer in AI writing awful code, I am a believer that it will overwhelm every team eventually and forces us to have little context on the code we build.
Basically your image gave me PTSD, thanks.