The guy that Im working with on a project is using pic related style

The guy that Im working with on a project is using pic related style.
I am using the normal one.
It will cause us to kill each other wont it ?

Other urls found in this thread:

man.openbsd.org/cgi-bin/man.cgi/OpenBSD-current/man9/style.9?query=style
codegolf.stackexchange.com/questions/109995/convert-braces-to-right-hand-brace-sad-brace
twitter.com/SFWRedditVideos

I use the pic related style. But I also have a space between foo and ()

yes

>I am using the normal one
You mean this one?

void
foo()
{
// ...
}

>the normal one

kys ... i like your collegue

>write your stuff with your own style
>run clang-format on it with project specific settings

That's it.

...

silence heretic that is far to simple and reasonable

If your tabs aren't properly aligned, it might cause a hash collision which could yield a false-positive on the machine learning cloud. I recommend you follow his lead to avoid these problems.

Ask him if hes calling foo()\n and if not tell him to do it fuckin properly

K&r style or die. Do you even know what k&r stands for? The gods mandated their style for a reason, because it's based as fuck.

I've yet to encounter ops pic style in the professional world and I hope I never do.

I was taught k&r style in high school in the 90s and in college.

void
foo
(
int
arg)
{
if
(
condition)
foo(
arg);}

putting braces on a separate line is useless almost all editors can find your mismatched braces.

void ayy(x, y)
try
{ lmao(x);
lmao(y); }
catch
{ ayy(y, x); }

K&R chugs dick. Allman style is for all men; cakeboys need not apply.

What the actual fuck?

>hello world is > 1000 lines

But K&R style has the opening brace on it's own line for function definitions you useless piece of shit.

>I'm using the normal one
So your using the same one as him? What's the problem?

everything except this:
int f(void){
// let the war begin
}

is retarded. sorry guys who use other style, you got memed. now its time to learn the proper style

You are like a little baby
#include\
"stdio.h"

int
main
(
int
argc
,
char
*
argv
[
]
)
{
printf
(
"Hello"
" "
"World"
"\n"
)
;
return
0
;
}

void foo() {

}

Any people who don't write code like above need to be brought out the back and summarily executed().

ah, the pythonic way

But what about this style:
void foo() }

{

void foo)( }

{

spoken like a true college/jobless/neet """programmer"""

opening bracket on its own line for c#
opening bracket on the same line as the function heading for java
it's not that bloody difficult

Why would you put a space there? I genuinely thought that was invalid in the interpreters for most procedural languages.

The braces aligned with the end of the parameter list?! You'd need 3 ultra wide 4K monitors to read an ordinary line of code. However I actually feel that you're onto something if the braces aligned with the end of the function name be it standard or user defined. I'd like to switch between this and vertically aligned tab style.

I've seen some things...

foo() is not an anonymous function.

...

man.openbsd.org/cgi-bin/man.cgi/OpenBSD-current/man9/style.9?query=style

who gives a fuck? go back masturbating to japanese cartoon before beginning a redundant discussion

If there is already a significant codebase (either in this project or in related ones), standardise to whichever one is used more often. If you're just getting started, toss a coin and agree to use C style if it's heads and Java style if it's tails.

this literally destroys me,
where is the readability?

It looks like the dude was coming from Python so he wrote a sed script to add all of that.

>not using your IDEs default settings

holy kek

void foo }{ (
)

Yes, it will. You should always use the same style when working on the same project.

His approach is also objectively wrong because what he's doing is declaring an unspecified argument list, not a void one. Example:

void foo()
{
...
}

int main(void)
{
int a = 4;

foo(a);

return 0;
}

This redefines foo() to:

void foo(int a);

Which makes reading the program MUCH harder as part of the function definition is buried in whatever random place the call is, and then you also have to figure out the type of the arguments. It is also NOT a variable argument list, just unspecified, so you can't do any of these:

void foo()
{
...
}

int main(void)
{
int a = 4;

foo(a);
foo();

return 0;
}

void foo()
{
...
}

int main(void)
{
int a = 4;
float b = 3.14;

foo(a);
foo(b);

return 0;
}

void foo()
{
...
}

int main(void)
{
int a = 4;
float b = 3.14;

foo(a);
foo(b);

return 0;
}

void foo()
{
...
}

int main(void)
{
int a = 4;
int b = 7;
float c = 3.14;

foo(a, b);
foo(c);
foo(a);

return 0;
}

All of the above examples will throw a compiler error on modern compilers, and on old compilers it'll be undefined behavior. Function prototypes were added for a reason, so tell him to fucking use them.

This. Doesn't matter how, but the earlier you agree on a coding standard, the better. It should include not only brace placement, but class names, variable names, when one should use statics etc. etc.
After doing that, don't whine about it. You're a professional for fuck's sake.

void foo }(){

>tfw Panjeet still doesn't understand basic variable naming conventions after working here for 2 years

Just format code on git push

You're retarded. Calling foo()\n would look like

foo()\n()
[\code]

Which doesn't make any fucking sense. Besidse by your logic you'd be calling foo(){ which doesn't work either.

oh I fucked of the slash

Protip: M-c
Also known as alt+c for lesser beings.

If you use 2 spaces then GNU style is pretty great in my opinion.

WHAT

Clever

...

Please, -never- teach anything to anyone.

codegolf.stackexchange.com/questions/109995/convert-braces-to-right-hand-brace-sad-brace
incrudibub

> whitespace causes a '''hash collision'''
>false positive on the machine learning cloud

No I will not accept this bait. 0/5.

>Function prototypes were added for a reason, so tell him to fucking use them.
or, you know, just add void to the parameters

>Use Visual Studio
>Common styling rules for the whole team enforced by ReSharper
>Press shortcut, receive automatic indentation and refactoring
>Life, life is good

Also that guy is right, because that style is right. It makes it much easier to actually see the block of code when parsing the code with your eyes.

Smart, though...
"parsing the code with your eyes"
Adorable.

The indentation isn't enough for you?

func foo() {
fmt.Println(":^)")
}

:3

From years of experience though, I stand by my statement. I've had to read massive JavaScript files sometimes, and the other curly brace style really messed up eyes it felt like things were all over the place and tracing the end brace to where it began was a pain without the IDE helping me.

Usually is, but the refactoring is nice too because it keeps everything consistent (variable names, removing unused using statements, etc...)

>Not using lisp style
void foo()
{for (i = 0; i < 10; i++)
{if (i % 2 == 0)
{doSomething(i);}
else
{doSomethingElse(i);
(doThirdThing(i));}}}

Do people ever write Lisp using C-style formatting?

(define (foo)
(
(define i 0)
(if (= i 0) (
display 'fuck)
(
display 'shit)
)
i)
)

this is why you learn a c type language first.

Now you're actually honing in on a point, having to dart your eyes from the end of function's parameter list to another unpredictable place sounds like it would cause a form of RSI.

Brace pile-up has ruined 1st year university students for a decade.

:D

Methods should always have newline bracketing.
Only Java retards don't agree.

Why the inconsistency?

I wrote unreadable oneliners on purpose for university assignments on courses that didn't require standards, this is nothing

You special snowflake you

void foo()
{ int x = atoi(gets());
const int y = 5;
x *= 2;
printf(x > y? "%d is more than %d\n" : "%d is less than %d", x, y); }

thanks =)

C:
void foo()
{
//
}

javascript and other high level stuff:
void foo() {
//
}

Surely you just use whatever the current style is, or if it is a new project, whichever style you agreed on before hand. Right?
You're not actually brain damaged are you, user?

void foo(){ /*...*/}
>not putting method code in one line
you guys liek to waste the whitespace dont you

PythonProgrammerTriesToAdjustToJava.jpg

...

DELET

void foo(){
//code
}

I agree OP, this is better. More effecient on space and more logical organization wise.

Anybody who actually believes that wasting whole lines for brackets makes sense should kill themselves. It's put in books to make them longer so that retards will think they're more comprehensive.

>the normal one
There is no normal one. Various companies and various open source groups use different styles, especially in C-like languages. Some styles even try a hybrid approach, with the opening brace on a new line for functions, and on the same line for if/while/for statements.

In any case, talk to your partner about which brace style you two will both use, and stick with it. One of you will have to give in, and if it ends up being you, deal with it.

python_programmer_tries_to_adjust_to_java.jpg