Author Topic: Programming Megathread  (Read 107416 times)


was that intentionally messed up, as a joke, since we're talking about formatting? or what

yes

Made it more readable for you. But what the hell is it?

a question picker that picks questions in arrays based on a difficulty setting. 0-19 is easy, 20-29 is medium, etc

there's also a thing to make it not pick the same number twice in a row

why do you guys leave orphan lines with elses on them?

fn z() {
  if(someValueX == someValueY) {
    doSomething();
    doSomethingElse();
  } else {
    doSomethingEntirelyDifferent();
    return 1;
  }
}

why do you guys leave orphan lines with elses on them?
cleanliness is next to managerialness

why do you guys leave orphan lines with elses on them?

fn z() {
  if(someValueX == someValueY) {
    doSomething();
    doSomethingElse();
  } else {
    doSomethingEntirelyDifferent();
    return 1;
  }
}

I don't like that, either
it's another case of getting confused while skimming. the else being on the same line as the closing bracket makes me think it's just more code in the initial if

i find it easier to read, sorry

i find it easier to read, sorry
don't be sorry
if(x)
{
    X
}
else if(y)
{
    Y
}

for the win

So basically this thread is turning into the Programming Fashion thread

So basically this thread is turning into the Programming Fashion thread
if you want to talk about something else, start another conversation

don't be sorry
if(x)
{
    X
}
else if(y)
{
    Y
}

for the win
imo it doesn't make sense to give the braces a whole line

pet peeve: not putting a space after the "if" before the parenthesis
it's not a function -___________-

imo it doesn't make sense to give the braces a whole line
it's much easier for me to read if i see the different areas seperated, otherwise it seems like the code blends in with the if statement and that makes it harder for me to understand it at a glance

if you want to talk about something else, start another conversation
k
Anyone do Project Euler?
What's the highest numbered problem you've gotten to?

k
Anyone do Project Euler?
What's the highest numbered problem you've gotten to?
i do that occasionally
the highest numbered one i completed was 443, difficulty rating of 30%
(obviously not contiguously)

So basically this thread is turning into the Programming Fashion thread

Talking about how you use brackets and white space is always a good way to get people riled up. I had a professor start this debate to get the class going once and everyone got pretty into it.