tapahob / BG2RadarOverlay

An overlay program for Baldurs Gate EE (1, 2) showing nearest enemies, their resistances, buffs and its durations
MIT License
27 stars 3 forks source link

[Refactoring] MainWindow.xaml.cs #30

Closed LionAG closed 1 year ago

LionAG commented 1 year ago
tapahob commented 1 year ago

On the coding convention thing - I use the lowercase naming for all things private, which I believe is a standard for C#. In your case (the C++ way, right?) there is no difference in naming of private and public functions.

I'm okay with the rest

LionAG commented 1 year ago

According to C# coding conventions we use pascal casing for naming public methods. I have not seen any coding convention that distinguished between public and private methods nor do I see any benefit from doing so since the accessibility level is already distinguished by adding access modifiers.

In the case of having two similar methods, one for public use and another for internal use we can prefix it with Internal keyword eg. GetEntity and InternalGetEntity, therefore making them easily distinguishable.

Regarding naming of the private / internal fields: use camel casing ("camelCasing") when naming private or internal fields, and prefix them with _.

Reference: https://learn.microsoft.com/en-us/dotnet/csharp/fundamentals/coding-style/coding-conventions

tapahob commented 1 year ago

Myabe its not the standard, but I wrote the whole project with it in mind - I see no point changing it at this stage

LionAG commented 1 year ago

It is a valid point. I changed that seeing some of the methods named one way and the rest another - not knowing if it was intentional or oversights.

How about naming event handlers ListView_SelectionChanged or listView_SelectionChanged?

tapahob commented 1 year ago

Im okay with that

LionAG commented 1 year ago

I have reverted the change.