grumpygamer, (edited )
@grumpygamer@mastodon.gamedev.place avatar

ok, now the most important part of game dev: variable naming.

gamedevpodcast,

@grumpygamer Kebab case! start-screen

skybert,
@skybert@emacs.ch avatar

@grumpygamer without knowing the programing language, it's an impossible question.

In Python, say, I'm all for snake case, but wouldn't dream of anything but camelcase when writing Java code.

SonnyBonds,
@SonnyBonds@mastodon.gamedev.place avatar

@grumpygamer I've always been a startScreen since the 90s, but I'm just now starting to become a start_screen because it's superior for macros, generating code etc.

"the_thing" can easily become "get_the_thing" while "theThing" requires case switching to become "getTheThing".

demiurg,
@demiurg@fosstodon.org avatar

@grumpygamer Please, we all have read and inhaled PEP 8 🧐

https://peps.python.org/pep-0008/#function-and-variable-names

luftlesen,
@luftlesen@mstdn.jp avatar

@grumpygamer
😄missed it but I'm am in the winning team😁🥇

Mpwg,
@Mpwg@hachyderm.io avatar

@grumpygamer SCREEN_START
_strtscrn
?

haifisch,
@haifisch@nso.group avatar

@grumpygamer imho depends on the language and usage. if its C# I'd probably opt to capitalize as 'StartScreen' but generally only when its a public variable. If it's locally scoped in a method, tbh, dealers choice.

I do like swapping between the two to help imply scoping for readability though.

ids1024,
@ids1024@fosstodon.org avatar

@grumpygamer Rewrite in Lisp and call it start-screen.

Nekoplanet,
@Nekoplanet@paquita.masto.host avatar

@grumpygamer
> sTaRtScReEn
or
>stArtscrEEn
or if you want to be truly chaotic
>sTaRtScReeN

Decad3nce,
@Decad3nce@mastodon.social avatar

@grumpygamer why not SpongeBob casing.

SCrEeN_stARt

vggonz,
@vggonz@mastodon.denibol.com avatar

@grumpygamer it depends on the language. startScreen for OO, start_screen for imperative like C. And startscreen for code terrorists with no self respect like JavaScript.

neatchee,
@neatchee@urusai.social avatar

@grumpygamer entirely depends on what you're naming.

Internal? _fooBar
Public? FooBar
Class name? foo_bar
Function? fooBar()

Allowing at-a-glance groking of type is super valuable

AdeptVeritatis,
@AdeptVeritatis@social.tchncs.de avatar

@grumpygamer

As I use Rust at the moment:

snake_case for variables.
CamelCase for other keywords like enums or structs.

stephann,
@stephann@mastodon.gamedev.place avatar

@grumpygamer
java/javascript: startScreen
c#: StartScreen
lua/ruby/gdscript: start_screen
never: startscreen

samir,
@samir@functional.computer avatar

@grumpygamer I voted snake_case but I vote harder for whatever the established convention is for your chosen language.

Aedius,
@Aedius@lavraievie.social avatar

@grumpygamer START_SCREEN

Tearcell,
@Tearcell@mastodon.gamedev.place avatar

@grumpygamer I see you've chosen war today.

Tijn,
@Tijn@dosgame.club avatar

@grumpygamer what about screen_start so you can have other screen_ ones for different screens

simeon,
@simeon@indiehackers.social avatar

@Tijn I want start_screen when writing code and screen_start when reading. Help!

Angelux,

@grumpygamer Underscore_every_time

blazeward7,
@blazeward7@mastodon.social avatar

@grumpygamer

Start_Screen.

grumpygamer,
@grumpygamer@mastodon.gamedev.place avatar

@blazeward7 Trouble maker!

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • Durango
  • magazineikmin
  • mdbf
  • thenastyranch
  • khanakhh
  • rosin
  • Youngstown
  • ethstaker
  • slotface
  • modclub
  • kavyap
  • DreamBathrooms
  • everett
  • ngwrru68w68
  • JUstTest
  • InstantRegret
  • tacticalgear
  • GTA5RPClips
  • cubers
  • normalnudes
  • osvaldo12
  • tester
  • anitta
  • cisconetworking
  • megavids
  • Leos
  • provamag3
  • lostlight
  • All magazines