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
-
what is that dev thinking of? 1. its a 5 line code
2. if it is not a reusable code why making it functions?
3. was he drunk? -
@AlexDeLarge could be, but its a five line code I wonder what kind of code that can be reused unless it is something like:
if(value == null){
return y;
} -
Sounds to me like this was prob something like a setData function that then sets 3 variables in class. Which could have their own setters... Just a stab in the dark for 5 lines of code.
-
It's not about the amount of lines, but the amount of "transformations" happening in those lines.
-
Since it's 5 lines I'm assuming it's hello world in c
include<stdio.h>
void print_hello() {
printf("hello");
}
void print_space() {
printf(" ");
}
void print_world() {
printf("world");
}
int main(int argc, char* argv[]) {
print_hello();
print_space();
print_world();
return 0;
}
Splitting 5 lines of code to 3 functions
rant
clean code my ass