nice thread idiot
sage
>>63317478
Another 9gag meme
True patricians only.
match cond {
true => {
},
false => {
}
}
(condition)?(true):(false)
one true ruler of them all
if(condition){Statements; /** **/}
...
stop it get some help
you stupid fuck
who gives a fuck?i always use the first one(except when i program in java) because i like seeing code in blocks,but if you prefer the second one thats fine too.just use one of these and you are good.
Left is c/c++
Right is java
follow the project guideline.
if no guideline, use whatever is used in the official doc.
Everything else is retarded.
if(succ)
{
wewlad
}
>9gag
LLVM uses the one on the right.
It's literally the reverse.
#DEFINE BEGIN {
#DEFINE END }
#DEFINE IF if(
#DEFINE THEN )
//etc
I use both.
wat
Whole condition goes on one line.
If I'm not mistaken, he's using C preprocessor instructions so he can write C programs in a Fortran style.
} elseif {
Why do people do this? It looks like shit.
> instead of actual programming topics, Sup Forums spends all day bikeshedding on the most simple of code style choices
Stay nĂ¼, Sup Forums
Tomorrow's srsbsns topic: tabs or spaces
Only sane answers
No one on Sup Forums actually programs.
(define (fag-check OP)
(if (= OP fag)
(display "OP is a faggot")
(display "OP is a pretty cool guy")))
ternary masterace
???????????????????????'
>(condition)?(true):(false)
FTFY:
(condition)
>replying to my obvious baitpost
A thread still died for this
>9gag picture
>retarded *** will know meme
>facebook tier humor
>barely readable because retarded meme is save/uploaded by retarded people so the jpeg compression artifacts pile up
nigger what are you doing? Sage in all fields
left for work
right for personal
Nah. Java ides are always forcing the right while c++ reference prefers left
The correct style is the style that my lead developer picked.
weird way of spelling awesome
all me
left: programmers
right: coders/koders
prove me wrong
the thinking mans choice
#include
int main(){printf("asdf\n");}
*evidence against you are claim*
insightful
for an insightful original point
so declarative and python fags aren't people.
right.
wow thanks i tried hard
...
This looks cool, actually.
Only sane braces out there
>type one line slightly past wall of punctuation
>have to reformat entire file so they all line up again
not a problem if you stick to 80 chars like you should
vaguely better
(define (fag-check OP)
(display (if (= OP fag)
"OP is a faggot"
"OP is a pretty cool guy")))
somewhat better
(define (fag-check OP)
(display
(string-append "OP is a "
(if (= OP fag)
"faggot"
"pretty cool guy"))))
or in CL
(defun fag-check (OP)
(format t "OP is a ~:[pretty cool guy~;faggot~]") (= OP fag)))
heh
if condition:
statements
good work user
you're the hero this thread needs
mari > asuka > rei
(defun fag-check (OP)
(format t "OP is a ~:[pretty cool guy~;faggot~]" (= OP fag)))
fixed
>No one on Sup Forums actually programs.
well, it's not actually a programming board to be fair.
apart from the fact that its java and has class names longer than that
This is why I like python so much. They had the balls to drop that punctuation nonsense
But otoh they made this whole .self hell
This is the correct way to do it brainlets
if ("true".equals(String.valueOf(condition))) {
/* .. Statements */
} else if ("false".equals(String.valueOf(condition))){
/* .. Statements */
} else {
throw new Exception("The condition is not true nor false!");
}
this is some high level high leveling
...
If (!(OP != faggot)) {
btfo = printf("ban OP");
return btfo;
what the fuck
>not choosing a code path randomly
I can smell you from here pajeet
If you dont use the terniary operator for everything you are a waste of oxigen
condition ? trueCallback() : falseCallback()
cmp eax, ebx
je true
mov eax, s_knowwhatop
jmp aftercond
true:
mov eax, s_yourgay
aftercond:
int 3
inspect element
giving the { its own dedicated line makes no sense since there is already an indentation
>FECES CUM
It provides extra clarity and makes it easier to discern a codeblock when speed scrolling. Readability is everything.
When I was a beginner, I used to be a huge fan of K&R, but as I got better, have completely switched to Allman's indentation style
if (a=e||a>d) {
a=b>d?c:f
f=ad)
{
a=b>d?c:f
f=a