Coding Styles

How, what and why to code in BYOND.
Post Reply
User avatar
Dax Dupont
In-Game Admin
Joined: Sun Apr 20, 2014 9:07 pm
Byond Username: DaxYeen
Github Username: DaxDupont
Location: Belgium

Coding Styles

Post by Dax Dupont » #401982

We don't have much of a coding style definition, especially when it comes to naming things.

I generally use whatever the current file is using but I would suggest implementing a coding style that makes variables and functions as ONE of these:
1. clown_has_aids
2. clownHasAids
3. ClownHasAids
Depending on which the maintainers want to adopt, it's just kind annoying to see SpinAnimation() and change_number_of_hands exist at the same time and for new code we can nip it in the bud.
This wouldn't be an overnight change.
Last edited by Dax Dupont on Sat Apr 21, 2018 12:57 pm, edited 1 time in total.
User avatar
Saegrimr
Joined: Thu Jul 24, 2014 4:39 pm
Byond Username: Saegrimr

Re: Coding Styles

Post by Saegrimr » #401984

Just wait until you get all 3 of the above ClownHasAids variations doing different things.
tedward1337 wrote:Sae is like the racist grandad who everyone laughs at for being racist, but deep down we all know he's right.
User avatar
Dax Dupont
In-Game Admin
Joined: Sun Apr 20, 2014 9:07 pm
Byond Username: DaxYeen
Github Username: DaxDupont
Location: Belgium

Re: Coding Styles

Post by Dax Dupont » #401985

Saegrimr wrote:Just wait until you get all 3 of the above ClownHasAids variations doing different things.
The idea is to pick one of those styles, not all three as is the current situation to prevent this and other annoyances.
somerandomguy
Joined: Sun Nov 05, 2017 7:41 pm
Byond Username: Astatineguy12

Re: Coding Styles

Post by somerandomguy » #402008

Dax Dupont wrote:
Saegrimr wrote:Just wait until you get all 3 of the above ClownHasAids variations doing different things.
The idea is to pick one of those styles, not all three as is the current situation to prevent this and other annoyances.
--The joke->



Your head
User avatar
Cobby
Code Maintainer
Joined: Sat Apr 19, 2014 7:19 pm
Byond Username: ExcessiveUseOfCobby
Github Username: ExcessiveUseOfCobblestone

Re: Coding Styles

Post by Cobby » #402053

Usually I just go with

procs: CapsPerWord

var: nocapsperword

I don't think it's worth the bikeshed and arguing about which style is superior to ever enforce though.
Voted best trap in /tg/ 2014-current
Selea
Joined: Sat Nov 11, 2017 11:11 am
Byond Username: Serpentarium

Re: Coding Styles

Post by Selea » #402106

ClOwNhAsAiDs--var for loop iterator.
Image
User avatar
XDTM
Github User
Joined: Fri Mar 04, 2016 8:38 pm
Byond Username: XDTM
Github Username: XDTM
Location: XDTM

Re: Coding Styles

Post by XDTM » #402283

The most common i've seen is name_of_thing for both procs and vars.
a.k.a. Duke Hayka

Coder of golems, virology, hallucinations, traumas, nanites, and a bunch of miscellaneous stuff.
User avatar
Armhulen
Global Moderator
Joined: Thu Apr 28, 2016 4:30 pm
Byond Username: Armhulenn
Github Username: bazelart
Location: The Grand Tournament

Re: Coding Styles

Post by Armhulen » #402314

>More than one worded vars

Hey man. Stop that.
User avatar
Dax Dupont
In-Game Admin
Joined: Sun Apr 20, 2014 9:07 pm
Byond Username: DaxYeen
Github Username: DaxDupont
Location: Belgium

Re: Coding Styles

Post by Dax Dupont » #402378

Armhulen wrote:>More than one worded vars

Hey man. Stop that.

Code: Select all

	var/you_die_in_the_game_you_die_for_real = FALSE
User avatar
kevinz000
Joined: Fri Nov 14, 2014 8:41 am
Byond Username: Kevinz000
Github Username: kevinz000
Location: Dorm Room 3

Re: Coding Styles

Post by kevinz000 » #407760

i normally do_things_like_this which tendsToAnnoyOthers andThenIForgotWhichStyle I'm_using_so_I RandomlySwitchTheThree becauseIAmJustThisWay
that being said i normally try_to_do_it_like_this if i don't forget.
Post Reply

Who is online

Users browsing this forum: No registered users