[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
What type of programmer are you? Choose one from each: >tabs
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 158
Thread images: 4
File: 6348440383_f0d2191b9e.jpg (128 KB, 447x500) Image search: [Google]
6348440383_f0d2191b9e.jpg
128 KB, 447x500
What type of programmer are you?

Choose one from each:

>tabs or spaces

>single or double quoted string

>variableName or variable_name

>same line { or new line {
>>
>>53042344
Spaces, mostly single quotes, snake_case, { on new line.
>>
Tabs, Single Quoted string, VariableName, New line {. All about that aesthetics mang
>>
>>53042344
tabs
double quote
for variables it's variable_name and for methods it''s variableName()
same line {
>>
>>53042344
tabs, though tabs converted to spaces if it makes sense
sinlge-quoted
variablename
same line {
>>
Tabs
Single quoted
variableName
New line
>>
>>53042344
>single or double quoted string
Wait, what? Who uses double quotes? For what purpose? ""Hello"" takes more keystrokes and offers no advantage over "Hello"
>>
>>53042344
Tabs
"these"
variable_name unless I'm working with OO objects
Same line, except with if and else statements
>>
>>53042344
Spaces
"Single"
camelCase
Same line {, different line }
>>
>tabs
>double
>variable_name
>new line
>>
>>53042344
if ((($vm.wimindex -eq '3') -or ($vm.wimindex -eq '4')) -and (($vm.servername -notlike '*EX14*') -or ('CWIN*')))
{
$VMINSKEY = $layoutxml.build.feature.KMS.KEY[1]
}


+2 internets for someone that can tell me what language this is.
>>
>>53042344
>What type of programmer are you?
the best type
>Choose one from each:
>>tabs or spaces
tabs
>>single or double quoted string
double
>>variableName or variable_name
camelCase
>>same line { or new line {
install {
gentoo
}
>>
>>53042344
tabs converted to spaces
double quoted string
variableName
new line {
>>
>>53042521
bash?
>>
>>53042521
Perl?
>>
>>53042344
tabs
double quotes
snek
{ on new line. it makes it easier to see block constructions. though the K&R way is okay too
>>
>>53042531
>>53042533
Variable names should give it away, but maybe only if you're a systems admin.

It's plain as day to me, but that's because I wrote it.

It's powershell (v3.0 - Server 2012)

Depending on the name of a server (because they're named based on function) the correct product key gets inserted into an unattend.xml.

And I'm going to try to sleep again...
>>
>>53042565
Powershell seems interesting. I'm a fan of c-like syntax for the command line.
>>
tabs
dubs
camelCase
new line curlies
>>
>>53042344
Never coded much more than runescape private servers in java, but..
Tabs
Single
variableName
new line for {
>>
>>53042344
tabs
double quoted
variable_name
new line {
>>
>>53042445
'hey' vs "hey"
>>
>>53042344
tabs
double if I can use it
variableName
depends on my mood. mostly same line
>>
>>53042344
>What type of programmer are you?
>Choose one from each:
>>tabs or spaces
Tabs
>>single or double quoted string
Double
>>variableName or variable_name
variable_name
>>same line { or new line {
void eat_shit (FAGGOT_DATA *OP, cocks *sucked)
{
cocks sucked1 [MAX_AMOUNT_OF_COCKS]...
I really don't care enough to keep writing fake code calling OP a faggot cock sucker.
>>
>>53042344
both
depends on the language/project
depends on the language/project
new line
>>
>>
the first points are dependent on the target language, the only once i make sure is constant across all is
>new line {
>>or equivalent block/struct start
>>
Tabs, double, vName, same line
>>
>>53042344
Spaces (inserted with tab key in Vim)
Double
_
new line for functions, same line otherwise
>>
>>53042344
tabs
I prefer languages that differentiate, but use double quote for strings even in those that don't out of habit
depends on the convention used in the language
same line { (but I give } its own line)
>>
Tabs
Single
varName
Nes line
>>
tabs
double
var_name
sameline {
>>
tabs
single
depends on language
same line
>>
>>53042344
tabs, double quotes, camelCase, same line
>>
>>53042344
Spaces (1 Tab = 4 spaces)
Single quoted string (unless Perl)
camelCase
same line {, next line }
>>
int main(void) {
printf("Behold, perfection\n");
return 0; }
>>
>>53042525
tabs
"String"
stuffname
stuff_n
stuffName()

name
{
<tab>stuff
}
>>
>>53042344
>tabs or spaces
set expandtab
set tabstop=2
set shiftwidth=2

>single or double quoted string
Single for non-interpolated strings, double for interpolated. Unless the language only supports one type I.e. C.

>variableName or variable_name
variable_name

>same line { or new line {
Depends on the prevailing style of the existing code. Same line if it's my own brand new code.
>>
>>53042565
What do you use it for exactly? MDT?
>>
Tabs
Double-quoted
variableName
Same line
>>
>>53042344
"oop in ool"-type at work, which means:
>spaces
>double quotes
>variableName
>new line {
>bonus: hungarian notation

K&R-type at home:
>tabs
>double quotes
>variable_name
>same line {
>>
Four spaces
Double quoted string
Depends on the language
K&R style
>>
spaces
double quoted
neither, use Variable_Name instead
what's { for?
>>
>>53042344
>tabs or spaces
I use tabs by default but I don't really care.
>single or double quoted strings
Both equally t.bh.
>variableName or variable_name
Depends.
>same line { or new line {
do … end
then … end
Otherwise, also depends.

I keep same style consistently in each piece of code, but not necessarily between different pieces of code.
>>
>>53043836
It's K&R's coding style. They never gave a rationale for this point, mine is that you can tell function blocks and conditional blocks of code apart better.
>>
tabs, double, variableCase, same line {
>>
Tab
Double
camelCase
new line
>>
>people implicitly suggesting that double and single quotes serve the same purpose
>>
>>53042344
>Choose one from each:
>>tabs or spaces
tabs for indent, space for align
>>single or double quoted string
those are different things
'c'
is a char,
"c"
is a string
>>variableName or variable_name
depends on the Codebase, and language in use
variableName for haskell
variable_name for C
>>same line { or new line {
depends on the context
kernel-style mixing
>>
It depends on the language I'm using
>>
>>53042344
>spaces
>single
>variable_name
>new line {
>>
>>53042344
tab

'string constant'
"interpolated $str"

var, long_varname

sub foo
{
for (0 .. 255) {
print "$_ : $bar[$_]\n";
}
}
>>
>>53042344
>depends on the language (python - tabs, most everything else - spaces)
>depends on what it is. mostly double quotes though
>depends on the language
>same line
>>
>>53042344
* spaces
* I am completely inconsequent, sometimes single sometimes double.
* variableName
* same line {
>>
>>53042344
>>tabs or spaces
Spaces
>>single or double quoted string
Depends on language and context
>>variableName or variable_name
Depends on language. Also, doing whatever the project is already doing > following language standard/most common practice > variableName
>>same line { or new line {
See previous. When in doubt, no new line for statements, new line for declarations.
>>
vim can do this easily so why not
>'This doesn't work' "This doesn't have that problem"
>noOneCanReadThisFactory people_who_hate_this_are_lazy
>Good luck writing or reading this (({[{(
>>
>>53042588
it's a nightmare. it's mainly just lisp-tier putting fucking everything in brackets because you have literally no idea whether it will parse something as 1 argument or 10.

it's also a bitch if you're working with different version. Want to select only the name properties returned in an array variable? $returnvar.Name is easy! ......except in powershell v2 that will return null, but only sometimes, it works fine in other circumstances, usually when you bury every single word in extra brackets.

fuck i hate powershell
>>
>>53042344
Tabs

Single in languages/small things where it doesn't matter

Usually CamelCase, mainly because I spend the majority of my time at work using SQL and our databases are named with it, plus it looks pretty. Usually flows over into my scripting/programming but looking at my most recent side project I was working on last night I notice I just yolo all lower cased everything.

same line. Done the below for 15 years but in the past few months I've started to bring else/elseif up onto the closing bracket line. I'm still on the fence whether I like it.
if (x==y) {
asdf
}
else {
asdf
}
>>
>>53042344
>>tabs or spaces
tabs
>>single or double quoted string
double
>>variableName or variable_name
variablename
>>same line { or new line {
same line
>>
>depends
>depends
>depends
>depends

What kind of a shitty poll is this? You use the langauge's or project's convention whenever working on code.
>>
Tabs
Double quoted strings
camelCase
Same line

What do you think I'm some kind of wild fucking animal who uses spaces and underscores in their variable names?
>>
>>53042501
this
>>
tabs
double quotes
variable_name
new line {
>>
Tabs converted to four spaces. Especially with Python.
Double quotes so it doesn't conflict with readability or implementation.
variableName. The underscore is too hard to type.
Thereis()
{
No reason not to use different lines
}
>>
>>53042344
Tabs, double qouted string, variableName, new line{
>>
>>53042344
>Tabs
>Double
>masterRace
>New line {
>>
neither
double
int asdf;
don't care
>>
>>53042344
tabs
double
variable_name
newline

it's funny because I used to argue having { on the same line was superior and saved space, but I've somehow grown away from it.
>>
>>53042501
Spaces
'Single'
camelCase
Same line{
lol}
>>
tabs
camelCase for variables and functions, UPPER_SNAKE_CASE for constants and macros

Same line if() {
}
>>
>>53045130
I don't want to work with you.
>>
>>53042344
spaced tabs
double
kebab-case
same line
>>
>tabs
>double
>variable_name
>if(...) {
>>
>>53042344
>tabs or spaces
tabs
>single or double quoted string
Makes no sense to ask. It can be dependent on the language.
>variableName or variable_name
Depends.
>same line { or new line {
Same line except in a few cases where for whatever reason new line might be better.
>>
>>53045202
this reminds me

for enums, I use all caps + underlines. variable names I use lowercase + underlines, and method names I use camelcase.
>>
Press tab, receive 4 spaces.

Single quoted unless the string contains quotes / apostrophes or the language makes a difference between string type and character type.

Usually camelCase unless I have a bunch of variables related to each other like
graphic_original
graphic_highContrast
graphic_markedCorners

etc.

No { at all :^) But if I use them, then on a new line, no indent.
if (urMum_weight > 9000)
{
for (int idx = 0; idx < 100; idx++)
{
fprintf("Yo momma fat!\n");
}
}
else
{
fprintf("I would.\n");
}


Also never use i as an index (complex numbers and shit).
>>
tab inserts spaces
string depends on language, but prefer double quotes
function_name {
>>
>>tabs
>>single or double quoted
Depends, single if there's no variables that need the value displayed in the string
>>variableName
>>same line { or new line {
Depends on language
>>
>>53042344
Tabs
"Quote"
Depends on variable scope, usuallyLikeThis.
Same line{
}
>>
>>53042344
>tabs
>"double"
>thisKind
>new line {
>>
How do you comment?

%{
////// USER VARIABLES START //////
%}
% This comment only refers to the following line of code.
currentUser = 'anon';
cocksSucked = 0; % This comment tells you the default value. It's 0.
%{
////// USER VARIABLES END //////
%}

argument1 = [];
argument2 = 9001;
analCircumference = Inf;

%{
This comment refers to the following block of code up until the next blank line
with the same indent depth, or the end of the file. In this case it's line 26.
Line length is limited to 80 characters including indent spaces.
%}
makeThread;
if (currentUser = 'OP')
suckCocks(1);

% Increment cocksSucked
cocksSucked = cocksSucked + 1;

% This is a very long comment that refers only to the following line of
% code but exceeds 80 characters, necessitating the inclusion of line
% breaks.
commandDescribedByLongComment(argument1, argument2, analCircumference);
endif

fprintf("My name is %s and I have sucked %d cocks so far!\n", currentUser, ...
cocksSucked);
>>
Spaces, double, variable_Name, new line
>>
>>53045609
/*** IMPORTANT COMMENT ***/

//End of line comment
>>
tabs
double quoted
variableName
same line {

can you tell I'm a Java fag?
>>
>>53042344

Tabs
Double Quote
variableName
sameline {

please be gentle
>>
Spaces
Double quoted String
variableName
same line {
>>
>>53042521
Powershelllllllllllll
>>
I do all of the above.

Per language syntax.
>>
>>53042344

>tabs or spaces
Tabs for Algols like C, C# and the such, spaces for Common Lisp Master Race

>single or double quoted string
Language-mandatory in above mentioned, mix-and-match in Bash and PHP and the such

>variableName or variable_name
kebab-case in Common Lisp Master Race, snake_case in C, camelCase in other Algols
>inb4 >remove kebab

>same line { or new line {
same
>>
Spaces
Double
variableName
Same line {
>>
>>53044479
>psh
>lisp
you have literally no idea how Lisp works, do you?
Don't worry, there's plenty of places where to start
http://cliki.net/Lisp+Books
This one's free:
http://www.gigamonkeys.com/book/
>>
>>53042344
>tabs
>double quoted
>variable_name
>new line {
>>
tabs
double quote
variableName
if(){
}
>>
Tabs
Double quotes
Both are acceptable
Braces on their own lines
>>
>>53042344
>tabs
>double quoted
>camelCase
>int main () {
>>
>>53042344

Spaces, I can't stand tabs.
I'm not entirely sure putting multiple quotes around a string would work all the time.
variableName because underscores are for using the same name for different things.
Example:
variableName_input
variableName_output

And putting { on the same line just looks bad.
>>
>>53042344
Tabs (displayed as 6 spaces)
Double "quotes" always
variableName, FunctionName, CONSTANT_NAME
new line {
>>
>>53042344
>tabs or spaces
Both, preferably. Tabs for indenting, spaces for formatting.

>single or double quoted string
C doesn't work like that desu senpai

>variableName or variable_name
variable_name

>same line { or new line {
Allman-style is best style.
>>
>>53042523
+1 for agreeing
>>
>>53042344
tab
double
camelCase
new line {

I know I'm a pleb but I've been doing it for years
>>
File: 373800.png (93 KB, 320x240) Image search: [Google]
373800.png
93 KB, 320x240
>>53042344
>tabs or spaces
spaces
My .vimrc converts all tabs into spaces. One less character to care about.

>single or double quoted string
Well double because in some languages single quotes is for characters only. That said in big JS projects where it doesn't matter I'll use single quotes to signify internal string variables like object keys and double quotes for content (since it makes apostrophes easier to escape and in my head double == string anyways) Really language dependent.

>variableName or variable_name
Pretty langauge dependent but if I had it my way it would be functionName, ClassName, variable_name, CONSTANT, __GLOBAL__

Probably because I learned on C/C++. Also I think search and replace is easier with variable_name and that it is easier to read and less ambiguous when trying to remember if the library spells things like constantUrl or constantURL when if could be constant_url

>same line { or new line {
Again this is pretty language dependent. In more functional style languages and using callback/closures/lambdas/anon funcs w/e I use same line { for regular block scoping I use new line { because I like how the blocks stick out more. Not like I'm going to run out of room on my text editor.
>>
>>53042401
This
>>
>>53042445
Are you retarded
>>
>tabs
>single (why the fuck would I press shift)
>honestly both
>Same line {
>>
>Tabs or spaces
Smart tabs except where a language standard exists to the contrary (I.e. 2 spaces on Ruby every time)

>Single or double quoted string
In every language I use regularly, these are semantically different. I use whatever is semantically appropriate.

>variableName or variable_name
The latter is preferred.

>Same line { or new line {
I use the Linux kernel style unless language standards suggest otherwise.
>>
>>53042344
>tabs
>double
>variableName
>new line

IF (You) SEE THIS WHILE SCROLLING RATE YOUR UR DISTRO WILL BE ABANDONED
>>
>>53042344
Spaces, but I don't really care
"String" because it's easier to type on a German keyboard and looks nicer imo
camelCase because it's readable and compact
Same line { because it keeps blocks nice and compact
>>
>>53042344
4 spaces
double, single is for char
variables are variableName, fields are _variableName, properties are VariableName
\r\n{
>>
tabs
double
camel
same
>>
Tabs
Double quote
Camel case
New line {
>>
>>53042344
Tabs, double quoted, variableName and same line {
>>
>The correct kind
>tabs to spaces
>double
>variableName
>new line you fuck
>>
>>53042401
This is me
>>
the only language I actively use that supports all this is Perl, so I'll answer for that:
>spaces
>depends on usage, use single wherever possible
>kebab-case
>same line {
>>
>>53042344
tabs single variablename (nothing uppercaase) and new line.
>>
>implying you shouldn't change all of this based on the language you're using

>do you prefer single or double quotes in c

>do you prefer tabs or spaces in python
>>
>>53042445
why are you in this thread
>>
>>53042344
4 spaces
', if it's semantically equivalent to "
snake_case
same line {
>>
tabs for indentation, spaces for alignment.
"double"
localOrField
CONST_VAR
ObjectNameInOOP
Same line {, Omit { if single return statement
Space after control statements
No else or switch statements (indication of bad structure. Redo the structure)

my code generally looks like this:
ReturnType doSomething(Param param) {

if (!precondition)
return/throw;

if (!precondition2)
return/throw;

doThing;
}
>>
>>53042445

' or "
>>
tabs
single quotes
camelCase
same line {
>>
>>53042344
tabs && spaces
double quotes
variableName
new
{
line
}
>>
4 spaces
"string"
variableName
same line {
new line { is for degenerates
>>
>people responding 'tabs'
/g/ confirmed for a bunch of high schoolers who have never had a job
>>
>>53042344
You adapt based on your situations, the language, and who you're working with.

Also, single and double quoted strings act very differently in most languages, so you have to switch between them.

That's a really oversimplified view of programmer types.
>>
>mfw inconsistent

I can never decide, I just Yolo it.
>>
>>53053637
proper lad 2bh
>>
>>53042344
Tabs, Why spend more time typing?
Double, dude, they are STRINGS.
variableName, Why spend more time typing?
>>
>>53042857
Almostly perfect, the "}" should be in a new line.
>>
>>53042344
>tabs
>double
>variablename
>>meme snake
>>
>>53042344
Depends on language and style guide.
Depends on language and style guide.
Depends on language and style guide.
Depends on language and style guide.
>>
>>53042344
>spaces
>single
>variable_name
>same line {
>>
>>53042344
Tabs
Double quoted
variableName
Same line {
>>
>>53042344
Tabs
Double
variableName
Same line {
>>
>>53042344
tabs
double quoted
variableName
same line {
>>
File: 20000_MAD.gif (284 KB, 500x800) Image search: [Google]
20000_MAD.gif
284 KB, 500x800
>>53042344
Single quoted and double quoted strings are interpreted by the compiler you fucking retard.
>>
>>53054820
Interpreted differently*
>>
Tabs
Depends on the language
Depends on the language
Same line {
>>
tabs
single
variableName
same line {
>>
>>53042344
>tabs or spaces
Both
>single or double quoted string
Double
>variableName or variable_name
First
>same line { or new line {
Same
>>
Tabs
Double (depends on usage though)
variableName
Newline {
>>
>>53042344
>>tabs or spaces
Single tab followed by single space.
>>single or double quoted string
Triple.
>>variableName or variable_name
v_A_R_I_A_B_L_En_A_M_E_
>>same line { or new line {
Entire program on one line, tab-and-space between.
>>
>>53053826
>Tabs, Why spend more time typing?
Confirmed for Notepad user.
>>
Tabs
Double quoted
variableName, VARIABLE_NAME for constants
Same line {
>>
>>53042344
>tabs or spaces
Spaces usually, but I don't care most of the time.
ALWAYS spaces if whitespace is significant.
>single or double quoted string
Double.
>variableName or variable_name
I prefer camelCase, but I follow the standards of the language.
>same line { or new line {
New line for functions, same line for everything else.
>>
This kind of threads sucks cause no ones gonna (you) me. I won't waste my time lol
>>
>>53056023
>>
>>53042344
spaces
double
variableName
new line for most things, easier to read and follow
>>
tabs converted to spaces
double
variable_name
same line
>>
>>53042344
>tabs or spaces
tabs converted to 2 (or 4 in python) spaces
>single or double quoted string
double quotes
>>variableName or variable_name
depends on the language; usually variableName
>>same line { or new line {
same_line {
different line;
}
>>
>tabs or spaces
Same thing back when I come from so I don't give a fuck
>single or double quoted string
Real languages uses double quotes.
>variableName or variable_name
variable_name
>same line { or new line {
They belong on their own line, lined up with each other so you can see where a fucking block begins and ends. Holy fuck how does no one understand this. Basic goddamn formatting, children.
>>
Tabs
Double
camelCase
New line
{
>>
>>53042344

>tabs or spaces
Spaces
>single or double quoted string
Double Quote
>variableName or variable_name
variableName
>same line { or new line {
1TBS
>>
/g/ sucks now
>>
Tabs
Double
camelCase
Like{
This
}
>>
>>53042523
My nigga.
I bet youve got some clean ass code.
>>
>>53042344
depends on the language
depends on the language
depends on the language
depends on the language
>>
>>53060358
[Code] string fag = "/g/ sucks now"
>>
>>53046458
>My .vimrc converts all tabs into spaces
Enjoy your useless extra bytes?
Thread replies: 158
Thread images: 4

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

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.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.