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

Author Topic: Naming conventions - functions  (Read 9204 times)

0 Members and 1 Guest are viewing this topic.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Naming conventions - functions
« Reply #15 on: October 27, 2011, 08:27:43 pm »
Quote
consistent with every other libraries

I wouldn't say that. There's no consistency in the C++ world; sadly, nobody uses the std/boost naming conventions.

Quote
I wonder how many people will want to use this library and how many give up because of the convention.

I don't choose a library by the naming convention it uses. As long as it doesn't pollute my public API, I really don't care.

Quote
So is there any decision about the convention in the new version?

Yes, the decision is that nothing will change. Sorry if it wasn't clear enough in the rest of the topic ;)
Laurent Gomila - SFML developer

Tyrreus

  • Newbie
  • *
  • Posts: 2
    • View Profile
Naming conventions - functions
« Reply #16 on: October 27, 2011, 10:20:22 pm »
Ok thanks for your clarification ;) Anyway, this lib is a pice of great job!

Regards

gsaurus

  • Sr. Member
  • ****
  • Posts: 262
    • View Profile
    • Evolution Engine
Naming conventions - functions
« Reply #17 on: October 27, 2011, 10:35:20 pm »
Quote from: "Laurent"
sadly, nobody uses the std/boost naming conventions.
Maybe because it isn't that good, I guess it is kept only for compatibility and historical reasons. To me it's just an old convention reflecting the old hardcore programming style.

Anyway the current SFML convention is fine, it's clean and easy to read, independently if people are used to other conventions or not.
Personally, if SFML used std/boost naming convention I may haven't chosen it, because I find it unnatural and hard to read. When smaller libraries use a convention (or API in general) that I find hard to understand, I wrap it with classes from my own, but for big and generic libs like SFML, simplicity and readability does matter.
Pluma - Plug-in Management Framework

deadalnix

  • Newbie
  • *
  • Posts: 45
    • View Profile
Naming conventions - functions
« Reply #18 on: October 29, 2011, 01:41:03 pm »
Quote from: "panithadrum"
First I liked the uppercase a lot, but then I started learning Qt and I really loved the lowercase. Anyway, it's too much work to change it and it doesn't really affect anything than code-reading perfection.


Well, code writing involve 90% of code ready. So I think this is a much biggger issue than you may think.

Mikademus

  • Newbie
  • *
  • Posts: 31
    • View Profile
Naming conventions - functions
« Reply #19 on: October 31, 2011, 01:37:02 pm »
Yes, the trend in the industry over the last decade has been a move to lower-case comelCase for methods (Class::myMethod()), upper-case CamelCase for free functions (MyFunction()), all-lowercase without underscores for namespaces, and abbreviations treated as normal words (RenderRttStuff(), Class::rtsAndRttAreAcronyms()).

This is actually tremendously positive for code readability.

The boost and STL code conventions are only used there, but that too can be argued to serve the purpose of showing what is "language" and what is userland calls.