Is this reverse naming convention a bad idea (i.e. contrary to industry standards)?

I always changed the names so that they naturally grouped in intellisense. I am wondering if this is a bad idea.

For example, I run a pet shop, and I have invoices that add, edit, delete and store pages, view, edit. To get the url for them, I would call methods (in a suitable class such as GlobalUrls.cs

InvoicingAddUrl() InvoicingEditUrl() InvoicingDeleteUrl() StoreDisplayUrl() StorePreviewUrl() StoreEditUrl() 

This perfectly combines them in intellisense. A more logical naming would be:

 AddInvoiceUrl() EditInvoiceUrl() DeleteInvoiceUrl() DisplayStoreUrl() PreviewStoreUrl() EditStoreUrl() 

Is it better (better to be more industry standard) to group them together for intellisense or logically?

+6
coding-style naming-conventions
source share
5 answers

Grouping in Intellisense is just one of the factors when creating a naming scheme, but logical grouping by category rather than function is also common practice.

Most convention names dictate the use of characters, covers, underscores, etc. I think this is a matter of personal preference (company, team or other) as to whether you use NounVerb or VerbNoun formatting for the names of your methods.

Here are some resources:

Related questions:

  • Naming Conventions - Recommendations for Verbs, Nouns, and Using English Grammar
  • Do vs. Run vs. Execute vs. Run verbs
  • Events - naming convention and style
+5
source share

See what the military calls things. For example, MRE is a ready-to-eat meal. They do this because of the sort order, efficiency and avoiding errors. They are prepared to ignore the standard language conventions (i.e., English) used outside their organization, as they are not impressed with the quality of operations outside their organization. In the army, the quality of operations is literally a matter of life and death. In addition, doing their own thing, they have a way to determine who is inside and who is outside the organization. Anyone who cannot or does not want to learn the military path, which is different, but not incredibly difficult, is not their first choice for hiring or promotion.

So, if you are impressed with the standard quality of software there, then by all means continue to do what everyone else does. But, if you want to do better than yours in the past, or better than your competitor, I suggest looking at other areas to learn lessons, for example, military ones. Then make a choice for your organization, this is not impossible, but for you and your competitiveness. You can choose the names of the big enthusiast (the most significant information will be the last) or the names of the little-known in the military style (the most important information in the first place), or you can use the dominant style that your competitors probably use, which does what you feel when you like it.

Personally, I prefer the names of Hungarian (appendices) with small names that were widely recognized as excellent when they first appeared, but then lost their usefulness because the naming of Hungary (Sys) destroyed the advantage due to the incorrect translation of the main idea, and because of unbridled abbreviations. The initial intention was to start the name with any things, and then become more specific until you complete the unique qualification. This is also the order in which most parameters of the array and classifiers of objects are located, therefore, in most languages, flows of names of smaller numbers into a large language scheme.

Do you want something. Go ahead, march.

+2
source share

Based on these methods, you can reorganize billing and store them in your classes, which will be closer to the mythical standard "industry standard".

However, no matter what your development team can agree on a naming convention should be fine. The important thing is to be consistent throughout the project.

+1
source share

This is not inherently bad. This has the advantage of making it easier to identify the type during the scan, and groups the parameters together in Intellisense, as you said. As long as you and everything else in your team chooses a way to do something and stay up to date, there should not be any big problems.

0
source share

I don’t think it would be nice to develop a coding standard around the tool (at least not the first consideration). Despite the fact that most IDEs will have Intellisense these days, and most people will use the mentioned IDEs, I believe that the coding standard should be primarily about making code clear and navigable in essence.

I would choose the most logical naming in person. When I write code and I have some kind of object that I'm going to call a member function on, I usually think about which member function to call based on the action I'm going to do, because I already know the object, m manipulation. So my first impulse would be to start typing β€œAdd” if I wanted to add something and see what Intellisense showed me. This, of course, is subjective.

I have never seen anyone use your Intellisense alphabetical group anywhere - at least not in code that should not be used as a basis for comparison, because it was so horrible in other ways.

However, if this is your standard, do what you want - the important part is consistency.

0
source share

All Articles