Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
Join us in building a kind, collaborative learning community via our updated Code of Conduct.

The tag has no usage guidance.

0
votes
3answers
180 views

Naming variable which describes that something is currenty in use

I'm creating a variable which should describe that an object is currently in use. Lets say we have a form with a password input, and I want to describe the state when someone is using that input. Is ...
0
votes
2answers
125 views

SQL Coding Naming convention: Variable same name as Columns

Is there a coding naming convention principal for SQL variables? Can variables be named the same as column names, I heard in different companies, this may cause confusion. However in C# below, its a ...
0
votes
1answer
74 views

Co-ordination between technologies following different naming conventions [duplicate]

Javascript community generally follows camel case naming convention, whereas while writing REST api URLs follow snake case naming conventions. What would be the better naming convention for the ...
6
votes
1answer
230 views

Is it a good practice to redefine unavailable keywords as macros?

Is it a good practice to redefine unavailable keywords with macros? I use GCC 4.8 in one of my projects which isn't exactly C11 standard compatible. At least not the extent of 4.9. But there are some ...
2
votes
1answer
256 views

How to name a Boolean variable that represents either of two options?

I'm developing an application with Python. I want to have a Boolean variable that represent whether something is buy or sell but I'm not sure how I should name it. Here are my current ideas: isBuy ...
2
votes
1answer
187 views

Method naming: to vs as vs get

Do the words to, as and get have any special meaning when used in method names? Examples to new Integer(4).toString() get Integer.getInteger("system.unknown.property",4) as Arrays.asList(...
0
votes
1answer
99 views

Is a URC (Uniform Resource Citation) synonymous with a Query String or Url Parameters?

Reading this: https://renenyffenegger.ch/notes/development/web/URI-URL-URN-IRI-URC URCs provide a set of attribute/value pairs that describe properties of URIs like authorship, publisher, ...
-3
votes
3answers
159 views

Ambiguous use of “User”

In one of my projects, I had to name some variables and functions that belong to the person using my app. I named them userCard, getUserInventory() and so on. I named them like that cause there were ...
0
votes
3answers
135 views

RESTful APIs: Terminology for Update Modes/Types

When designing a RESTful API, providing a spec for updating an entity will force the designer to make some decisions on how the update will behave (an update mode or type). Here are some of the modes ...
-3
votes
2answers
334 views

Writing readable code and not overdoing it with naming [closed]

I've been in an argument at work about writing readable code. It was mainly about variable and method names and the idea that comments are worthless if the code is readable enough. I would not like to ...
-2
votes
1answer
511 views

How to name different components in adapter pattern?

(example code in PHP, but this can apply to more languages) I have a scenario with an adapter pattern, where I have classes, interfaces and objects with different roles, like so: An original object ...
2
votes
4answers
490 views

Naming similar variables [closed]

I need few related variables (for example I have the lengths of 3 lines given. I have to say whether they form a triangle). Which variable naming convention is preferable in Java? len0, len1, len2 ...
-3
votes
1answer
67 views

What to call a API and DB code layer [closed]

In a recent MVVM mobile app project I wrote a set of API classes and Database classes where there was a clear flow of logic between both api and db code. To enforce the way api and db interacted I ...
0
votes
0answers
34 views

Best practice on naming an array (i.e. an array of image file names) [duplicate]

I have an array of image file names. e.g: [ 'a/b/foo.jpg' 'c/d/bar.jpg', 'example.png' ] However, I am confused as to what the best practice of naming this array. Would it be: ...
29
votes
2answers
7k views

Why does software use the Win32 name?

If a software/library has some support for the Windows platform they almost always name their directories and variables as win32. This is most prevalent in C/C++ projects. Even the MinGW project's ...
6
votes
2answers
833 views

What's the Java convention for names with a sequence of numbers, like “ISO 8859-1”?

If I'm creating a Java class for something that has a sequence of numbers in its name, e.g. “ISO 8859-1”, how should I name my class? Iso88591 seems wrong, since there's no boundary between the ...
1
vote
0answers
693 views

Entity Framework naming conventions for the same table name across multiple schemas

The DbContext of my application's Entity Framework setup (which I will refer to as ApplicationContext, the name of our derived type) contains classes for all of the tables in our SQL Server database, ...
5
votes
2answers
545 views

Use of “my” prefix in object naming

I am refactoring a large code base, and noticing the author often uses "my" to prefix object names. For instance, using myThingy to identify an object of type Thingy. Is this generally considered a ...
1
vote
2answers
61 views

What's the standard term for removing data and embedded code modules from a database before publishing?

Hopefully this question isn't too application-specific; I'm thinking about it with regard to Excel, but I think it applies to any file-based database that includes embedded code. I'm working on an ...
13
votes
8answers
6k views

C# - Why are prefixes on fields discouraged?

Back in the old days, we did Hungarian notation. That's now considered passé, and for the most part I don't use it anymore, but I still find use for the m_ prefix to indicate member fields. For me, ...
3
votes
1answer
56 views

Naming a view class

I'm a little hesitant on what to name a view class. I have a view class which I call ChooseImageView because that's what the user does in that view. After the user has chosen an image I display a ...
0
votes
1answer
556 views

Naming collections of helper methods, and avoiding meaningless jargon words

While coding anything remotely useful, I inevitably find myself wanting to add methods to perform smaller bits and pieces. (It could be a method to return everything in a string to the left of the ...
1
vote
2answers
587 views

JS: convention to distinguish immediate vs async methods

I normally have a laissez faire attitude on method naming conventions but now I am working on a module in JavaScript that will have some methods that can return the value directly (immediate / plain ...
3
votes
1answer
4k views

What is the best practice when it comes to naming microservices?

I come from a "monolithic" SOA API mindset where, lets say, there would only be one RESTful service for persistence (persistence-app). Now that I'm developing in a microservice environment, I believe ...
42
votes
2answers
10k views

Naming of bool methods: Is vs. Can vs.?

Which is the better name for a method that returns a boolean? IsSupportContentType or CanSupportContentType
0
votes
3answers
2k views

How and why do we have underscores in variable naming

If I look in python code and sometimes maybe also in C codes, there is often two variables with the same name except for the underscore. For example two variables variable1 data; variable2 _data; ...
1
vote
4answers
610 views

Naming procedure conventions - Where to place adjective in a verb followed by an object convention

I am reading on Coding Complete book the following statement: To name a procedure, use a strong verb followed by an object A procedure with functional cohesion usually performs an operation on an ...
0
votes
2answers
142 views

How to name the classes that caries data to a different layer?

When I retrieve data from database I name the class as Model, for example UserModel. When I send data to the View I name the class as ViewModel, for example UserSettingsViewModel. How to name the ...
-1
votes
1answer
648 views

Do you name a dictionary by the key or the value? [closed]

Do you name a dictionary by the key or the value? I have a dictionary that will hold gradient data and the component: dictionary[gradient] = component; Do I name it gradientDictionary or ...
2
votes
3answers
256 views

Applying the label “Parent/Child” on inheritance vs composition

I just stumbled over an interesting problem with naming. I am writing automated tests for an Object-Relational mapper. This involves using super-generic classes that exist solely to exercise certain ...
2
votes
3answers
840 views

Naming convention for C# class that accesses a webservice

I apologize if this is a little vague, but I'm curious about what most people use for naming conventions for classes that access a webservice. Typically on my team we create separate projects for BLL ...
1
vote
0answers
62 views

Project Structure for intermediate level abstraction

This is really a question on higher level naming. We have an API directory for classes that deal directly without outside APIs, and contain all the code to consume a specific API. We call this lib ...
2
votes
2answers
278 views

When should I use “value” as an argument name? [closed]

I'm building my own utility functions to master ES6: const contains = (array, value) => { return array.indexOf(value) > -1 } const keys = (object) => { return Object.keys(object) } ...
-1
votes
1answer
144 views

How to name a class whose purpose is to hold related objects?

I am working in a wizard in WPF application. As the wizard gathers a lot of information I have designed separate view models for each step (view) in a wizard. But I have to hold all this information ...
140
votes
17answers
28k views

Coding standard for clarity: comment every line of code?

I've worked in shops that produce life critical software and I've dealt with commenting rules that were meant to keep the code readable and potentially save lives. In my experience though the ...
2
votes
2answers
300 views

Choose best function name in repository [duplicate]

In my code, I'm using repository pattern. For example, I got deal repository. I just curious how you decide the name of the function when the function itself doing so many things. I think when the ...
0
votes
1answer
304 views

Is the -Impl suffix a legitimate naming convention for a Hook method in Java?

I was going over some old code and found the following peculiar naming convention at a template method implementation. // TEMPLATE METHOD // Checks condition and fail fast if condition is met. // ...
2
votes
1answer
310 views

How to name Test Projects

Suppose I have some Modules that each are their own component I would now have different Testprojects spanning different modules. UnitB_UnitTest, UnitC_UnitTest, GUI_UnitB_ComponentTest, ...
8
votes
2answers
3k views

How should I name functions that return values in Python?

I'm confused about choosing names for my functions in Python. Sometimes Python built-in functions are imperative such as: print function and string method find. Sometimes they aren't such as: len its ...
1
vote
1answer
122 views

naming conventions / coding standards for methods in a service

At work, we are having 'arguments' about naming styles / conventions. Imagine having a service called UserSettingsService. This has 2 methods, one to get the user settings and one to save. Would you ...
2
votes
1answer
374 views

Why is Systems Hungarian commonly used in the VB world, and seemingly nowhere else?

Kind of as the title implies - I can understand why Apps Hungarian might crop up, but Systems Hungarian seems almost entirely pointless in a strongly-typed language. Why, then, is it so apparently ...
67
votes
8answers
9k views

Naming issues: Should “ISomething” be renamed to “Something”? [closed]

Uncle Bob's chapter on names in Clean Code recommends that you avoid encodings in names, mainly regarding Hungarian notation. He also specifically mentions removing the I prefix from interfaces, but ...
-1
votes
1answer
476 views

What to name package and their facade classes?

I'm using a some C++ Facade classes like this: http://www.apwebco.com/images/Facade.png Suppose that there is package named "SubSystem" with a lot of classes inside, like in the picture above. I ...
-1
votes
1answer
139 views

What is the naming convention for this type of object [closed]

I have frequent "access" classes that implement interfaces / abstract classes. These classes all have different classes/ dlls to execute the implemented method. What naming convent is commonly ...
1
vote
2answers
136 views

'first_name' vs 'name_first' for Grouping Similar SQL Columns

When creating a table with similar bits or data such as names. Is it preferred to have the column name prefixed with a common value? Consider a table to store user information. Looking at the columns ...
0
votes
1answer
141 views

How to name this class? Is it a pattern?

I need to create a class which will have the following structure: public class MyClass { ArrayList<File> myList = new ArrayList<>(); public void addFile(File f) { myList....
3
votes
1answer
204 views

Bothered by an unknown letter case name

This side question bothers me: Has_This_Case_A_Name? Here is what I could find, but This_Case_Is_Missing: +---------------------------------------+---------------+ | Names ...
16
votes
1answer
1k views

What is the history for naming constants in all uppercase?

What is the history behind the convention of naming constants in all uppercase? My intuition is that it started with the C preprocessor, where people developed a practice to name preprocessor macros ...
4
votes
2answers
183 views

Common loop variable names for indexes in 4D and above

I am curious if there are common loop index variables (of single character or not) for dealing with 4 dimensions and above? I was helping another student working through CS50x who was just learning ...
0
votes
2answers
436 views

Naming when having to inherit classes [closed]

I am always a huge fan of standards and think I finally decided on one of the many C++ naming standards. However, it almost seems moot because working with a couple of libraries where the standard use ...