It does work though ;). I’ve seen some people use it.
Did you know that
int []primes, matrix[], threeDimMatrix[][];
equals
int primes[], matrix[][], threeDimMatrix[][][];
?
If you are working in Java the one on the right is correct. If you are working in most C-variants the one on the left is correct. I loathe the one on the left, but you follow the languages standards even if they aren’t what you feel is best.
I can’t tell if I am turned on or sickened by your (DarkArcana) image.
lol nope.
The left one makes me wanna die.
if (x == y)
x=3;
If possible.
why on a new line? Why not just:
if (x == y) x = 3;
The idea of disregarding standards is detrimental to the creation of good code and by extension can damage open source projects. You are free to behave like an uncultured savage in your personal code, but failure to follow even the most simplistic of standards is a good way to get your code rejected from any serious project.
Here’s some snippets of my professor’s code used in lecture:
int min = A[0];
int place = 0;
for(int k = 1; k <=10; ++k)
{
if(A[k] < min)
{
min = A[k];
place = k;
}
}
}
For obvious reasons, I prefer the
for (String str : stringArray) {
this.doThings();
}
type of bracket structure.
I never said people didn’t like my style ;).
Well, that’s why we have checkstyle and similar utilities, right? xD
I’m fine with any code style so long it doesn’t uninstall Windows (long story).
@DarkArcana long story short, my computer runs Ubuntu Linux.
That doesn’t explain anything, but alright.
I tell tomorrow. It’s late.
Something tells me a rm -rf came into play…
No, but that is the best thing to do on macs.
If you don’t like readability I guess that would be the wrong way then.