Discussion Worst of your bad GML coding habits?

K

Kuro

Guest
What's the worst sin you knowingly commit while coding in GML?
Do you enjoy the transgression or is it something you wished you could stop?
My own worst sin, that I know of, would be a sparseness of comments.
I clearly hate my future self. But I do get a lot of joy from not writing comments.
 
Last edited by a moderator:
Q

Quailfail

Guest
I'd say everything. If I narrowed it down though, misspelling and magical invisible extra spaces should cover all the hate I have for myself.
 
W

Wraithious

Guest
I never ever use == in gml, I do in java and c but never in gml. Ever. Never. Haha
 
W

Wraithious

Guest
I'd say everything. If I narrowed it down though, misspelling and magical invisible extra spaces should cover all the hate I have for myself.
Yep and looking for that 1 missing semicolon in a large script haha
 
K

Kuro

Guest
Yep and looking for that 1 missing semicolon in a large script haha
I know, right? Or when you can't work out why YYC keeps crashing and after like 20 attempts to find what's wrong it turns out you had a comment with a stray quotation mark in it.
 
G

Guest User

Guest
eh, i don't use a proper curly bracket method, cram all my math into one line, and make scripts for like every little thing
Code:
/// string_center(string);
return (game.width div 2) - (string_length(string(argument0)) div 2);
Code:
/// check_range(range, object);
if(check_player()) {
    if(distance_to_object(argument1) < argument0) { return true; }
    else { return false; } }
else { return false; }
nor are there any comments past the initial '///' thing, but i've never needed them
 
L

LSGDƎV

Guest
I guess for me, it's not labelling things in GameMaker Studio 2 with the ///@description tag, and combing GML with DnD.

*stutters* Ugh, don't mix GML and DnD together... *even more stuttering*
 
B

Blazing

Guest
I never comment enough, if at all, on my code so I have to spend 20 minutes unraveling the massive script I wrote 3 months ago when I have to revise it to accommodate some new code.

Also naming a variable one thing when I declare it, but naming it something very similar but not identical when I put in action across multiple events. Then I have to go sifting through all the code to straighten out the naming chaos, which can involve up to three names for the same thing...

Also "argrmnt1" looks exactly like "argument1" to my slightly dyslexic eye, which can cause lots of chaos when I c/p the misspelled one in a big script. I was freaking out the last time that happened. "What do you mean argrmnt1 is undefined! I defined the stinkin thing in script_execute()!"
 
K

Kuro

Guest
Also "argrmnt1" looks exactly like "argument1" to my slightly dyslexic eye, which can cause lots of chaos when I c/p the misspelled one in a big script. I was freaking out the last time that happened. "What do you mean argrmnt1 is undefined! I defined the stinkin thing in script_execute()!"
That's what's known in the trade as having an argrmnt with the YYC. *boom tish*
 
U

Ungrateful Dead

Guest
Its definitely not commenting enough. In the moment I'll think, oh I'll recognize this is what this is for when I come back later its simple enough and...
Yeah no. I never do. Ever.
 

onjai_x3

Member
Not commenting, and then later completely forgetting what that code does. And also using DnD when I don't feel like coding.
 
The comments are a problem for me too.

The biggest thing though is not thinking through how my system should work and then having different parts of the new piece of code in 4 or 5 different locations and events, instead of in one or two nice controlled step/draw events or something.
 
S

Storyteller

Guest
not practicing enough.
Ive probably forgotten more GML than I will ever use.
gotta stay sharp or you get rusty.
 
K

Kuro

Guest
not practicing enough.
Ive probably forgotten more GML than I will ever use.
gotta stay sharp or you get rusty.
Yeh I know exactly what you mean. I've been learning Javascript these past couple of weeks, and I can feel my GML getting rustier with each passing day :eek:
 
G

Guest User

Guest
Yeh I know exactly what you mean. I've been learning Javascript these past couple of weeks, and I can feel my GML getting rustier with each passing day :eek:
!! i keep trying to declare local variables with 'var' in my Java and types like 'bool', 'int', 'double' in my GML. so many silly little errors. :(
 
A

Alex Lyons

Guest
Forgetting to initialize variables and forgetting to assign instance existence conditions for objects that are frequently deactivated/destroyed.
 
S

Snayff

Guest
My worst habit is over obsessing how things are named and organized.
Preach, my sinful brother in code! I don't even know how to write in GML yet and I still spend ages faffing with the naming conventions. And I change my mind all the time about which is best...
 
D

DaMuffin

Guest
Not commenting enough is definitely one of mine. Also being indecisive on if my switch statements will have curly brackets in them.
My worst habit is over obsessing how things are named and organized.
^So, so, sooooooooo much this! I have spent 30+ minutes fighting myself over this and then completely forgetting what it was that I was going to work on.
 
Step 1) Rapidly hack together some cool new feature for testing ( because its generally easy to get something up and running in GMS without much effort).

Step 2) Get distracted by *another* cool feature and therefore...Goto Step (1)

...

Step 42) Look at spaghetti code of the all the new features and despair at how hard it is going to be to [modify / integrate / change / make them production ready ]

Step 43) Give up on Step (42) and go to Step (2)
 
Top