Most voted "conventions" questions
A generic tag that covers programming conventions, that is, any accepted method of doing things, which could include nomenclature, spacing, coding, comments, etc.
Learn more…17 questions
Sort by count of
-
23
votes2
answers885
viewsTo what extent should I follow the conventions, where can I apply specific style patterns of my own?
How far should I follow the conventions in Java codes, that is, how far the convention is a rule? I can develop and apply my own styles of coding patterns in my code, knowing that I will use this…
-
15
votes1
answer6546
viewsNaming conventions for variables and functions in Python?
In the R, there is a lot of freedom and variety in function names between packages. Dot names (get.this), names in camel (getThis), names in snake_case (get_this). This has its pros and cons. Why,…
python python-2.7 python-3.x nomenclature conventionsasked 10 years, 8 months ago Carlos Cinelli 16,826 -
10
votes2
answers5514
viewsIs there a correct way to comment on a code snippet?
Is there a correct way to comment on a code snippet? For example: // Esconde a tela this.Hide() or would be: this.Hide() // Esconde a tela or even: this.Hide() // Esconde a tela Is there some kind…
-
7
votes1
answer202
viewsWhat is a convention on configuration?
Currently I see that some frameworks, libraries and systems use the concept of convention on configuration, from which I raised the following questions What is a configuration convention? What are…
-
6
votes1
answer113
viewsWhy do constants in the File class not follow the constant convention?
The convention for Java constants says that a constant should be declared with uppercase letters only and words should be separated by underscore (_). The declaration of a constant is made by the…
-
6
votes1
answer991
viewsWhy insert a blank line at the end of the code?
Most linters from different programming languages, such as Rubocop (Ruby) and Jslint (Javascript) recommend a blank line from the end of all code files. As an example, Rubocop:…
-
5
votes2
answers189
viewsWhy does Netbeans suggest improving the for?
When I was doing this for Netbeans Showcased That Lamp of Tips to Improve Code on the Line of for. The suggestion was to reverse the condition. Follow the code: Before of improvement: for(int j = 0;…
-
4
votes4
answers1933
viewsHow to choose a convention for variable and function names?
I am going through the second development company and in both have no own convention to use in the declarations, in the codes caught functions declared as follows: PHP and jQuery function…
-
3
votes0
answers124
viewsWhy do file names usually not carry special characters?
It is common for file names to follow patterns such as nome-imagem.jpeg (in lowercase and separated by hyphens). This practice is adopted by convention or because of compatibility with web servers?…
-
2
votes1
answer430
viewsWhat is the best way to organize views in Django?
I have views.py in my study project where I group it from methods to represent views (methods that return Httpresponse), to generic views based on class (such as Detailview, Listview). I was…
-
2
votes1
answer225
viewsProblems with PEP8 indentation rules
I’m using the autopep8 extension in sublime text 3 and it suggests to me that the following line looks like this: self.buttons = [Button(self.fonts["alfa_slab_one_regular_40"], "JOGAR",…
-
2
votes2
answers1623
viewsChecking whether a string is empty in Javascript. Idiomatic or readable?
I understand that it is often best to value the readability and clarity of the code by programming explicit. This does not only stop the Javascript, also the C#, Python and perhaps the rest of the…
-
1
votes2
answers286
viewsWhat’s the convention on the location of the Laravel 4?
My question relates to the following: public function getIndex() { $users = \User::all(); return \View::make('admin.users.index') ->with('title', 'Usuários') ->with('users', $users); } In this…
-
1
votes0
answers37
viewsValidation: What is the method used in this example?
I’m studying ways to validate forms. I’ve tried it with Javascript, HTML5 features and some other methods, but they all have something in common. Always have to call a function in onclick(),…
-
1
votes1
answer99
viewsHow to name variables and organize them in the code in what goes beyond PEP 8?
Where I could find tips for naming variables, organizing code, etc.? For example, I have a class and it has several attributes, some depend on whether another attribute has been declared before, but…
-
0
votes1
answer178
viewsCode Conventions in C#
I have some experience with Java and C. Recently, I picked up a project in C#. I wonder if there is a style guide from Microsoft or some other entity to learn what the C programming style looks…
-
0
votes1
answer81
viewsCan modifying the default Rails primary keys cause any problems?
By default, Rails generates the id field for all my tables and I would like to know if, in the future, it can generate an error if I change the name and type of the key. I ask this because I…