Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: C++ (And others too) aliases for functions  (Read 32105 times)

0 Members and 1 Guest are viewing this topic.

NeWsOfTzzz

  • Newbie
  • *
  • Posts: 15
    • View Profile
C++ (And others too) aliases for functions
« on: August 20, 2008, 02:36:08 pm »
The standard is to write methods with a lower-case letter, so could you make aliases for functions to have them as lower-case version too?

So for example

sf::String::GetText you make an alias sf::String::getText in the c++ version. This won't hurt anybody but will surely help your libraries in spreading!

PS: You need any help in coding? Your library is exactly what I always wanted :p

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
C++ (And others too) aliases for functions
« Reply #1 on: August 20, 2008, 03:19:30 pm »
Quote
The standard is to write methods with a lower-case letter, so could you make aliases for functions to have them as lower-case version too?

No :)
And please, don't start a troll about naming conventions, it already happened a few weeks ago and it brought nothing good.

Quote
PS: You need any help in coding?

I always need help to port SFML to new languages or systems ;)
Laurent Gomila - SFML developer

NeWsOfTzzz

  • Newbie
  • *
  • Posts: 15
    • View Profile
C++ (And others too) aliases for functions
« Reply #2 on: August 20, 2008, 03:22:15 pm »
Quote from: "Laurent"
Quote
The standard is to write methods with a lower-case letter, so could you make aliases for functions to have them as lower-case version too?

No :)
Could I make them and you implement them?

Quote
PS: You need any help in coding?

I always need help to port SFML to new languages or systems ;)
I don't need anything but Windows/Linux and C++ so it wouldn't be in my interest!

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
C++ (And others too) aliases for functions
« Reply #3 on: August 20, 2008, 03:23:39 pm »
Hey, you're too fast ;)

Quote
Could I make them and you implement them?

No.

Quote
I don't need anything but Windows/Linux and C++ so it wouldn't be in my interest!

Okay, no problem.
Laurent Gomila - SFML developer

NeWsOfTzzz

  • Newbie
  • *
  • Posts: 15
    • View Profile
C++ (And others too) aliases for functions
« Reply #4 on: August 20, 2008, 03:26:46 pm »
Quote from: "Laurent"
Quote
Could I make them and you implement them?

No.

And why exactly? It'd be only an alias and people could choose if they want to use the uppercase or lowercase version and those aliases don't add any extra space in the executable, because the compiler handles them as the same function!

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
C++ (And others too) aliases for functions
« Reply #5 on: August 20, 2008, 03:34:49 pm »
Have you ever seen a library doing so, just to implement every possible naming convention and make everyone happy ?

Have you thought about the horrible mess it would produce, in the code, in the documentation and in the beginners' minds ?
Laurent Gomila - SFML developer

Daazku

  • Hero Member
  • *****
  • Posts: 896
    • View Profile
C++ (And others too) aliases for functions
« Reply #6 on: August 20, 2008, 04:34:46 pm »
I hate the fact that the sfml use an uppcase letter in begin of a function  but we it's Laurent choice... But we can't change the library itself just because of that...
Pensez à mettre le tag [Résolu] une fois la réponse à votre question trouvée.
Remember to add the tag [Solved] when you got an answer to your question.

quasius

  • Full Member
  • ***
  • Posts: 166
    • View Profile
C++ (And others too) aliases for functions
« Reply #7 on: August 21, 2008, 07:05:21 am »
I couldn't care less and I don't understand why this topic keeps coming up.  Every library has a unique naming convention.  A logical consistency throughout that naming convention is far more important than conforming to every other pre-existing naming convention.  This is fortunate since the latter is impossible.

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
C++ (And others too) aliases for functions
« Reply #8 on: August 22, 2008, 04:20:11 pm »
The current SFML naming convention pleases me. In my own code, I use exactly the same system. I hope you'll keep it forever, Laurent ;)

BTW: Those who want standard naming convention shall write a header with hundreds of #defines :D
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

Daazku

  • Hero Member
  • *****
  • Posts: 896
    • View Profile
C++ (And others too) aliases for functions
« Reply #9 on: August 22, 2008, 04:41:51 pm »
Personally i hate it because that not how i learned to name my function/variable and that not like the "official" convention but what can i do... nothing because its too long to change the name of all function, it's useless because all the current code builded with the current version use the current convention and if we change it some people will say: I don't like the convension! Plz change it!  :lol:
Pensez à mettre le tag [Résolu] une fois la réponse à votre question trouvée.
Remember to add the tag [Solved] when you got an answer to your question.

quasius

  • Full Member
  • ***
  • Posts: 166
    • View Profile
C++ (And others too) aliases for functions
« Reply #10 on: August 22, 2008, 04:47:38 pm »
The point is, there's no "standard convention."  You could get several different answers from different professional coders.  It's not like Laurent decided to make up his own standard because he's such a maverick and he wanted to confuse his users.

Avency

  • Full Member
  • ***
  • Posts: 113
    • View Profile
C++ (And others too) aliases for functions
« Reply #11 on: August 22, 2008, 05:26:48 pm »
Besides, SFML isn't the only library that uses this naming convention.

Daazku

  • Hero Member
  • *****
  • Posts: 896
    • View Profile
C++ (And others too) aliases for functions
« Reply #12 on: August 22, 2008, 06:51:10 pm »
Quote from: "quasius"
The point is, there's no "standard convention."


False. But ANYWAY i don't care. Like i said it before: WE need to follow the sfml convention!
Pensez à mettre le tag [Résolu] une fois la réponse à votre question trouvée.
Remember to add the tag [Solved] when you got an answer to your question.

pamaury

  • Newbie
  • *
  • Posts: 31
    • View Profile
C++ (And others too) aliases for functions
« Reply #13 on: August 23, 2008, 10:56:32 am »
How could you say there is a standard convention ? This is absolutely false, just look at a few libraries and you will see it. Even in the industry, there isn't one.
Furthemore, it's only a matter of style, you can't say "this one is standard" just because the first lettre is lowercase instead of uppercase, this is stupid!

A believe a more intelligent proposition would be to follow the standard of each language(I mean the one use the standard library), for example C++ uses "foo_bar", C# uses "FooBar", Java uses "fooBar" ...

heishe

  • Full Member
  • ***
  • Posts: 121
    • View Profile
C++ (And others too) aliases for functions
« Reply #14 on: August 25, 2008, 09:24:46 pm »
Quote from: "Daazku"
Quote from: "quasius"
The point is, there's no "standard convention."


False.


false.

 

anything