Jump to content


Photo

YoYo() function names.


  • Please log in to reply
21 replies to this topic

#1 Desert Dog

Desert Dog

    GMC Member

  • Global Moderators
  • 6409 posts
  • Version:Unknown

Posted 09 January 2012 - 11:21 PM

Hey, haven't seen a topic about this, so thought I'd start one and gripe a bit. Best to grouch once, and then get over it. ;)

In the new GM-html5, we see some new functions, e.g.

YoYo_AddVirtualKey
YoYo_DeleteVirtualKey
YoYo_GetTimer
YoYo_HideVirtualKey
YoYo_OpenURL
YoYo_ShowVirtualKey

For me, these are weirdly named.

-1 YoYo has nothing to do with the function. It's just an extra word. No-biggie, however...

-2 Odd capitalization. GML has ALWAYS only used lower-case letters. E.g. instance_position() place_meeting() ini_open() etc etc.
These functions not only have capital letters, but it's a mix. Capital letters+lower case.

-3, and breaking the gml convention of using _ as a space between words, we now have no space (words distinguised with new word starting with capital letters)

I just don't really like it. I'm not opposed to this 'style', in fact it's quite nice, but I just dislike the mixing of the two.
I guess it's too late to do anything about it now, and when GM9/studio comes, we'll continue to see these functions, and no doubt, a few more to come.

yoyo_show_virtual_key()
yoyo_open_url()

show_virtual_key();
open_url();

YoYo_InstancePosition();
InstancePosition();

YoYo_open_url();

I dunno, what do you guys&gals think?
  • 3

#2 Nocturne

Nocturne

    Nocturne Games

  • Administrators
  • 16794 posts
  • Version:GM:Studio

Posted 09 January 2012 - 11:28 PM

I hate them and couldn't agree more... These function names seem to imply that they are created by a third party company, which is absurd as Yoyo is who makes GM, and just seem superfluous. Change 'em for GM9 PLEASE!
  • 3

#3 OMGCarlos

OMGCarlos

    GMC Member

  • GMC Member
  • 329 posts
  • Version:GM:HTML5

Posted 10 January 2012 - 01:40 AM

I agree, it seems way too out of place. Not only that, but typing "YoYo_" slows me down a lot. Try it...
  • 3

#4 Mr. RPG

Mr. RPG

    GMC's Forum Troll

  • GMC Member
  • 2673 posts
  • Version:GM:Studio

Posted 10 January 2012 - 01:44 AM

YoYo Games' biggest problem is not understanding the convenience for their customers.

Their lackluster unfinished website, their customer support, etc.
  • 4

#5 makerofthegames

makerofthegames

    TV's busboy

  • GMC Member
  • 7308 posts
  • Version:GM:Studio

Posted 10 January 2012 - 01:58 AM

RPG this topic isn't a pulpit to bash YoYoGames.
  • 1

#6 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • Global Moderators
  • 14390 posts
  • Version:GM:Studio

Posted 10 January 2012 - 02:42 AM

They probably wanted to illustrate the fact those are only used for html5 or the feature was experimental... maybe the prefix needs a little revamp now.
  • 0

#7 Desert Dog

Desert Dog

    GMC Member

  • Global Moderators
  • 6409 posts
  • Version:Unknown

Posted 10 January 2012 - 04:07 AM

They probably wanted to illustrate the fact those are only used for html5 or the feature was experimental... maybe the prefix needs a little revamp now.


Well, they are used in the designing iPhone game PDF by mark here. I think it's safe to assume it's that naming convention is here to stay. Or not.

Edited by Desert Dog, 11 January 2012 - 04:15 AM.

  • 0

#8 NakedPaulToast

NakedPaulToast

    GM Studio/Mac/Win

  • GMC Member
  • 7198 posts
  • Version:GM:Studio

Posted 10 January 2012 - 04:11 AM

These functions were created during the YYGs only publishing era.

Recall about a year ago, YYGs was not going to release Studio like publishing to the general public, but select games to publish with selected developers. To do this they would use the YoYoGames_extension, where all the YoYo_* functions are place holders on the Windows version of GameMaker, but had functionality internally to YYGs with their export tools.

To differentiate and prevent duplicate function name issues, all the internal YYGs function that enhanced mobile publishing, they preceded all their internal functions with YoYo_*. Now that YYGs has changed their position on co-publishing and decided to release Studio (and HTML5), these YoYo* functions no longer make sense.

It made sense in their earlier business plan, now it doesn't.

What they should do; is Alias all the YoYo_* functions to more suitable names, deprecate the YoYo_* functions for backwards compatibility and then eventually remove them.
  • 3

#9 Gamer3D

Gamer3D

    Human* me = this;

  • GMC Member
  • 1589 posts
  • Version:GM8.1

Posted 10 January 2012 - 06:31 AM

What they should do; is Alias all the YoYo_* functions to more suitable names, deprecate the YoYo_* functions for backwards compatibility and then eventually remove them.

Assuming the extension system remains (and assuming that they allow default extensions), this could be accomplished by creating a default extension accessing the old YoYo_* functions using gml.

Also, in response to your signature "Can you forgive the pig-headed old fool for having no eyes to see with, no ears to hear with, all these years.": Yes, I can forgive Helen Keller.
  • 0

#10 NAL

NAL

    凸ʕಠᴥಠʔ凸

  • YoYo Games Staff
  • 686 posts
  • Version:GM:Studio

Posted 10 January 2012 - 09:57 AM

As a temporary solution, if you're not a fan of using the current function names, you could quickly create a bunch of scripts, for example:

Script name: show_virtual_key
Content: YoYo_ShowVirtualKey(argument0)

Then you could just do stuff like show_virtual_key(global.keyleft).

It's not ideal (it doesn't show the arguments required in the tooltip, for instance), and I agree the names are out of place - for the reason NPT mentioned - but this is a relatively quick workaround, and you can export the scripts so for other games, a few seconds to import them is all that's necessary.

Edited by NAL, 10 January 2012 - 09:57 AM.

  • 0

#11

  • Guests

Posted 10 January 2012 - 11:51 AM

It's actually pretty much like @NakedPaulToast said. Back when we started, and before we started to actually change GameMaker itself, we needed a stack of extensions, so these were added, and because they were actually contained IN an extension, they were named in a way to associate them with - effectively - an external product. i.e. it was a YoYoExtension.dll, and so the functions were pre-fixed for ease of finding.

Since then... many (but not all) have been incorporated into GameMaker itself, but we required the backwards compatibility of them (for a few reasons), so the name stuck.

If we have time (something we're pretty short of at the moment) we may well add aliases for them, and going forward (GM9 etc.) we certainly won't be using the prefix, and although I would personally like to be able to use a different syntax (I prefer the HelloWorld() format), I doubt this will happen.

#12 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • Global Moderators
  • 14390 posts
  • Version:GM:Studio

Posted 10 January 2012 - 06:45 PM

If we have time (something we're pretty short of at the moment) we may well add aliases for them, and going forward (GM9 etc.) we certainly won't be using the prefix, and although I would personally like to be able to use a different syntax (I prefer the HelloWorld() format), I doubt this will happen.


Another fellow that hates the underscore. Join the club. I used to LOVE CamelCase, but now I realize it's a question of habit and using GM slowly converted me.
  • 0

#13 NakedPaulToast

NakedPaulToast

    GM Studio/Mac/Win

  • GMC Member
  • 7198 posts
  • Version:GM:Studio

Posted 10 January 2012 - 07:02 PM

i_cant_stand_camelcase_and_much_prefer_underscores();
  • 0

#14 GStick

GStick

    All Secrets Exposed

  • GMC Member
  • 1575 posts
  • Version:GM:Studio

Posted 10 January 2012 - 07:07 PM

I like them both, as long as they aren't mixed and matched. ThisIsOkay withThis AND_THIS.

But those shouldn't go with names_like_this (except AND_THIS).

The worst culprit of this mix and match was a professor I had who Liked_To_Name_Everything_Like_This. Everything. Variables_Were_Named_Like_This. Methods_Were_Named_Like_This.

To boot, he often mixed that with random hungarian notation, vrn_Like_This.

Edited by GStick, 10 January 2012 - 07:08 PM.

  • 0

#15 Nocturne

Nocturne

    Nocturne Games

  • Administrators
  • 16794 posts
  • Version:GM:Studio

Posted 10 January 2012 - 07:21 PM

I like them both, as long as they aren't mixed and matched. ThisIsOkay withThis AND_THIS.

But those shouldn't go with names_like_this (except AND_THIS).

The worst culprit of this mix and match was a professor I had who Liked_To_Name_Everything_Like_This. Everything. Variables_Were_Named_Like_This. Methods_Were_Named_Like_This.

To boot, he often mixed that with random hungarian notation, vrn_Like_This.


Lol! Personally I don't care which method is used, as long as it's consistent...

Which GML is NOT and I'd love to see things changed to make functions coherent, consistent and logical so that we have things like, for example, draw_mp_grid (and not mp_grid_draw! Why is it the reverse of ALL OTHER draw functions?). If we are going to break backwards compatability in GM9 then lets do the job completely and not just halfway!!!
  • 1

#16 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • Global Moderators
  • 14390 posts
  • Version:GM:Studio

Posted 10 January 2012 - 08:32 PM

we have things like, for example, draw_mp_grid (and not mp_grid_draw! Why is it the reverse of ALL OTHER draw functions?).


LOL, yeah, same here, it gets me every time

function_type() vs type_function()

I used to like MS FunctionType() CamelCase (But I did know all the APIs back then) but now I do agree that the type the action/Function is performed on should prefix the feature. At least that way you can see, in the auto-fill, what actions can be done on the data type
  • 0

#17 YellowAfterlife

YellowAfterlife

    GMC Member

  • Global Moderators
  • 3493 posts
  • Version:GM:Studio

Posted 10 January 2012 - 09:24 PM

type_function() notation makes sense for languages that have IDE with auto-complete support in code editor (GameMaker is one) - when you start typing <type_>, you get list of functions that belong to type. It is a lot more likely that you'll want to find function for specified type, than type for specified function.

For naming overall, personally I prefer function_name() or functionName() (first lowercase, all subsequent first letters of words uppercase) - these appear to provide least troubles while typing them.
I do not have anything against people that capitalize first name of identifier as well, but that appears to increase overall number of possible errors you can do accidentally (esp. in languages where case matters - varName and VarName are different variables, and might take some time to figure out source if language supports automatic initialization of these).

Opinion.
  • 1

#18 Desert Dog

Desert Dog

    GMC Member

  • Global Moderators
  • 6409 posts
  • Version:Unknown

Posted 10 January 2012 - 09:33 PM

@NPT&Mike: Cool, cheers, thanks for clearing that up for me.
  • 0

#19 Mr. RPG

Mr. RPG

    GMC's Forum Troll

  • GMC Member
  • 2673 posts
  • Version:GM:Studio

Posted 10 January 2012 - 11:11 PM

RPG this topic isn't a pulpit to bash YoYoGames.


I am sorry, but I paid for Game Maker in the past and it had reverted back to Lite. When this happened, Softwrap nor YoYoGames would even contact me back when I had emailed them the issue. That is just poor customer service.
  • 0

#20 Desert Dog

Desert Dog

    GMC Member

  • Global Moderators
  • 6409 posts
  • Version:Unknown

Posted 11 January 2012 - 12:29 AM

I am sorry, but I paid for Game Maker in the past and it had reverted back to Lite. When this happened, Softwrap nor YoYoGames would even contact me back when I had emailed them the issue. That is just poor customer service.

This is a topic about the naming conventions of some new GM functions.

Many of us have had our own issues with softwrap. There have been topics about it. Rants about it, polls about it, and ofc the pinned topic. For most of us it's a thing of the past. We don't need to hear about some personal grievance yet again in an unrelated topic, okay?
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users