[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

Which one are you?

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 175
Thread images: 17

File: vmjzfg5svzapgsppmxwe.jpg (12KB, 479x310px) Image search: [Google]
vmjzfg5svzapgsppmxwe.jpg
12KB, 479x310px
Which one are you?
>>
>>57432922
correct answer is it doesn't fucking matter.
>>
Whichever one my IDE makes me use :^)
>>
left if you actually care about making your code readable
>>
whatever the code standard for the project requires

>>57432952
>look at me ima pleb

also >>57432932
/thread
>>
>>57432922
prefer right but I'll use whatever is consistent with the code base I'm working with
>>
>>57432922
Left is like having. a period in the middle of a sentence. It's so hard to read.
>>
Depends on my mood
>>
>>57432932
this, but keep it consistent
>>
>>57432922
left for signatures, right for control sequences
>>
I prefer left but will use right depending on the language or code base.

In some languages left can be ambiguous and lead to unexpected behaviour. I think right is acceptable in any brackety language.
>>
>>57432922
or, stop being an autist and use python.

if youre_not_shitty:
return best_code_ever
>>
>>57432922
left
>>
>>57433091
Python is for faggots and Guido is an idiot.
>>
>>57432922
I add the } right after the */ so I'm 3rd way
>>
>>57432922
>only programmers will understand this
>basic conditional control statement that can be found in any pajeet's intro to programming book
Next you're going to say printing "Hello World" is (((""""hacking"""")))
>>
>>57432922
right
left takes up too much white space
>>
>>57432922
For myself? Right.

However if the code standard is different for the project I'm doing, it's a given that it needs to conform to what the style guidelines is for the project.
>>
Left for classes, struts and functions

Right for short statements (around 5 lines). Using right for some massive block of code spanning several screens is retarded.

Your text editor should handle the brackets for you anyways
>>
>>57433119
assert bros_argument == nice
>>
doesn't matter if kept consistent

i prefer allman style though
>>
>>57432922
>left for sjws
>right for uncucked people
>>
>>57432922
If (condition) { Statements /* ... */ }

Keep it inline
>>
>>57433192
This. Used to use left, but then I started taking testosterone and drinking beer and beating up gays, and now I use right.
>>
I was taught to use the right, but I don't really mind either way.
>>
Left for symmetry
>>
>>57432922
Left. Easier to see what's happening where.
>>
>>57432922
Right, because I'm not an asshole.
>>
>>57432922
neither. I tab in from the left one or it auto tabs for me. plebs.
>>
>>57433204
based
>>
Right because I was taught by those who were taught by those who were taught by Richie.
>>
>>57432922
Left is definitely cleaner but I don't like it for some reason.
>>
File: thumbs up.gif (3MB, 160x160px) Image search: [Google]
thumbs up.gif
3MB, 160x160px
>>57432922
Left takes up more space but looks cleaner.
>>
>>57432922
>>57432922
>be right
>boss makes me install some config on my ide that configures to left when I ctrl + f
>sonarqube also complains if I do right
welp
>>
>only programmers will understand this
>same as CSS syntax

Cool, I guess that makes me a programmer now. Can I have a job please?
>>
>>57436079
Yeah the mop is over there in the closet. Get to work.
>>
>>57432922
left
>>
I use the left, at least for me it makes my shit way easier to read
>>
>>57432922
Right. It's the way it's meant to be written.
>>
>>57432922
left and right if the ide places it because i am to lazy to change trivial shit like that
>>
>Which one are you?

Right.

Left looks nicer but when you're maintaining code and scrolling through thousands of lines formatted that way you will wish it weren't.
>>
Used to be left, but then switched to right. I think it had something to do with a class I took.
>>
>>57432922
if(Conditions){Statements /* ... */}
>>
>>57432956
>>57432956
>>57432956
This, only use right side if you're a braindead pajeet working for 2 packets of crisps an hour
>>
>>57432922

//
// Something something something
//
if (Condition)
{
// Do Statement by X and Y
Statements
}
>>
>>57432922
Fuck you I'm neither I use a single line for my code.
>>
>>57432922
Right
>>
>>57432922

sick meme i'm gonna go post it on facebook
>>
the former, without a space after if

>>57438742
spot the C# nigger
>>
Right is better, left is using more lines = takes more space = works slower.
>>
I'm no programmer, but I can infer that it's related to code indentation

Stop making programming seem so unreachable ffs
>>
>>57438836
Not really to do with indentation, it's to do with code blocks, which start & end with curly braces.

Some people have start and end braces on seperate lines, which makes it easier to identify blocks of code when scanning through.

And then some brain damaged people have the start brace on the same line as the statement before it, with the end brace on a seperate line. No idea how this took off because it's just plain retarded, "muh one line saved" isn't really worth it when you have a 5000 line source file which looks like shit
>>
>>57438937
Really not an issue with the statement's indenting already serving as a start point.
>>
File: wG51k7v.png (66KB, 597x255px) Image search: [Google]
wG51k7v.png
66KB, 597x255px
>>57432922
this
>>
{statement} if (condition)
>>
>>57438808
actually i use Meme++
>>
>>57432922
Its crazy how this threads always get this amount of attention. Its fucking simple, Right one for everything except functions ... Only kernel devs will understand.
>>
File: 1478560451840.jpg (28KB, 479x311px) Image search: [Google]
1478560451840.jpg
28KB, 479x311px
>>57432922
USE LEFT IF U DONT WANNA GET LAUGHED AT AND FIRED

>>57438740
THIS

>>57432952
>Whichever one my IDE makes me use
CHANGE IT TO PROPER INDENTATION IN THE SETTINGS

>>57433450
>>57439045
RETARDS
>>
>>57432922
Whatever your team is using. Consistency is what's important. This type of discussion are pointless like spaces vs tabs or Vi vs Emacs. In the real world, it doesn't matter. Only kids who want to define themselves and feel superior care about this bullshit.
>>
>>57439065
THIS!

>>57439136
>spaces vs tabs
BUT USING SPACES WASTES MORE TIME!!
>>
>>57439190
meaningless time. the only time you should care about is the time you take to come up with a solution to the problem.
>>
>>57432932
It's about "which one are you" which means preference. So which do you like to use?

I personally would put the squiggle on a new line, just to make sure I don't miss it.
>>
File: 0e9.jpg (27KB, 600x600px) Image search: [Google]
0e9.jpg
27KB, 600x600px
function() {
statement;
statement;
statement;
statement; }
>>
>>57438968
ew.
>>
Golang forces me to use the right one and I hate it because of it.
But I use it anyway.
>>
if (condition)
{ statements
/*
....
*/
}
>>
if ()
{ statement; statement;
statement; statement;
statement; statement;
statement; statement;
}
>>
>>57432922
Neither. The space ) { looks ugly af.
>>
>>57433091
>return
>>
>>57433091
even python is too hard for you, it seems
>>
whatever the project spec states > whatever the language spec states > whatever I prefer (right side)
>>
>>57439567
>squiggle
Gr8 b8 m8, I r8 it 8/8
>>
New to prog but left looks like the right answer.
>>
Left
>>
>>57439622
>>57439680

I'm calling the police.
>>
Every time I see the right style I want to vomit.
>>
>>57438937
The reasoning I have heard is in the 80's, source code often needed to be printed out on paper, so by leaving out whitespace you save a lot of pages. I don't really know if this is true or not.
>>
File: Q8ZNXS8.jpg (57KB, 540x531px) Image search: [Google]
Q8ZNXS8.jpg
57KB, 540x531px
It doesn't matter as long as it's consistent
OR
Whatever is specified by the project requirements, company policy, your boss, etc.
>>
>>57432922
void func()
{
if (condition) {
statements
}
}
>>
>>57440206
This is the only wrong answer
>>
>>57439065
Left is borderline retarded you dumb FCK. The bracket is just confusing on that spot. If you really want some white space do right AND PRESS THE FUCKING ENTER BUTTON MONGOLOID.
>>
>>57439065
it takes more time to compile left
>>
>>57432922
left always
>>
I use left. If you want me to use your shitty style provide a clang-format config
>>
>>57439246
Also you can configure your ide/vim/whatever idk anymore to use spaces instead of tabs, jesus people!
>>
 (a > b) > ? (c > d) ? e : f : g 


i nearly puked when I found this kind of shit in a checkin from some intern
>>
>>57439796
> not even python
>>
>>57432922
Right

But if there's an else, it should get its own line
>>
>>57433209
Its the right-wing plebs
>>
if(condition) {
Statements
*/
...
*/}
>>
>>57433091
lmao fucking idiot
>>
>>57440206
void
func(
void
)
{if(
condition
){statements}}
>>
>>57440456
void
func
(void)
{if
(condition)
{statements}}
>>
>>57432961
Rightislikeputtingallthewordsclosetogetherfornofuckingreasonandactinglikereadabilityisjustasgood.
>>
>>57432922
To be honest I'm genuinely wondering why we still have purely text-based editors in fucking 2016, and why we're still arguing about this kind of thing no compiler cares about.
>>
>>57432922
Neither. I prefer
 
If Condition
{
Statments
/*
....
*/
}
>>
File: BpZuubPCQAABEbf.png (124KB, 600x450px) Image search: [Google]
BpZuubPCQAABEbf.png
124KB, 600x450px
>>57440588
>purely text-based editors

>his editor doesn't support embedded vector graphics and 3D models
>>
I use left out of habit, I've been doing that way since highschool. Honestly it might take a but if extra effort to make everything look clean, but it really improves the readability of your code which is quite important.
>>
>>57432922
The correct answer is right, prove me wrong.
>>
File: 1454753635537.gif (1MB, 480x287px) Image search: [Google]
1454753635537.gif
1MB, 480x287px
>>57440709
There.
>>
>>57432922
I use left for C++ and right for the rest.
>>
        void func(void)
{
if(condition)
{
statements
}
}
>>
>>57440696
I'm talking more about a complete abstraction of files so you just create classes and methods, variables being listed on a side panel, code arranged in side-by-side trees...

Something that isn't just a glorified text editor, but an development environment thought through from the ground up.
>>
>>57432922

Left side is OMG LOOK AT ME I'M SOOO CONTRARIAN STYLE.. Fuck that shit.


The beauty on the right is called 1TBS ("one true brace style", aka: K&R / Kernel / Linux / UNIX / „West Coast“ / Stroustrup / Java / Sun), because it's the one and only coding style if you want to be taken seriously.


Compare:

// nice and concise
for(i=0, i<10, i++) {
for(j=0, j<10, j++) {
for (k=0, k<10, k++) {
if (i>j && j>k) {
System.out.println("Hey-Ho!");
}
}
}
}

// bloated shit
for(i=0, i<10, i++)
{
for(j=0, j<10, j++)
{
for (k=0, k<10, k++)
{
if (i>j && j>k)
{
System.out.println("Hey-Ho!");
}
}
}
}
>>
>>57440764
>Edit > Change brace identation
>Edit > Replace spaces with tabs
>suddenly taken seriously

WOW THANKS ANON NOW I'LL BE TAKEN SERIOUSLY
>>
(prestatements)
(statement), (condition)

Mathematics is the only way gentlemen.
>>
>>57433142
>Next you're going to say printing "Hello World" is (((""""hacking"""")))

...it's not?
>>
File: lonfvFp1H1qdz90oo1_500.jpg (83KB, 332x750px) Image search: [Google]
lonfvFp1H1qdz90oo1_500.jpg
83KB, 332x750px
>>57438968
I'm strangely okay with this
>>
File: boner ritchie.png (468KB, 936x550px) Image search: [Google]
boner ritchie.png
468KB, 936x550px
>>57432922
K&R notation master race.
>>
>>57438968
It's like I'm really reading Python code
>>
>>57438968

This.. is fucking poetry.
>>
>>57438968
this is vomit inducing
>>
>>57440787

>get dozens of classes in sperate files by anon
>have to open them all
>have to edit them all
>"fire that asshole already"
>>
>>57440970
>Project > Edit > Change tabs and braces

WOW IT'S 2016 ALREADY, STOP USING VIM.
>>
>>57440709
>Which one are you?

Can't you fucking read ? there is no "correct" answer.
>>
It depends entirely on the language?
Java has a standard convention of keeping the open bracket on the same line as the condition
C# has a standard convention of keeping brackets on their own lines
>>
>>57432922
honestly left because i think it looks neater.
>>
>>57438968
This is fucking amazing
>>
left, but I don't really think the "only programmers will get this xD" is true
>>
>>57433119
i disparaged python before I used it a lot, but a lot of the modules are bretty neato and make things easy, like webbrowser, requests and beautiful soup. i like anything that makes things easier.
>>
>>57441036
I use left even with java, fuck the police
>>
>>57438968
not bad but it would take forever to format especially if you're changing the length of the lines at any point in time
>>
>>57440251
>brackets lining up is confusing
are you literally retarded?
>>
God said:
"Get fucked"

>vs.

God said
:
"Get fucked"


Gee i wonder which one's the correct one
>>
>>57441122
Why should they line up? Having a random line out of nowhere populated by one single brace IS confusing when you're expecting to see the block's body on the line after its definition.
>>
>>57432922
Depends on what I'm doing to be honest, for example if I'm dealing with JavaScript I'll use the right example out of pure habit, however with things like C I use the left again out of habit.
>>
>>57432922
Depends on the language
>>
>>57441158
it just makes visual sense, i can tell extremely quickly which bracket goes with which
>>
>>57441138
>colons = curly braces
plebian tier pajeet
>>>/java/
>>
>>57441218
I can do that too. My secret? Indentation. We use indentation for this exact reason. Messing around with the brackets is redundant and messy.
>>
(if condition
exp
exp)

Sure is a lot of ENTERPRISE QUALITY "programmer" in there.
>>
>>57441267
nice indentation, fag
>>
def complain
( no: String
, trailing: String
, comma: String
, made: Meme
, do: Fug
, it: F[A[G]]]): String = {
...
}
>>
>>57441284
>>57441267
(if condition
then-expression
else-expression)

Is your inner autist satisfied now?
>>
>>57441252
yes its a matter of preference, for me, it programming seems easier when they align, maybe it is my autism.
>>
>>57432922
if(condition){/*....*/}


Compactness > Readability
>>
>>57441302
>he says while boasting about knowing basic LISP
Do you even Haskell?
>>
>>57441284

Been a long time since I last shitposted 4chan.
I'm rusted.
>>
>he doesn't use
if(
conditions){statements
}


for(
int i = 0;
i < length;
i++){ printf("[%d] = %d", i, array[i]);
}

>mfw
>>
>>57441316
So do it like that then, be my guest. I only replied because the
>you're retarded if you think A is confusing
argument was dumb
>>
>>57441361
i am sorry i called you a retard anon, give me a hug
>>
>>57440191
>The reasoning I have heard is in the 80's, source code often needed to be printed out on paper, so by leaving out whitespace you save a lot of pages. I don't really know if this is true or not.
Why not put the end brace on the last line of statement code then?
>>
>>57441373
I'm not >>57440251, but thanks for the hug :3
>>
>>57441324

I-I can't...

Every time I read about Haskell's monads, it sends me reading about mathematics monad, than set theory and ... and then I feel shitty for not knowing as much math as I would like and I forget Haskell...
>>
>>57432922
Left is neat and organized, I hate how some IDEs automatically set it up like right.
>>
>>57441390
I started with Learn You a Haskell, it satisfied my autism just right without going into too much detail at the time
>>
Why isn't there a ide to remove brackets and format like python?

How about a ide that let's you change between the two given styles?
>>
>>57441412

That's the thing though. Not enough details for me.

My ideal Haskell book would be the Haskell specs stapled at the end of a math book.
>>
File: serveimage.png (536KB, 4677x3307px) Image search: [Google]
serveimage.png
536KB, 4677x3307px
>>57433142
But it is anon
Pic related
>>
>>57441405
Based Visual Studio does it like on the left
>>
>>57441451
Have you at least read about category theory? I bet you'd love that shit and it helps understand a lot of haskell concepts without ever even seeing haskell code.
>>
>>57441451
I don't know how to say this anon but I'm pretty sure you autism... and it's terminal
>>
>>57441324
>boasting
Hold your horses there, I was just catering to that autist's OCD. I enjoy Haske\\ too.
>>
>>57441475

I did. But then it's another math topic. And another. It's a rabbit hole that only end when I say "welp I dumb. let's watch some porn, now.".
>>
>>57432922
Neither, i don't use shill c languages. Fortran master race.
>>
>>57440191
>tfw had to print out 10,000 lines of code for a school project
>>
File: scarlet book.jpg (11KB, 260x325px) Image search: [Google]
scarlet book.jpg
11KB, 260x325px
>>57441390

monads take a while to understand, but it's not something that should be blocking your progress.

Knowing what a monad is doesn't help you too much. It's not like you want to create your own monads, it's enough to just know what they are.

I write functional scala, I got into it from reading the scarlet book. It's a very humbling book for sure, but it introduces more abstract concepts in a somewhat gentle way.

It's far from easy, it took me a year of on and off scala writing before I really understood everything in it, so don't be discouraged if you find it hard.
>>
>>57432922
if op.is_using_ugly_verbose_language:
op.switch_to_masterrace_python()
>>
>>57441545
def __init__(self, *args, **kwargs): yourself
>>
>>57438742
>//
>//
>//
why not
>/**
>*
>*/
>>
if C/C++ then left otherwise right
>>
>>57441578

/a.out "kill"
>>
>>57441578
def __init__(self):
print("This guy actually doesn't use indentation and declares unnecessary arguments")

You're trapped in your verbose mentality anon. You have to ditch this completely and understand that the python way is the only stylistcally right way.
>>
>>57441219
what does this has to do with java?
>>
>>57441644
Anon's way IS the "python way", and the "python way" is dogshit. You losers don't even have proper lambdas and closures.
>>
>>57441620
Why does this convention have /** instead of /* on the first line

triggers my autism
>>
>>57441654
Do differentiate the documentation comments from regular comments.
I think it's better than
>///
at least.
>>
>>57441651
print(lambda: "what do you", "mean?")

>closures
You mean python is bad because it doesn't have confusing and bloating construct, that doesn't solve anything that can be solved with much easier language syntax? Those closures?
>>
>>57441675
Wo, my bad, I meant this
l = lambda: "what do you mean?"
print(l())
>>
File: 1NP9CUu.jpg (46KB, 530x560px) Image search: [Google]
1NP9CUu.jpg
46KB, 530x560px
>>57432922

I can only tolerate the main statement having the bracket style of the left. Everything else must have the first bracket on the same line as the conditional masterrace.
>>
>>57441675

(0 to 1).map(λ => println("kill yourself"))
>>
>>57441675
Oh okay so you just don't know what you're talking about.

>print(lambda: "what do you", "mean?")
Prints nonsense. I'm not even sure you know what you want to happen with this.

>You mean python is bad because it doesn't have confusing and bloating construct, that doesn't solve anything that can be solved with much easier language syntax? Those closures?
Just because you don't know what a closure is, doesn't mean it's useless. In fact they greatly reduce code bloat since you don't have to declare classes and objects every 5 minutes. Furthermore, python DOES have closures, they're just shit since they don't let you mutate their referenced variables by default.
>>
File: 1476979013197.jpg (540KB, 1100x1002px) Image search: [Google]
1476979013197.jpg
540KB, 1100x1002px
>>57432932
/thread
>>
>>57441711
what about nonlocal?
More verbose, but you got proper closures.
>>
>>57432922
Everything in one line... fucking plebs.
Thread posts: 175
Thread images: 17


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.