Which is it?

Justin Edwards
Justin Edwards


foo (bar)

VS

foo ( bar )

Joshua King
Joshua King


foo (
bar
)

Carter Mitchell
Carter Mitchell

(foo bar)

Jayden Bell
Jayden Bell

foo bar
Any language worth its salt doesn't require parens around function calls.

Andrew Myers
Andrew Myers

Which is it?
foo; bar; baz;
or
foo; bar; baz
hint: the semicolon is a binary operator

Jaxon Howard
Jaxon Howard

(foo)bar

Jaxson Stewart
Jaxson Stewart

C was a mistake

Adam Ortiz
Adam Ortiz


int foo
(
<tab> int bar
)
{
... function body...
}

Dylan Wood
Dylan Wood

foo < bar

Christian Morris
Christian Morris

foo {
bar
};

Eli Williams
Eli Williams

That's not C, the semicolon is not an operator in C.

Lincoln Garcia
Lincoln Garcia

It should have been.

Ayden Hall
Ayden Hall

foo bar
In OCaml those parentheses could be omitted.

Connor Foster
Connor Foster

Isn't comma an operator in C tho?

David Nelson
David Nelson


foo.bar();

Cooper Green
Cooper Green

(foo (bar baz))

Lucas Long
Lucas Long

No

Dominic Miller
Dominic Miller

foo->bar();

Jayden Jones
Jayden Jones

op (fag )

Carter Reyes
Carter Reyes


foo(bar){
like_this();
}

Carson Powell
Carson Powell


**** COMMODORE 64 BASIC V2 ****
64K RAM SYSTEM 38911 BASIC BYTES FREE

READY.
10 FOO$
20 BAR$
30 PRINT FOOBAR

Isaiah Clark
Isaiah Clark

foo (((bar)))

Landon Cook
Landon Cook

{
baz ;
}
( bar ) foo ;

Jeremiah Anderson
Jeremiah Anderson

foo[ bar; ];
been dabbling in inform 6 lately

Hunter Sanchez
Hunter Sanchez

BAR FOO

Chase Wood
Chase Wood

Function definition:
int foo(bar)
{
...
}

For statement:

for (i = 0; i < bar; ++i) {
...
}

Austin Gray
Austin Gray

barefoot?

Nicholas Edwards
Nicholas Edwards

the semicolon is a binary operator
No, it's not an operator at all. It's just punctuation (statement termination delimiter, to be specific).
there's no comma operator in C
Wrong, there is one. Not every comma in C code is the comma operator though (the commas separating functions parameters aren't as they are punctuation similar to the semicolon, while the commas in a for statement are).

John Collins
John Collins

(self.foo)(
bar,
);

Mason Carter
Mason Carter

Evan Hill
Evan Hill

foo bar

Dylan Moore
Dylan Moore

FUNCALL "{\"function\":\"foo\",\"argList\":[{\"varName\":\"bar\"}]}"

Kevin Thompson
Kevin Thompson

lol u take him 2 da foo bar|

Thomas King
Thomas King

int
/** Brief description.
* Detailed description.
* @param a The first parameter
* @param b The second parameter
* @return The result
*/
foo(int a, int b) {
if (a != b)
return a%b;

if (a + b == 2) {
b = a + 2;
a %= b;
}
bar(a, b);
while (a < b) {
a = baz(a, b);
quux(b, a);
}

return a*14730;
}

TL;DR documentation between return type and signature, function calls and declarations have no space between ident and parens, if/while/switch (keywords) have a space before the paren, Java-style braces.

Landon Hernandez
Landon Hernandez

its
foo bar

Oliver Harris
Oliver Harris

$::foo bar.

Henry Rogers
Henry Rogers

Java-style braces.
the absolute state of Holla Forums

Nicholas Morris
Nicholas Morris

doesn't require parens
I hope you mean purely functional languages with currying, where such syntax rises from function application being most tightly binging operator denoted by space.
And not brain-dead retardation that is perl & ruby syntax.

Connor Ortiz
Connor Ortiz

bar @ foo

Liam Moore
Liam Moore


foo, bar, baz.

Jack Watson
Jack Watson

his whitespace has side effects
oh no where are your endofunctors now

Landon Walker
Landon Walker

function application is side effect
Please stop sniffing solvent before it's too late

Levi Martinez
Levi Martinez

space after function call

Ayden Parker
Ayden Parker

[code] int foo, bar, baz;

Jose Morris
Jose Morris

[code] int foo, bar, baz;[code]

Samuel Taylor
Samuel Taylor

goddammit how do I write code?

Dylan Murphy
Dylan Murphy

kode with karlie

John Perez
John Perez

add a slash before the second code

Gabriel Robinson
Gabriel Robinson

how do I use [code] tag?
[code] syntax plox

Joshua Long
Joshua Long

add a slash before the second code
that was my next guess.

int foo, bar, baz;

Lincoln Morales
Lincoln Morales

What?

Nathan Stewart
Nathan Stewart



#include <stdio.h>

int main()
{
char input;

printf("Please input characters: ");
scanf("%[?]", input);

if (input == 'BAR FOO') {
puts("Did you say \"barefoot\"?");
puts("Because if you say \"BAR FOO\" five times fast");
puts("it sure af sounds like \"barefoot\"!");
}
return 0;
}

I just realize I don't know how to do character inputs yet because I haven't gotten that far in the book :-(

Jordan Lopez
Jordan Lopez

I was writing in FORTH. FOO would have stack effect ( x -- x') and BAR is what would be operated on

Benjamin Harris
Benjamin Harris

foo ((( bar = mitzva )))

Elijah Peterson
Elijah Peterson

FORTH
interesting. I hadn't heard of that language until now. May I ask why? I mean, it seems like an obscure language, so I'd be interested to know why you decided to learn it.

I'm trudging through C right now. In a couple years, I'll be another wannabe programmer fluent in a language or two working in a coffee shop, is my guess. Kinda depressing, but I've got to give it a shot. I'm really starting to wonder whether I would want to do this for a job, though. I think I'd rather do server maintenance than code... I think. I guess I just can't imagine what the actual job would be like at this point.

should've seen that coming...

Adam Stewart
Adam Stewart

There's a unifying theme to a lot of my Haskell style, and it is this: be explicit and use names. Why pervasively use record fields? I'm being explicit about the purpose of those pieces of data by giving those fields a name. Why qualify imports? I'm being explicit about their provenance by giving their provenance a name. Why use functions or records of functions instead of typeclasses? I'm being explicit about what functionality I'm dispatching to by giving that functionality a name. A related theme is: optimize for reading code later. If it takes longer to write or uses more lines or more variable names, but it's going to be clearer to another person reading my code—or to me, coming back to that source file in a month or a year—I will absolutely take the time to write the longer code.

But also, like a mediocre high-school essay writer, I want to reiterate what I wrote at the beginning: this is one of many styles, and it has its own tradeoffs! (Verbosity being a big one here.) Your style might be (and probably is) different, and that's a good thing: in fact, I'd be interested in reading analogous posts to this one that describe the specifics of and motivation for other people's Haskell styles! I don't think there's a "wrong way" to write Haskell: there's a multiplicity of possibilities, and we as Haskell users should embrace that!

…well, unless y'all use TypeInType, in which case you're clearly depraved in ways that medical science cannot fix.

Luis Morales
Luis Morales

Cause programming is fun and Forth is fun. And it's way more powerful than C and the gang, just lacking in libraries (especially now it's basically dead). I write my own scripts in a dialect called Retro Forth

Matthew Rodriguez
Matthew Rodriguez

user was banned for this post

Gavin Gonzalez
Gavin Gonzalez

Neither. It's
foo(bar);
/thread

Connor Thompson
Connor Thompson

FORTH
Because it's machine-code level of abstraction. If your other option is using assembly - FORTH might be a more productive choice. If your other option is BASIC - FORTH is only correct choice. If you have something as fancy as C compiler on your platform - you are out of FORTH use case.

For fun/educational purposes, write FORTH VM. It's simple enough that you can make decent one in one evening. Then write for it.

John Hill
John Hill

-[--->+<]>-.[---->+++++<]>-.---.--[--->+<]>-.++[->+++<]>+.------.++++++++++++.--------.[->+++<]>-.

Gabriel Davis
Gabriel Davis

well, I'm just 1wk/4ch into C programming. I went with it because it seemed like the most useful place to start and the best for the job market. I won't have a CS and I'm not sure how to get experience in the field, though, so idk if I'll ever get a job. I have degrees, just not in CS. trying to make a career switch

Hudson Williams
Hudson Williams

you could start by doing a poo in the loo pajeet

Justin Harris
Justin Harris

If I were a pajeet. I wouldn't have lost my career for being le ebul wyt mail blonde nazi jewkiller cishet patriarchal rape culturist

Caleb Carter
Caleb Carter

Trick question. People who waste time on this bullshit instead of fixing the real problems in their code are unemployable.

Kayden Walker
Kayden Walker

not adhering to a code style that is both sane and consistent is not a real problem

Aiden Russell
Aiden Russell

Your format should follow the convention set by the lead developer. This is a trivial problem for your code formatting software. This is the reason why it's meaningless to think about formatting beyond what the lead developer says.

Hunter Taylor
Hunter Taylor

FORTH is more productive for most software, once you think outside the C-like mindset.

Learn C++ if you want a job.

David Scott
David Scott

foo(bar)

Jonathan Murphy
Jonathan Murphy

bar foo .

Benjamin Cooper
Benjamin Cooper


foo
(
bar
)

Jackson Stewart
Jackson Stewart

/.*java.*/i
<REEEEEEEEEE REEEEEEEEEEE JAVA JAVA JAVA GTFO PAJEEET REEEEEEEEEEEEEEE
I want /g/ to backsodus.

Xavier Anderson
Xavier Anderson

This should give you the functionality without any buffer overflows (although I could be wrong since I'm still a C scrub)

#include <stdio.h>
#define BUFFER_SIZE 10
#define BAR_FOO_STR "BAR FOO"

int main()
{
char input[BUFFER_SIZE];

printf("Please input characters: ");
if (fgets(input, BUFFER_SIZE, stdin) != NULL && strlen(BAR_FOO_STR) == strnlen(input, BUFFER_SIZE) && strncmp(input, BAR_FOO_STR, BUFFER_SIZE) == 0)
{
printf("Did you say \"barefoot\"?");
printf("Because if you say \"BAR FOO\" five times fast");
printf("it sure af sounds like \"barefoot\"!");
}
return 0;
}

Asher Myers
Asher Myers

Look up the history of the CRPG "Starflight" (published by Electronic Arts on 1989). Forth is good for making smallest compact code. Very usedul for microcontrollers and such.

Brandon Clark
Brandon Clark

Just use readline(3).

Aiden Ortiz
Aiden Ortiz

Sounds like dependency bloat for something so simple.

Kayden Long
Kayden Long

How do you faggots ever get any work done if you squabble over the pettiest shit like fucking intervals between brackets?

Logan Gonzalez
Logan Gonzalez

It's as if they've never heard of code formatting programs.

Tyler Phillips
Tyler Phillips

xd

Austin Flores
Austin Flores

Oh yeah, you're right, forgot about the for loop comma

Jaxson Baker
Jaxson Baker

Best method.
I want /g/ to backsodus
Agreed. Pack your things and leave, Javanigger.