[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 do you prefer?

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: 133
Thread images: 8

File: dashesunderscorescamel.png (5KB, 570x200px) Image search: [Google]
dashesunderscorescamel.png
5KB, 570x200px
Which do you prefer?
>>
CamelCase because C# standards
>>
>>57644564
That's PascalCase. This is camelCase.
>>
>>57644552
Underscores because it avoids any problems with acronyms
>>
>>57644552
Sometimes underscores, sometimes camel case.
But never mixed.
>>
>>57644552
None. All lower case
>>
>>57644564
Yea that's what I actually typed, on my way to work so using my phone. Capitalises the first letter my default, my bad for not checking
>>
>dashes
lol what the fuck?
>>
I hate camel case

alllowercaseallthetime
>>
>>57644624
I really only see it in scripting
>>
Depends

dashes-for-executables
>>
Snake case for variables.
Camelcase for functions.
Pascalcase for classes.
Leading underscore for private variables.

But if I had to pick one, snake case all the way.
>>
>>57644552
under or camel

dashes are for madmen
>>
>>57644615
that's completely mental!
>>57644632
just anarchy!
>>
>>57644552
I use camelCase at work with obj-c and swift
I use PascalCase at home in C#/F#
I use underscores at home in C.
>>
gas_all_camelfags
unfortunately more recently I've been stuck with PURGE_THOSE_WITH_MIXED_CAPITALIZATION
c# is the only exception and c# is actually shit so I don't care
>>
>>57644640
seriously? where the hell is this permitted? how do you do arithmetic operations if you can use dashes? do you need to separate terms with spaces?
>>
>>57644820
since when are you naming your variables starting with numbers?
>>
>>57644820
The only language I know of that lets you is Lisp.
>>
I'm a C programmer so it's all underscores all the time for me
>>
>>57644820
Html/css uses dashes
>>
>>57644953
Neither has arithmetic
>>
>>57645042
Css has calc. Not in the ids and classes though.
>>
It depends on what I'm doing.
>>
m_Var
Or
VariableName
>>
>>57644847
sometimes my variables are numeric and i want to subtract one variable from another, dumdum
>>57644953
see >>57645042
as for calc, the mozilla docs lay out that you must use whitespace to separate terms. also, does CSS let you use terms in this way? you might reference classes or id's but they'd never represent a numeric (or otherwise subtractable). i pretty clearly remember CSS not letting you assign variable names (it's been a while since i've done web dev stuff though)
>>
File: 1207460036327.gif (60KB, 511x494px) Image search: [Google]
1207460036327.gif
60KB, 511x494px
Actually the inline camel_Score is the best. It clearly brings efficiency in reading variable/function names and saves your eyes, using advantages from both styles.
It's just obvious, like putting the function brackets {} on separate lines.
It is not usually said out loud but true programmers just don't ask a thing about it as it's apparently native and the only possible style for us.
>>
>>57645114
Sure thing, kiddo.
>>
>>57645129
You mean, you can disprove it?
>>
>>57645114
I disagree.
function_Name() {
return;
}
>>
As a 3-star C programmer, I only write in ccase.
None of my functions or variable names are longer than 8 characters and they're all heavily truncated, like atoi, structmk, strbuf, membuf, etc.
>>
>>57645180

float theRealNumberAfterComutingSecondFunction3RdPass
>>
>>57645223
float r23
>>
>>57645101
>m_Var
Eww
>>
>>57645241
don't yuck his yum
>>
>>57645238
it works

can't throw this guy
>>
>>57645180
>None of my functions or variable names are longer than 8 characters and they're all heavily truncated, like atoi, structmk, strbuf, membuf, etc.
I can sppse your a fggt.
>>
>>57644552
I use all three.
>>
>>57644552
iprefernoneofthemtbhfam
>>
>>57644552
Dashes are the most readable.
I use them for file names.

It's just a shame you can't use them in code.
In code I use camel case.
>>
camelCase. Saves one byte per word on average
>>
>>57644564
>C#
Fuck off Pajeet.
>>
>>57645329
>I use them for file names.
use spaces you fucking retard.
>>
dashes because I am a lisper

in languages where dashes don't fly, camelCase
>>
>>57645351
cd some\ obnoxiously\ spaced\ directory\ \ \ oh\ watch\ out\ multiple\ spaces
>>
>>57644820
>how do you do arithmetic operations if you can use dashes?
With prefix notation you pleb.

Honestly C niggers should not be allowed to post on /g/ if they are this ignorant.
>>
>>57645370
lol, okay
>>
>>57644552
Underscores, which are a neutral text character that helps keep words separate. And tabs, because they're not a space. And { on a new line.

Then I work with people that aren't fucking retards, and who use their own scripts and regexpes that took them literally 2 minutes to type, to replace all underscores, tabs and { with their favorite case, spaces and block styles, so they can work with their favorite norms, and then invert everything once they're done and committing it. And each is coding in his favorite environment, some vi, some emacs, some notepad++, some eclipse, some idea... to each his own.

It's 2016, it's time you grow out of your faggotry and realize you can script your autism.
>>
>>57645367
tab completion you retard
>>
>>57645399
you could enclose it in quotation marks and avoid putting backslashes in, but tab completion inserts the backslashes and both solutions are shitty. and if you use your mouse to double click on a path, it'll never make the jump, even if there's a backslash there.

don't make paths that require escape characters unless you absolutely have to (hint: you don't)
>>
>>57645434
and before you ask a retarded question like why would use your mouse in the terminal, you can double click on a path to copy it to your clipboard, for instance.
>>
>>57645367
>2016
>opening directory
>"cd"

Holy kek.
>>
>>57645451
it's the most efficient
>>
>>57645451
windows users, everyone!
>>
>>57645463
What for? Just for opening? Well yeah
>>
File: 1362960884713.png (28KB, 499x322px) Image search: [Google]
1362960884713.png
28KB, 499x322px
>>57644552
>dashes

literally what?
>>
>>57645475
once you've navigated there, there are lots of commands you can do in a shell, windows user :)
>>
>>57645463
>>57645471
In 2016, you can type the name of the folder you want to open directly and it'll auto select it. Then if you REALLY want a terminal, define a shortcut to open a terminal on that position.

Even less keys to type, infinitely better visual feedback, exact same result.

You guys can't into HMI, that's why you praise Linux: it's not that terminals are good, only that GUI is FUCKING GARBAGE.
>>
>>57645509
>In 2016, you can type the name of the folder you want to open directly and it'll auto select it.
is your critique seriously just with the use of the `cd` command, and not with the backslash point?

are you the most autistic person on this board?
>>
>>57645509
>Even less keys to type
Fewer. Fewer keys to type.

>You guys can't into HMI,
What the hell is HMI? Do you mean HCI? User interface design? Seriously, what the fuck are you talking about?

And to your overall point, in a graphical user interface you can't drill down several levels with one command the way you can in a command line interface (as far as I know). You might have an option (as in OS X) to change your view to list view and then hold option (or something) to expand all subdirectories along with the one you expanded, but that's neither especially well known nor the same thing.
>>
>>57645488
You say 'windows user' just like implying the linux-based systems don't have a similar UI en masse, or like windows doesn't have a command shell..?
I use Debian. The thing is, you may forget the full path to your folder (in this case, you will be switching all the options with tab till it shows the correct one, or listing the directory each time); you can have some problems with foresaid folders with special characters in their names; you're just doing it really slow comparing to navigation using the average mouse, average hand and average eye movement (moreover, your brain is more adapted to search one in a pile rather than searching element by iteration).
It's a matter of habit I suppose, if you're used to type the full path each time. But modern UI is just wasy and comfort.
>>
File: SPACES.png (4KB, 90x131px)
SPACES.png
4KB, 90x131px
>>57645515
Yes. Because it's only a terminal issue. Terminals are outdated, but linuxfags just don't know anything better.

Now the autists would be the one sticking to their terminals when better solutions exist, but they couldn't recognize ergonomics even if it hit them in the face.
>>
>>57645538
>What the hell is HMI? Do you mean HCI? User interface design? Seriously, what the fuck are you talking about?
HCI is "human-computer" interface, HMI is "human-machine" interface, a broader definition.

Also you really don't know about how modern GUIs work do you? You can do all those things, and in fact, you can do things so highly practical in comparison, that what you're describing becomes pointless.
>>
>>57644552
I prefer your mom in my bed
>>
some variables with underscores, some with camel case.

mostly just to annoy my co-workers.
>>
File: dumdum.webm (2MB, 1540x948px) Image search: [Google]
dumdum.webm
2MB, 1540x948px
>>57645573
>HCI is "human-computer" interface, HMI is "human-machine" interface, a broader definition.
I study HCI and I've never heard anyone talk about "HMI". A quick google yielded the Wikipedia article on HCI "(Redirected from Human-machine interaction)". It looks more like you just literally don't know what you're talking about.

As for doing these things, can you illustrate it? Here's a webm of some of the approaches I talked about. The first approach is slow and obnoxious; the second is faster, but expands *all* directories (including branches going to other places that you don't want); the command line approach is much more direct, and gives you an easy target to copy the path if you want.
>>
>>57645794
Maybe we're not using the same Google, I have no problem with finding information about HMI. Simply, HMI is much broader and not only about computers, it's also about cars, microwave ovens, and industrial machinery. Surprised you learned about HCI but have no fucking clue what HMI is.

Also I don't really get what's bad about what you're showing, seems it's just your shortcuts not being good enough. And if you want to copy the path, in a proper file browser, you can. I have no trouble on my shitty work computer with an outdated Gnome.

And then it remains to be understood WHY you need to do this. There are thousands of ways you can do all this more efficiently, given you can explain why you need to explore folders. HMI is about exposing functions answering a need with a precise purpose in mind, not providing pointless interaction. That interaction is pointless, express a need and give it a purpose and we'll see.

Though I'm at work, I don't really have time making webums.
>>
>>57645899
>Maybe we're not using the same Google,
Can you name an HMI conference or journal? CHI is the leading conference on Human-Computer Interaction. You must have heard of it. We're in the middle of the rebuttal phase of paper reviews right now. Has a few thousand attendees every year. Was in San Jose this past year, was in Seoul the year before. Will be in Boulder next year... Is any of this ringing any bells?

Can you point to this page on HMI that must surely exist? Maybe "your Google" can find it where "mine" failed.

As for you not getting what's so bad about your way, we're talking about different things now. First you said that your way was better, and now you're moving the goal post to argue that your way isn't so bad. I'm not going to engage on this point further except to say that my way works better for some people. This is such a simple aspect of human factors that it honestly makes me wonder if you're into "HMI" or if you just made up a term that was kind of wrong and now you're committing to it.
>>
variable_name
functionName
executable-file

What do you usually name counting variables, like when you iterate over a list? I dislike i because that's ambiguous in Octave (imaginary unit). Usually use idx, or x and y if I'm going over a 2d array.
>>
>>57645992
Oh, and also
GLOBAL_VARIABLE
>>
>>57644552
camel case for scripty languages (python, JS, etc.), underscores for systems langs (C, C++, etc.)
>>
I still prefer underscores since they fit the purpose of a non-breaking space well, even though they've been "objectively" ""proven"" to be """worse""".

camelCase is also fine but PascalCase is literal cancer and kebab-case needs to be removed.
>>
File: 1478697120229.jpg (21KB, 413x395px)
1478697120229.jpg
21KB, 413x395px
>>57646008
> kebab-case needs to be removed
I see what you did there.
>>
>>57645965
>Can you name an HMI conference or journal?
I think you misunderstand what it is: it is essentially another name for the field of ergonomists. It applies to any kind of interface between a human and a machine. It's not even necessarily electronical, it can be mechanical as well. Then you have more targetted fields, such as "human computer interface", which itself goes beyond simple GUI, and also includes screens, keyboards, mice, blinking LEDs, scanners and printers.

Now here is what MY Google found:
http://www.unitronics.com/KnowledgeBase/U90Ladder/HMI/Display/What_is_an_HMI_.htm
http://machinedesign.com/iot/what-are-human-machine-interfaces-and-why-are-they-becoming-more-important
http://www.microsemi.com/applications/industrial/hmihttp://www.microsemi.com/applications/industrial/hmi
http://w3.siemens.com/mcms/automation/en/human-machine-interface/pages/default.aspx
http://www.anaheimautomation.com/manuals/forms/hmi-guide.php
https://www.techopedia.com/definition/12829/human-machine-interface-hmi
http://whatis.techtarget.com/definition/human-machine-interface-HMI
http://www.iconics.com/Home/Solutions/HMI.aspx
https://www.copadata.com/en-ro/hmi-scada-solutions/human-machine-interface-hmi/
http://www.subnet.com/resources/dictionary/human-machine-interface.aspx
http://www.advantech.com/products/human-machine-interfaces/sub_1-2mlk4r

That's just page 1. If you don't know what HMI is, I think we may as well stop right there.
>>
>>57645997

variable_name
Global_Variable
GLOBAL_CONSTANT
functionName
ClassName
>>
>>57645114
>whenDo_You_UseUnderscores
Idiot
>>
>>57646090
>If you don't know what HCI is, I think we may as well stop right there.
Well said. At best it looks like your understanding of HCI is limited to toasters and cars. I'm not sure what made you think you know anything about computers, but it's good to know that you're realizing you don't now. Delayed realization is better than none at all.
>>
>>57646127
>I'm not sure what made you think you know anything about computers
Probably an 8 year experience as a developer, and 6 as a software project manager. I didn't learn it from Wikipedia though, but from real people, that taught me about ergonomics, then its application to artificial systems as HMI, and field specific to modern personal computers as HCI.

Enjoy your terminal, I guess the name is fitting considering you can't seem to evolve past it. Try to learn how to Google at least.
>>
variable_name
CONSTANT_NAME
function_name
MethodName
TypeName
>>
Underscores because I'm not some kind of Java plebeian
>>
>>57644673
the only way
>>
>>57646200
you said earlier that HMI is about toasters and cars. HCI is much more specifically about computers. we're talking about shells and directory/file names.

stay in your lane, toaster boy.
>>
>>57646342
Seriously, I've been reading the entire discussion and you should kill yourself. HMI is about ANY KIND OF INTERFACE, and that obviously INCLUDES COMPUTERS. It was originally pioneered by the French, who called it IHM, 'Interface Homme-Machine', while designing next generation cockpits for their Mirage IV fighter planes in the 60s. There's NO WAY you can't find anything on google about HMI, nor learn about HCI without knowing what HMI or ergonomics are. No wonder you're being so fucking ignorant about 'Graphical User Interface'.
>>
>>57645340
English actually. It just pays the most where I am.
>>
>>57644552
>dashes
i thought opie was talking about URLs
>>
>>57646127
Quit being a dick, it's obvious you're wrong in this situation.
>>
>>57646738
lol ok
>>
>>57646738
My entire point was that spaces are not preferable because they introduce backslashes, which is obnoxious. I don't understand how you can come to the conclusion that one can be "wrong" about this. Through the context of HCI it's a textbook example of experts (people who prefer the command line interface) having preferences that are different from non-experts (people who don't use CLIs). This isn't a value judgment or a sweeping generalization. It's an observation that some things don't work for some people. I honestly don't even understand what you think you mean by "wrong" here.
>>
>>57646774
>>57646738
Just get a room already.
>>
ClassName
variable_or_function
>>
i use camelCase because my professor said to do it and it seems fine to me vOv

i will admit acronyms are annoying to deal w/
>>
I don't name variables/functions after sentences.
>>
>>57646875
>"I suck penis because my mom sucks penis" - You
>>
dashes
because-lisp-uses-it
>>
>>57644552
i_like_underscores_t
>>
>>57644616
How about you turn off auto capitalizing the first letter
>>
Dashes-for-filenames
camerCase or PascalCase for proggramming depending on the language
>>
>>57644564
how do you write "son_of_a_bitch"?
"SonOfABitch"?

looks ugly
single capital letters fuck it up
>>
Underscores:
Python
C
Bash

Camelcase:
Java
C#

Dashes:
Never
>>
>>57644576
That's autism.
>>
camelCase or INTENSE_SHOUTING
>>
>>57644564
>>57644576
In C#
Classes and Methods are PascalCase
Variables are camelCase
>>
>>57644552
theThirdOneToBeHonest
>>
>>57644632
fucking animal
>>
FOo_BAr

Who else /masterrace?
>>
>>57644552
I prefer underscore but because I'm lazy I usually end up with camelCase.
>>
I used to like underscores, but it looked uglier the more I used it. Looked exhausting. Like it was doing more then necessary to get the same idea across.

Now I use something like camel case or Pascal case. Never used dashes. However, I believe underscores are better if you NEED a space. Maybe not... But they seem cleaner in that sense. Like file names and such that can't have spaces. run_program.exe instead of runprogram.exe

Not sure because both work.

I might just have a mental breakdown and do everything lowercase for programming.
>>
camelCase > dashes > undescores
>>
>>57644552
lowercase letters are cuter
so everything lowercase
>>
I program in functional languages,
so I only use single lowercase letters, like x y and z.
>>
Any OOP lang:
Public variables/classes/whatever in PascalCase
private in camelCase
>>
>>57644868
That's because Lisp doesn't have operators. Everything is first class, including symbols and functions.
>>
>>57645434
Just use dired
>>
>>57645373
Underscores are word characters. They don't separate words, they join them.

foo-bar = two words
foo_bar = one word
>>
>>57644552
Underscores_And_CamelCase

because fuck you
>>
File: 1472755123697.gif (337KB, 492x376px) Image search: [Google]
1472755123697.gif
337KB, 492x376px
>>57644604
this guy
>>
Wouldn't it be much better if there was just one programming language that would work for everything?
>>
snake_case is best_case 2bf
>>
>>57644673
this man knows
>>
>>57644552

Dashes is the best, but very few languages allow it. Lisps and Agda mostly.
>>
>>57644673
>OOP
Ugh
>>
>>57644552
Camel_toe_Case obviously
>>
>>57646095
this.desu
>>
  
Global_Variable_
GLOBAL_CONST_ (suffix _ prevents confusion with regular scoped vars without 2 words)
variable_name
CONST_NAME
For functions and classes that actually do work and not just managerial code:
_parameter (for functions and classes)
public_variable. (same as standard vars)
__private_variable
_URI_REFERENCE_ADDRESS_OTHER_RESOURCES_
_temp_vars_ (counters, iterators, etc.)

functionName with no return
function_Name with return. (not needed in some languages since the return type is specified in the definition of the function)
ClassName
publicMethod. (ClassName.publicMethod)
__privateMethod
CustomVariableType

LANGUAGECOMMANDS (except languages with case-sensitivity. fgts)



Is that covering everything?

>dashes
Headbutt 71 knives.
>>
>>57644552
PascalCase, camelCase and SCREAMING_CASE masterrace.
>>
>>57644552
camelCase for variables
PascalCase for function/class names
SNAKE_CASE for preprocessor constants

gName for global variables
m_name for private member variables
>>
>>57644552
underscores > camelcase > dashes
>>
>>57646219
>
function_name
MethodName
>>
>>57644552
snake_case and ALASKAN_BULL_WORM_CASE
>>
I PREFER CAPSLOCK
>>
>>57644552
>not naming all your variables a b c.. aa ab.. ect
>>
>>57655475
I had to work on a program that was like this. A 6000+ line VB5 module without any local variables, only 200+ global variables declared at the top, and each variable had a name like that.
>>
>>57644552
dashes are the easiest to read.
Thread posts: 133
Thread images: 8


[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.