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

Author Topic: New naming convention  (Read 89127 times)

0 Members and 1 Guest are viewing this topic.

JayArby

  • Jr. Member
  • **
  • Posts: 68
    • View Profile
New naming convention
« Reply #105 on: January 23, 2012, 08:29:10 pm »
Quote
That said, if you want to I will happily concede to the expression "Abominable English" for the US bastardisation of the source language.


You're just jealous of American English. ;)

minirop

  • Sr. Member
  • ****
  • Posts: 254
    • View Profile
    • http://dev.peyj.com
New naming convention
« Reply #106 on: January 23, 2012, 08:33:08 pm »
JayArby > a quote I love :
Quote
there is no such thing as 'American English'. There is English and there are mistakes.

anyway, I'm used to "Color" because everybody use it. (except Ogre3D for what I know)

Groogy

  • Hero Member
  • *****
  • Posts: 1469
    • MSN Messenger - groogy@groogy.se
    • View Profile
    • http://www.groogy.se
    • Email
New naming convention
« Reply #107 on: January 23, 2012, 09:06:58 pm »
Well for programming I use the "US Dialect" of English but when writing/talking I tend to use the normal British English. Though I don't know I'm not native to the language so might be that I actually mix them both without even knowing it.
Developer and Maker of rbSFML and Programmer at Paradox Development Studio

JayArby

  • Jr. Member
  • **
  • Posts: 68
    • View Profile
New naming convention
« Reply #108 on: January 23, 2012, 11:26:36 pm »
Quote from: "minirop"
JayArby > a quote I love :
Quote
there is no such thing as 'American English'. There is English and there are mistakes.

anyway, I'm used to "Color" because everybody use it. (except Ogre3D for what I know)


Yeah, I was using the qualifier 'American' to designate the version of English without the mistakes.

Okay, I'm just trolling now.  :lol: I actually don't care at all whether anyone prefers one dialect over the other.

Dravere

  • Newbie
  • *
  • Posts: 37
    • View Profile
New naming convention
« Reply #109 on: January 24, 2012, 11:36:50 am »
Quote from: "pdinklag"
Quote from: "Dravere"
Why is C# using PascalCase and the majority of the libraries in C# are using PascalCase? If camelCase would be that much better, they would have switched or at least the userbase would have switched.

Let me turn that around: why does the Java naming convention explicitly endorse camelCase and every Java library follows it? If it was that bad, they would have switched...

You missed my point there. I said the people are using the naming convention of the standard library. In C# the standard library is using PascalCase. In Java the standard library is using camelCase.

In most languages the people are using the naming convention of the corresponding standard library. C++ is the big exception.

Silvah

  • Guest
New naming convention
« Reply #110 on: January 24, 2012, 04:19:03 pm »
Quote from: "OniLink10"
Well, let's not start a debate here, but do you know why it's called English? Because it came from England/Britain.
It's called English, because the people among whom it emerged were called Angles, after the region they came from, namely Angeln, which lies in Schleswig-Holstein, northern Germany. It's hardly England, you know ;)

Spidyy

  • Sr. Member
  • ****
  • Posts: 493
    • View Profile
New naming convention
« Reply #111 on: January 24, 2012, 08:30:48 pm »
Quote from: "Silvah"
Quote from: "OniLink10"
Well, let's not start a debate here, but do you know why it's called English? Because it came from England/Britain.
It's called English, because the people among whom it emerged were called Angles, after the region they came from, namely Angeln, which lies in Schleswig-Holstein, northern Germany. It's hardly England, you know ;)


* Did learn something interresting today. *

OniLinkPlus

  • Hero Member
  • *****
  • Posts: 500
    • View Profile
New naming convention
« Reply #112 on: January 24, 2012, 09:26:28 pm »
Quote from: "Silvah"
Quote from: "OniLink10"
Well, let's not start a debate here, but do you know why it's called English? Because it came from England/Britain.
It's called English, because the people among whom it emerged were called Angles, after the region they came from, namely Angeln, which lies in Schleswig-Holstein, northern Germany. It's hardly England, you know ;)
Today I learned!
I use the latest build of SFML2

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6286
  • Thor Developer
    • View Profile
    • Bromeon
New naming convention
« Reply #113 on: January 25, 2012, 12:26:43 pm »
By the way, how are the STL compatibility functions going to be named? begin() and end() are strictly speaking inconsistent, as they're missing "get" :P

The real problem however is, those standard iteration loops mostly use the iterator or const_iterator member type, at least in C++98 without type inference. So only providing begin() and end() isn't enough.
Code: [Select]
for (Container::iterator itr = c.begin(); itr != c.end(); ++itr)
But if sf::String and sf::VertexArray use iterator and const_iterator instead of Iterator and ConstIterator, you will have multiple naming conventions in your public API again ;)
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

Oberon

  • Newbie
  • *
  • Posts: 19
    • View Profile
    • My Github profile
New naming convention
« Reply #114 on: January 25, 2012, 01:52:39 pm »
SFML has to provide iterator and const_iterator, otherwise the containers will not be usable in BOOST_FOREACH or the C++11 range based for loops ("foreach loops").
I propose to follow the Qt way here and provide both, one of them as typedef.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
New naming convention
« Reply #115 on: January 25, 2012, 03:11:22 pm »
Quote
SFML has to provide iterator and const_iterator, otherwise the containers will not be usable in BOOST_FOREACH or the C++11 range based for loops ("foreach loops")

As far as I know, both can rely on non-member begin/end functions too.

I think that begin() and end() won't be renamed, people are used to these functions and it would be really strange to give them different names. As far as I know, all other libraries that use "get" for getters do the same.

I don't know what to do with iterator types. Qt defines both but I personally always use Iterator/ConstIterator because it's consistent with other Qt types.
Laurent Gomila - SFML developer

BMB

  • Newbie
  • *
  • Posts: 21
    • View Profile
New naming convention
« Reply #116 on: January 25, 2012, 10:39:32 pm »
I hate to sound impatient or annoying, but since it seems that you have decided and already have the changes done by you, can we expect them to be  committed soon?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
New naming convention
« Reply #117 on: January 25, 2012, 10:57:08 pm »
Nop, I'm first finishing to update the bindings (to the new graphics API), which takes much time.

And the changes are done but I need to restore the get/is prefixes, which will also take quite a lot of time.
Laurent Gomila - SFML developer

Tank

  • SFML Team
  • Hero Member
  • *****
  • Posts: 1486
    • View Profile
    • Blog
    • Email
New naming convention
« Reply #118 on: January 27, 2012, 11:23:06 am »
Quote
And the changes are done but I need to restore the get/is prefixes, which will also take quite a lot of time.

I thought you use Git? Hopefully you're not of the sort of people committing changes only each 7 days. ;)

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
New naming convention
« Reply #119 on: January 27, 2012, 12:08:07 pm »
Quote
I thought you use Git? Hopefully you're not of the sort of people committing changes only each 7 days.

I switched from "PascalCase with get" to "camelCase without get", in a single commit. So now I need to add "get" prefixes.
Laurent Gomila - SFML developer