ITT: SUBJECT RELATED
type
function(type a, type b)
{
if (bool) {
something();
whatever();
}
statement;
statement_two;
{
code related is masterrace, prove me wrong
pic unrelated
ITT: SUBJECT RELATED
type
function(type a, type b)
{
if (bool) {
something();
whatever();
}
statement;
statement_two;
{
code related is masterrace, prove me wrong
pic unrelated
Other urls found in this thread:
github.com
twitter.com
variables a and b are unused and should be removed
this
Just add __attribute__((unused)) after the typename.
Or [[maybe_unused]] if you are using a very up to date compiler and they get used or not depending on the preprocessor.
I love how consistant C++ is.
>function ()
>{
but then
>if () {
wtf, nigga?
samefag
In C you can't nest function definitions, so it kind of makes sense what he is doing.
I am against your style of ending functions with an open brace
I think most language standards agree with me
& { only for functions
type function(type a, type b) {
if (bool) {
something();
whatever();
}
statement;
statement_two;
}
type
function(a, b)
type a;
type b;
{
...
}
This
>if (
why on earth do people do this
>type function
no
> {
>}
not for functions
type function( type a, type b )
{
if ( a == b ) {
doop( a, b );
} else {
meh( a, b );
}
blah();
}
No, OP, this code is master race:
type
function(type a, type b)
{
if (bool) {
something();
whatever();
}
statement;
statement_two;
}
>mixing 2 and 4 spaces
please be satire
thank you senpai
Those aren't "4 spaces." Those are tabs.
Those are definitely spaces, user.
>mixing spaces and tabs
That's even worse
type function(type a, type b)
{
;;;;if (bool) {
;;;;;;;;something()
;;;;;;;;whatever()
;;;;}
;;;;statement
;;;;statement_two
;}
Only way to settle tabs vs. spaces!
>;}
wtf user
disgousting
that's not disgusting, that's a function smiling at you. everybody needs a little love, especially programmers.
Hello K&R C, my old friend.
I copied OP's code and made one and only one change: for the last { to be a }. OP also mixed 2 and 4 spaces, because he's a faggot.
perfection
why do you hate yourself
The HL2 source code actually uses a similar style. I like it when things don't stick tightly together, it has nothing to do with hating myself (although I do hate myself).
;_;
literally Java certified programmer
>HL2 source code
WHERE IS IT
Found the fizzbuzzer
Actual master race:
(a,b)=>{
bool&&(something()
whatever())
statement
statementTwo
}
>can't see where the blocks start quickly
>call others fizzbuzzers
try writing something with more than one function or method, then call me
this is what node.js documentation uses
>>can't see where the blocks start quickly
This is literally the reason there's indentation in code. Are you fucking retarded?
>(something()
whatever())
That won't work. You have to either use the operator "," here or make an anonymous function
I sincerely hope no one in this thread is a professional programmer.
/*
* Description of function
* Description of parameters
*/
type function(type a, type b) {
/* Explanation of why this boolean manipulates this function */
if (bool) {
something();
whatever();
}
statement;
statement_two;
}
If you have to explain how your code works, your code is bad.
Comments aren't for explaining how your code works, they are explaining why your code is doing what it does