Author Topic: Programming Megathread  (Read 143263 times)

Hey, quick note, could you append a '\n' or endl to the end of you cout input? Just that way it'll add a newline and the prompt won't run directly off your result.
That wasn't the actual program. It was just a test to see what the number was coming out to be, so I didn't really care how it looked.

why wont the console output anything when i try to execute this?


"A[ x ]        |      Anew[ x ]" is a literal string. It will straight up print that.

What you want is: "A[" << x << "]     |    Anew[" << x << "]";

"A[ x ]        |      Anew[ x ]" is a literal string. It will straight up print that.

What you want is: "A[" << x << "]     |    Anew[" << x << "]";
oh right. i dont advise being under the influence programming at the same time

still nothing in the console. just blank


The console starts to work again when I remove these 3 lines:

Well for one your loop condition is forgeted and you probably want x<=13


also when I rewrote that stuff I begrudgingly used the same brace style you did, but nevertheless I want to expose you to this way too. just in case you like it better

for (int i = 0; i < 10; i++) {
    // stuff
}


Visual Studio formats code to the Allman style (the [<statement> n/ { n/ body n/ }] format)  by default - while most people despise it, VS autocorrects to it so everything looks like bleugh.

braces are special and deserve their own line >:(

no but seriously it just spaces things out nicer for me and i like being able to clearly see where the block begins and ends by looking 1 indent level behind

In addition, I'm pretty sure you can change the way it handles indentation.

Edit: Yep, just checked.


« Last Edit: May 10, 2016, 12:05:18 AM by Ipquarx »

Well for one your loop condition is forgeted

Idk why that was so funny to me lmao

Visual Studio formats code to the Allman style (the [<statement> n/ { n/ body n/ }] format)  by default - while most people despise it, VS autocorrects to it so everything looks like bleugh.
In addition, I'm pretty sure you can change the way it handles indentation.
For some really strange reason, it defaults new line for opening braces to off for Javascript, but on for every other language I use


Yeah, no
Backing this up. Am programmer, like having my braces on individual lines.

Also supporting braces on individual lines. It sets a good, consistent standard for indentation.