coding-style Questions

5

Solved

The guidelines are clear for enumerations... Do use a singular name for an enumeration, unless its values are bit fields. (Source: http://msdn.microsoft.com/en-us/library/ms229040.aspx) ...bu...
Lillis asked 1/11, 2011 at 0:33

19

Solved

I program with eclipse and sometimes use GUI text editors like SciTE or vim. However, I'm at a point in a project that requires me to edit files over a ssh connection in a 80 column SSH window. Si...
Airliner asked 4/8, 2010 at 15:46

4

Solved

There are so many settings in the preferences for Code->Style->Objective-C. I'm looking for the right one to reformat this line of code SCPropertyDefinition *test = [SCPropertyDefinition definiti...
Sensual asked 29/4, 2013 at 22:36

2

Solved

This question extends Unify output with different clang-format versions. The problem is that the default behavior of clang-format varies for different version, even for the built-in styles. Quite f...
Meade asked 18/12, 2019 at 15:42

7

Solved

Are there any naming conventions or standards for Url parameters to be followed. I generally use camel casing like userId or itemNumber. As I am about to start off a new project, I was searching wh...
Blague asked 20/2, 2009 at 9:43

6

I'm looking for a style guide to log messages: For example: What & when Conventions Style & Formatting Readability i.e. what makes a good / bad log message string I'm particularly i...
Hibben asked 13/10, 2010 at 16:49

4

Solved

Not to be confused with how to split a string parsing wise, e.g.: Split a string in C++? I am a bit confused as to how to split a string onto multiple lines in c++. This sounds like a simple ques...
Franciscofranciska asked 4/10, 2010 at 21:13

5

Solved

I am currently teaching students as a tutor programming conventions. I've told them that they can find most conventions in the Oracle Code Conventions. In my last tutorial a student asked if: pu...
While asked 1/11, 2012 at 10:31

5

Solved

Occasionally I want lazy module loading in Python. Usually because I want to keep runtime requirements or start-up times low and splitting the code into sub-modules would be cumbersome. A typical u...
Millenarianism asked 14/11, 2010 at 13:47

11

Solved

Lately, I started using lint for static code analysis. One of the warning I get sometimes is regarding this issue. Let's say for instance that I've got the following function: uint32_t foo( void )...
Autodidact asked 9/8, 2012 at 17:15

2

Solved

I've recently been taking a C course as part of a university degree. We have been forbidden from using goto, break and continue, and must only use a single return statement from a function. I have ...
Bermejo asked 11/6, 2022 at 4:10

8

Solved

Problem: Test if x ∉ { 2, 3, 61, 71 } I often wondered if there is not a better way than: if (x != 2 && x != 3 && x != 61 && x != 71) { // do things } and if (!new Lis...
Emelda asked 22/11, 2011 at 15:0

2

Solved

I've googled for a while and not found how to do this. I have eslint and prettier setup in my project. // What I have: if (a == b) doSomething(); // What I want from either eslint or prettier if...
Cornerstone asked 6/1, 2019 at 19:54

6

Solved

Is there any sort of plug-in or tool available for Visual Studio 2008 to alphabetize methods? Ideally I'd like a tool that will alphabetize a selection, or specified type (i.e. only methods, not me...

8

Solved

In the past I've always used underscores for defining class and id attributes in HTML. Over the last few years I changed over to dashes, mostly to align myself with the trend in the community, not ...
Athwart asked 26/9, 2011 at 20:18

5

Is there a Checkstyle rule file with the Google Java Style?
Pleadings asked 3/4, 2014 at 15:11

8

Solved

When we want to give some formatting to code to make it more readable. We can use both Tab and Space (by pressing space bar on keyboard). Many time I give space manually. I've some confusions Is...
Treadwell asked 11/10, 2011 at 15:47

4

Solved

There is one problem bothering me in Golang. Say I have 2 structs: type Dog struct { Name string Breed string Age int } type Cat struct { Name string FavoriteFood string Age int } And whe...
Concordat asked 19/5, 2015 at 21:39

16

Solved

As far as I can see, there are three ways to use Booleans in C: with the bool type, from <stdbool.h> then using true and false defining using preprocessor #define FALSE 0 ... #define TRUE !(...
Egocentrism asked 12/2, 2010 at 18:15

5

Solved

When I use position relative with no content, footer goes up, with absolute with a lot of content, the footer goes down, and with fixed it is always there. Is there a easy way to get at the end of ...
Fryd asked 12/4, 2013 at 16:16

7

Solved

Consider you have some expression like i = j = 0 supposing this is well-defined in your language of choice. Would it generally be better to split this up into two expressions like i = 0 j = 0 ...
Gussie asked 13/11, 2010 at 11:14

2

Solved

For many programming languages there are style guides available, e.g. PEP8 for Python, this Matlab style guide or the style guides by Google. For Modelica I found the conventions described in the U...
Lavadalavage asked 4/1, 2013 at 19:12

5

Solved

By making private constructor, we can avoid instantiating class from anywhere outside. and by making class final, no other class can extend it. Why is it necessary for Util class to have private co...
Shenika asked 3/9, 2015 at 12:4

4

I'm writing code guidelines for some of our projects on Android. I'd actually like to facilitate this by using Android Studio code style preferences. I'm almost done setting parameters there: Andro...
Serviceberry asked 29/7, 2015 at 13:42

8

Solved

i'm using VS Code for flutter development and one issue i have is code formatting (styling) which is not as customizable as it is in android-studio. my problem is that each time vs code saves dart ...
Backslide asked 23/12, 2019 at 13:47

© 2022 - 2024 — McMap. All rights reserved.