Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
So wait... You code effectively says... If x == true then make x true if not make it false
😂😂😂😂😂😂
There's literally no point 😅😂 -
wolfram35058yWhat's the hype with comments in the code now a days.. Only few parts of the code(logical) that's hard to understand needs commenting.. Even in my internship I was mocked for not commenting on a module which just does some basic calculations :/ You don't write a tutorial, you just write code which you ( or another programmer ) needs to understand. I have seen people write neat code that doesn't even need commenting!
-
flag020318y@FitzSuperUser its replacing values other than 1 to 0. Prepping for a check? But you could get away with b==1 there to.
-
@flag0 that makes sense confused the shit out of me cause I'd never do that in my life 😂
-
@wolfram The comment part was on other pieces of code, not this part specifically. It was a program done in roughly 15 minutes of free time (and little experience) featuring variables called e, q, h, f, b, and so on (that at first glance make you think "wtf is written there?").
And I do believe that everyone wrote code like that at least once at the beginning. -
yarwest26658y@wolfram when someone writes a slightly intricate function, I'd like to know what it does without having to decrypt whatever they wrote down. Comment your code, it's good practice.
-
local127748y@yarwest It's not.
The name should tell you everything you need to know. If that's not possible, it probably should be split up into smaller parts.
I was checking an Arduino sketch I wrote in a hurry 2 years ago. I want to cry for the number of shit I've found there 😓
Picture + I had put as int variables that should have been boolean. I needed them for 0 and 1. As well as with no comments and no explicative names.
undefined
shittycode