SFML community forums

General => Feature requests => Topic started by: NeWsOfTzzz on August 20, 2008, 02:36:08 pm

Title: C++ (And others too) aliases for functions
Post by: NeWsOfTzzz 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
Title: C++ (And others too) aliases for functions
Post by: Laurent 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 ;)
Title: C++ (And others too) aliases for functions
Post by: NeWsOfTzzz 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!
Title: C++ (And others too) aliases for functions
Post by: Laurent 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.
Title: C++ (And others too) aliases for functions
Post by: NeWsOfTzzz 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!
Title: C++ (And others too) aliases for functions
Post by: Laurent 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 ?
Title: C++ (And others too) aliases for functions
Post by: Daazku 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...
Title: C++ (And others too) aliases for functions
Post by: quasius 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.
Title: C++ (And others too) aliases for functions
Post by: Nexus 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
Title: C++ (And others too) aliases for functions
Post by: Daazku 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:
Title: C++ (And others too) aliases for functions
Post by: quasius 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.
Title: C++ (And others too) aliases for functions
Post by: Avency on August 22, 2008, 05:26:48 pm
Besides, SFML isn't the only library that uses this naming convention.
Title: C++ (And others too) aliases for functions
Post by: Daazku 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!
Title: C++ (And others too) aliases for functions
Post by: pamaury 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" ...
Title: C++ (And others too) aliases for functions
Post by: heishe on August 25, 2008, 09:24:46 pm
Quote from: "Daazku"
Quote from: "quasius"
The point is, there's no "standard convention."


False.


false.
Title: C++ (And others too) aliases for functions
Post by: Daazku on August 26, 2008, 12:48:37 am
Plz dont say anything when you don't know: C/C++ have standard conventions: ISO/IEC 14882:1998 && ISO/IEC 14882:2003.
Title: C++ (And others too) aliases for functions
Post by: SirJulio on August 26, 2008, 01:39:52 am
No, they don't.

The only thing which can't be used is __xxx and _(UpperCase)xxx because this is reserved for implementation (17.4.3.1.2 iso C++).
Title: C++ (And others too) aliases for functions
Post by: Daazku on August 26, 2008, 02:07:25 am
They dont say it explicitily but they always name their function in lowercase and classe with one letter to uppercase (the first one).

Anyway i'm stoping this discussion right now :D on this: C++ have a standard convention. A "Standard non official" convention says that classe must start with an uppercase letter and variable/functions must start with lowercase to have a "distinction". BUT ANYWAY the lib have his own convention and that it.
Title: C++ (And others too) aliases for functions
Post by: pamaury on August 26, 2008, 11:00:35 am
This is going nowhere so I suggest the following procedure instead of debating:
-type "C++ naming convention" in google
-read first three or four answers
-type "http://www.parashift.com/c++-faq-lite/coding-standards.html" in you URL bar
-read the entire page
I believe it shows quite easily that there is no C++ standard even a non-official one.
Title: C++ (And others too) aliases for functions
Post by: on September 02, 2008, 08:01:09 pm
I love the library but it needs to be forked because the admin is shallow minded and bull headed.
Title: C++ (And others too) aliases for functions
Post by: pamaury on September 02, 2008, 11:29:17 pm
If you want to fork juste because of a naming convention, then you are probably narrow minded.
Title: C++ (And others too) aliases for functions
Post by: Wizzard on September 03, 2008, 12:37:38 am
Quote from: "pamaury"
If you want to fork juste because of a naming convention, then you are probably narrow minded.

It's shallow-minded and bull-headed too.
Title: C++ (And others too) aliases for functions
Post by: on September 03, 2008, 02:33:11 am
Ok. I'll admit it. your turn.
Title: C++ (And others too) aliases for functions
Post by: quasius on September 03, 2008, 11:12:43 am
I'd rather continue to ignore this silly thread, but now I feel compelled to say that I'm sure 99% of the people using SFML appreciate the work Laurent et al have been doing and aren't hung up on the naming convention.
Title: C++ (And others too) aliases for functions
Post by: dewyatt on September 03, 2008, 09:14:13 pm
You shouldn't care so much about naming conventions.
What matters is that the name gives you a hint about what something does or is.
Obsessing over a naming scheme just shows that you haven't been coding very long.

I don't understand how you can insult Laurent on his own forum about his own software.
Quote

// SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007 Laurent Gomila (laurent.gom@gmail.com)
//
// This software is provided 'as-is', without any express or implied warranty.


I very much appreciate Laurent's hard work and have no problem with his naming scheme.
I've even adopted the "my" prefix in my own code (though I still maintain a lowercase first character in function names, etc).
Title: C++ (And others too) aliases for functions
Post by: bullno1 on October 06, 2008, 06:23:49 pm
Even C++ compilers are not standardized  :D . Just look at the mess in boost source code. That's what you'll get when you try to make everyone happy.

And most IDE have code completion, who cares about upper or lowercase?
Title: C++ (And others too) aliases for functions
Post by: coral on October 06, 2008, 10:11:29 pm
Epic drama?
Title: C++ (And others too) aliases for functions
Post by: Nexus on October 12, 2008, 03:24:14 pm
Quote from: "quasius"
I'd rather continue to ignore this silly thread, but now I feel compelled to say that I'm sure 99% of the people using SFML appreciate the work Laurent et al have been doing and aren't hung up on the naming convention.
Agree. Anyway, I got the impression that most of feature requests would only make less than 1% of SFML users satisfied... :roll: