He reddit spaces his code

>he reddit spaces his code

Attached: screenshot2018-03-20-14:28:41.png (1844x991, 131K)

Other urls found in this thread:

en.wikipedia.org/wiki/Careware
kernel.org/doc/html/v4.10/process/coding-style.html
resourcesforlife.com/docs/item18006
twitter.com/AnonBabble

>he uses ugandese extortionware

Give me a reason not to.

doing it like

WORDS
{
}

and not like

WORDS{
}


srsly hope u guys dont do this.

>
main()
{

}

fucking degenerate.

WORDS {
}

Best spacing coming through
private static void main(String[] args) {
for (int i=0;i

had a problem in my code, so i ask lecturer.

she reddit spaces the fuck out of it all so it looks like , and not

WORDS{ }
;

i

like

to

write

like

this

just

to

fuck

with

stupid

phone

niggers

Worse spacing coming through
private static void main(String[] args)
{
for (int i=0;i

how do you get the text to look like that?
is it like old bb tags?

nevermind, im a fucking idiot

This style was how I learned to program when I started at like 16, was reiterated in uni, and (mostly) followed in every software dev job I had.

I though putting braces on its own line was a meme. Do people actually do that?

>He's never written anything big enough that it needs Reddit spacing to be readable when you have to relearn shit you wrote a year earlier

>/bin/bash
/bin/bash not found
What you gonna do now, faggot? LEARN POSIX, NIGGER, IT'S EITHER /bin/sh or /usr/bin/env bash if you really really need bashisms!!!!!!!

>Reddit spaces
And when did you get diagnosed with severe brain damage?

Nah, all of the javascript I write fits on one line.
Nobody needs to read that shit anyway.

Its usually best to follow whatever conventions are established to be the "normal" ones at your job. I just so happen to really like pic related's spacing so I still use it, easier to read and all.

>braces on braces
This is very triggering.

>being a real brainlet

this, except for the 3-space tabs

Actual best spacing coming through
main()
{
if(something){
ouga bouga bouga
}
}

Wrong in every way

this
>"Heretic people all over the world have claimed that this inconsistency is ... well ... inconsistent, but all right-thinking people know that (a) K&R are right and (b) K&R are right."

en.wikipedia.org/wiki/Careware

Attached: CopyQ.Zb2166.png (940x646, 829K)

>Sup Forums is literally intimidated by reddit to such a level that it developed slang for white space in a post
christ

>intimidated by reddit.

Attached: 1512585483598.gif (500x375, 980K)

if statements only accept one line of code (or statement, perhaps?) below them, anything more fall outside the if.
This statement can of course be a code block {}, it does not have to be something like an assignment

Even putting aside arguments about readability, by placing the opening of the code block on the far right side of the if statement, it becomes so disconnected from the closing code block that you are adding a false idea that the curly brace actually belongs to the function/if statement/while statement while it simply collects all the statements it contains together and associates them with the if-statement

That's how I learned Java and it just sort of stuck

>His only contribution to the board is making posts about "reddit spacing".

Attached: 1517185435772.jpg (737x735, 49K)

>not
private static void main(String[] args)
{ for (int i=0;i

>using K&R
>not using Allman
If you can't understand the control flow at a glance your code is unreadable garbage

infatuation is the more appropriate term

Acceptable C style:
int foo(void) {

int i;

for (i = 0; i < 10; ++i)
bar(i);

while ((i = getchar())) {

foo2(i);
bar(i);
}

return 0;
}

Who is this fucking sperm wyrm

that while brace style is retarded

How so? The extra empty line? I prefer it not being so cluttered.

void foo(bool b)
{
if(b)
DoThing();
else
{
DoThing1();
DoThing2();
}
for(int i = 0; i < 10; i++)
DoThing3(i);
for(int i = 0; i < 5; i++)
{
DoThing4(i);
DoThing5();
}
}
I should really get into lambda expressions, they can really trim if statements down and allow query-ish list iteration.

might as well put the brace there instead of leaving an empty line

OK.
If by infatuation you mean fuck, as in "fuck reddit, and fuck all the fucks from reddit"
In the ass. Hard. No lube.

It just feels too cluttered

>itt: neet fizzbuzzers who have never written code professionally
Nobody gives a fuck about this petty shit in industry. Whoever starts the project chooses a style standard, and other devs refrain from deviating too egregiously from it. That's all.

By infatuation I mean the sexual desire you feel for them.

Sarina Valentina

glad we agree on that

>He doesn't do master race spacing

Attached: java programming.png (597x255, 66K)

is bash even "code"?
when does a script become code or program

Isn't /usr/bin/env less likely to exist than /bin/bash?

Code is almost any human-readable structured data (unless otherwise specified, like "machine code"). HTML qualifies as code despite not being a program.
Program is anything that's interpreted by something that's more or less turing complete.

>roll ugandan uber drivers 10x in a row because of overpopulation and lax immigration
>drops me off at meeting/interview
>everyone there is using fucking vim

Attached: latest[1].jpg (659x659, 99K)

I space my code according to my employer's style guide. I never got this shit, same with the stupid tabs vs. spaces argument.

>he doesn't know awk
it /is/ in that (second) format you idiot. Those 'reddit-spaced' brackets are for catch-all blocks that get executed on every line of input, hence there are no keywords or conditions before them.

Attached: file.jpg (645x729, 26K)

Why cant the file have more than 1 dot? Nice Indian code

why i don't visit reddit

that's actually a solution
pythonize it.

It's basically doing string.split on $IN and then appending the first and second record. Everything afterwards would be discarded.

The best itt

Yep that's you

This.

This

I learned 'brace on newline' (allman style) (aka ) in highschool, then in university and then used it at my old job for a few years. At my current job I lead some large projects and have static analysis instant reject commits if they don't follow my style.
Feels good to avoid garbage style for so many years and now be in a position where I can enforce readable code.

Absolutely disgusting

}
else
{

do
{
}
while();

why some people claim this is any more aesthetic or readable than inlined?

Fucking off yourself thanks

convert "$1" -crop 2x1@ halves.png

Attached: s.png (624x513, 499K)

>not markdown breaks with double space
this is how you spot intellectuals over reddit shitheads

MakeyourcodehardtoreadsowhenDisneyReplacesyouwithPajeettheyarefuckd.

>be me freesh out of college with cs deggree
>get job writing in C and some other database language.
>write code, comment, use hungarian variables for readablity, constants when appropriate. >Comment each function, and lead programmer also put comments.
>code big success!
>company sells a bunch
>laid off lead programmer and myself
>bitter, but better for the experience, and didn't burn bridges, got letter of recommendation and resume reference.
>new job, more money (not by much), more C code, also a brand new chair- nice airoein chair
>one day come home after wings and drinks with new coworkers
>blinking answering machine:
>user, could you give us call as soon as possible.
*laughs internally
>next day call the old job while eating lunch
>turns out hire two programmers, one was a pajeet on a work visa, and the other was the nephew of the boss' s girlfriend who "was good with computers".
>they messed up the code, deleted a bunch of files, and client data was irrevocably damaged. >Also, the clients wanted GPS information embedded.
>they offered me the lead position with double salary if I would return.
>sorry, oldBossAnon, it would be unprofessional to leave new job.
>finished my sandwtich, and returned to my new aireon chair.

So I guess it doesn't matter if your code is readable, and can be maintained, but I try to follow the advice from that book: "code complete". Every programmer should read it.

Attached: code complete.jpg (200x252, 7K)

you're doing god's work, user.

Attached: 7fpJP9o.gif (141x141, 483K)

*this

>Get used to newline on open bracket
>Do some Java programming
>Open bracket on declaration makes sense and I can see why people say it's more readable
>But now I'm using both styles in my code without even noticing half the time
Fuck me

Attached: 1500447220251.png (954x720, 2.62M)

whats the point of that if statement? this method will print nothing since int i will never be bigger than 10

t. can't stop making off-by-one errors

what

The first is C and C++ style. The second is Java style.

It doesn't matter what you use as long as you're consistent and it follows the style of the project you're working on.

The loop is

Gross

Just make the loop go from 0 to 9

No. POSIX says /usr/bin/env has to exist, just like /bin/sh.
/bin/bash doesn't work on many *nix that try something new wrt. filesystem, like guixsd or nixos.
Code is anything that you write and your computer understands, so shell scripts are code.

That's the proper way:
int function(int niggervalue)
{
while(1) {
printf("niggerlicious\n");
}

return 1;
}


PS: tabs, 8 characters wide, not spaces

He just wanted to show how he'd write an if statement inside a loop.
Don't look too much into it.

why did you newline the function brace but not the while brace?

Because that is proper K&R and Linux style.

kernel.org/doc/html/v4.10/process/coding-style.html

No, POSIX says env has to exist in the default PATH. POSIX only names the location of three files (/dev/console, /dev/null, and /dev/tty) (OK, erlier versions specified where cron.allow and similar went, but not the current version). The location of everything else is up to the implementation. Also POSIX says the results are unspecified when an executable file that isn't in the implementation's native executable format begin with #!.

Attached: file.png (342x342, 119K)

Fuck that how i space my shit

P.S. isnt that printin instead or println?

I don't get why idiots argue over this, it doesn't make a fucking difference if you do this or not.

Disgusting

Attached: 1521423371414.png (858x725, 361K)

If anyone wonders about the reason behind this "inconsistency", it's because ancient (pre-standard) C defined types of function arguments after the function name and braces with the names of arguments:
func(c, i, p)
char c;
int *p
{
/* function body */
}

Also note the implicit integer in return type and argument i (but not in the integer pointer *p).

Your script is shit dude. Files can have an unlimited number of dots in the file name and using awk to remove the file extension instead of basename is ridiculous. Also using ffmpeg to scale images is just stupid when imagemagick exists.

>basename
bash alone can do it ${filename%.*}

Absolutely disgusting.

resourcesforlife.com/docs/item18006

Haters incoming.

I used to dislike, but now I am a fan of Windows-style coding. On dual 2k monitors at work, it's a breeze to go through people's code, as it's very roomy instead of being compact.

But you can't just litter code with comments, you have to be place convervatively.

DWORD DecryptSomeByte
(
DWORD var1,
BYTE* var2,
SomeStruct* var3
)
{
DWORD ret = 0;

if (var1 && var2 && var3)
{

//
// Only decrpyt byte if var1 has bit 1 set
//

if (var1 == 0x1)
{

//
// XOR our someField with our secret byte
//

if (var3->someField ^= 0xCC)
{
ret = var3->someField;
}
}
}

return ret;
}

>he doesn't use programming languages made to be as dense as possible
life←{↑1 ⍵∨.∧3 4=+/,¯1 0 1∘.⊖¯1 0 1∘.⌽⊂⍵}

well you are basicly wasting a line, so you can see less code at once, hence you need to scroll more often. use it only when it really helps and not after any line.

Attached: bestprogrammer2018.png (389x911, 39K)

>window maker
Nice!

Attached: 1df9eac7f995b2cb82b3826ff9b8331968f6a016f66d831ef18649aa7a9f4e64.png (1366x768, 296K)

>8 characters wide
lol