Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

First ever page of neoGFX documentation

49 views
Skip to first unread message

Mr Flibble

unread,
Aug 9, 2017, 5:15:00 PM8/9/17
to
First page of documentation for my C++ GUI/game lib, neoGFX (coming soon):

http://neogfx.io/wiki/index.php/NeoGFX_C%2B%2B_Code_Naming_Convention

/Flibble

Alf P. Steinbach

unread,
Aug 9, 2017, 6:48:30 PM8/9/17
to
On 09.08.2017 23:14, Mr Flibble wrote:
> First page of documentation for my C++ GUI/game lib, neoGFX (coming soon):
>
> http://neogfx.io/wiki/index.php/NeoGFX_C%2B%2B_Code_Naming_Convention

I've almost stopped using prefix `p` for pointers.

Difficult to get rid of such habit!

Re your prefix `k` for constants: remember, one person's constant is
another's variable, and vice versa. The constness can change in maintenance.


Cheers!,

- Alf

Ian Collins

unread,
Aug 10, 2017, 1:40:12 AM8/10/17
to
They drive me nuts in my current work codebase!

We end up having silly philosophical debates about whether a
std::unique_ptr variable is should be pWhatsit or just whatsit...

--
Ian

Öö Tiib

unread,
Aug 10, 2017, 2:36:11 AM8/10/17
to
Various kinds of such silly bikeshedding are normal in organization. It
helps a bit when team acknowledges it as a problem and tries to fight with
it but not much.

Daniel

unread,
Aug 10, 2017, 3:12:03 PM8/10/17
to
On Wednesday, August 9, 2017 at 5:15:00 PM UTC-4, Mr Flibble wrote:
> First page of documentation for my C++ GUI/game lib, neoGFX (coming soon):
>
> http://neogfx.io/wiki/index.php/NeoGFX_C%2B%2B_Code_Naming_Convention
>

(1)

for (auto const& g : iGrades)
total += g;

should be

for (auto g : iGrades)
total += static_cast<char>(g);

(2)

<< static_cast<char>(s.average_grade() + 'A')

should be

<< (static_cast<char>(s.average_grade()) + 'A')

Daniel

Daniel

unread,
Aug 10, 2017, 3:19:07 PM8/10/17
to
On Wednesday, August 9, 2017 at 5:15:00 PM UTC-4, Mr Flibble wrote:
> First page of documentation for my C++ GUI/game lib, neoGFX (coming soon):
>
> http://neogfx.io/wiki/index.php/NeoGFX_C%2B%2B_Code_Naming_Convention
>
What is your definition for an interface class? Pure virtual functions only? tags?

Daniel

Alf P. Steinbach

unread,
Aug 10, 2017, 3:57:06 PM8/10/17
to
On 10.08.2017 21:11, Daniel wrote:
> On Wednesday, August 9, 2017 at 5:15:00 PM UTC-4, Mr Flibble wrote:
>> First page of documentation for my C++ GUI/game lib, neoGFX (coming soon):
>>
>> http://neogfx.io/wiki/index.php/NeoGFX_C%2B%2B_Code_Naming_Convention
>>
>
> (1)
>
> for (auto const& g : iGrades)
> total += g;
>
> should be
>
> for (auto g : iGrades)
> total += static_cast<char>(g);

I bet Mr Flibble was the victim of editing here.

Marshall Cline once gave me the advice to do as he did with the FAQ's
examples for the FAQ book: compile them all, no matter how trivial.

So, good catch, as they say, but instead of the `static_cast` I'd rather
fix the `enum` definition, e.g. replace

enum class grade

with

struct Grade { enum Enum {

which fixes the one thing that was ungood about C++03 enumerations,
namely lack of qualification of value names, without dragging in the new
ungoodness of C++11 enumerations, namely lack of implicit conversion to
integer values.

Also I'd use `auto const` rather than just `auto`: that's a nice
possibility with range based `for`, and I think it deserves to be used
by default, only leaving off the `const` when that has a /purpose/.


> (2)
>
> << static_cast<char>(s.average_grade() + 'A')
>
> should be
>
> << (static_cast<char>(s.average_grade()) + 'A')

Eagle eyes! :)


Cheers!,

- Alf

Mr Flibble

unread,
Aug 10, 2017, 4:23:28 PM8/10/17
to
Fixed the issues *my* way; thanks.

/Flibble

Öö Tiib

unread,
Aug 10, 2017, 4:37:28 PM8/10/17
to
On Thursday, 10 August 2017 00:15:00 UTC+3, Mr Flibble wrote:
> First page of documentation for my C++ GUI/game lib, neoGFX (coming soon):
>
> http://neogfx.io/wiki/index.php/NeoGFX_C%2B%2B_Code_Naming_Convention

It wasn't likely meant as demo of algorithms but with your average_grade
algorithm grades A, B, B, B will give A as average.

Mr Flibble

unread,
Aug 10, 2017, 4:44:38 PM8/10/17
to
This is OK as Mr Flibble's average grade is not A so will making coding
mistakes.

/Flibble


0 new messages