Tagged Questions
39
votes
15answers
2k views
Working on someone else's code [closed]
Possible Duplicate:
What is the most effective way to add functionality to unfamiliar, structurally unsound code?
I have hardly a year's experience in coding. After I started working, most ...
53
votes
17answers
2k views
Recommendations for teaching junior programmers good coding style
I am a big fan of good coding style, producing clean, clear code that runs well and is easy to use and integrate into larger systems. I believe that we programmers are essentially craftspeople who ...
10
votes
7answers
481 views
Practical considerations for HTML / CSS naming conventions (syntax)
Question: what are the practical considerations for the syntax in class and id values?
Note that I'm not asking about the semantics, i.e. the actual words that are being used, as for example ...
12
votes
3answers
338 views
Bugs that can be avoided with coding standards
I am looking for statistics (or estimations) that backup the claim that coding standards help reduce bugs. Hard-numbers would be nice, although I haven't had much look finding any. I've even looked ...
2
votes
1answer
267 views
Has anyone thoroughly compared C# common coding standards?
Most of the C# programmers I know embrace one of the common coding standards. However being aware of the standards is one thing, telling the differences is another.
Browsing the common coding ...
0
votes
2answers
131 views
Naming Rules: Standards, Reserved, and what do they depend on? [closed]
I want to know the rules of naming (AlwaysCapitalize, _underscore, firstSmallLetter, etc...) for each of Namespaces, Classes, Interfaces, Exceptions, Data Members, Methods, Variables, etc....
also I ...
4
votes
5answers
418 views
How to deal with different programming styles in a team?
We have a small dev team (only 3 developers) and we recently got
a new team member. While he is a smart coder, his coding style is
completely different from ours. Our existing code base contains
...
17
votes
12answers
1k views
Is it an appropriate use of #define to make typing repeated code easier?
Is there any view on whether using the #define to define full lines of code for simplifying coding is good or bad programming practice? For example, if I needed to print a bunch of words together, I'd ...
0
votes
4answers
177 views
How do I convince some one that test should do assertion (not assertions) and not the helper methods
Joined a new employer and came across a new style of writing tests.
@Test()
public testMethodWhichDoesNotDoAnyAssertion() {
LoginPage loginPage = signUpPage.doLogin("username","password");
...
1
vote
4answers
152 views
What are the pros and cons of directly exposing a Table/View entity class to the client?
I'm developing a multi-tier application. We separate our project into three logical layers: client, service and data access. However, almost all methods in the service layer don't do anything except ...
2
votes
7answers
399 views
Is there a common capitalization convention in C++?
I do a lot of work in Python and Java, and both those languages have fairly common (though not universal) conventions on how capitalization should be used in identifiers: both use PascalCase for class ...
66
votes
17answers
11k views
What is the benefit of not using Hungarian notation?
One of the things I struggle with is not using Hungarian notation. I don't want to have to go to the variable definition just to see what type it is. When a project gets extensive, it's nice to be ...
1
vote
3answers
227 views
What are pros and cons of using temporary “references”?
In C and C++ (and I guess other languages that allow taking a "reference" to an array element or something similar), when you have an array like type, accessing individual elements of such an array ...
4
votes
2answers
408 views
Why are people afraid to die()?
I have seen a lot of people (first comment) hating die(); instead of exit;
As the follow-up comments on that post note, die and exit are the same - the attitude appears to be one of perception, with ...
2
votes
6answers
403 views
Line break before/after operator
While Sun's Java code convention suggests to put line break before the operator many other guidelines disagree with it. I do not see any obvious pros and cons, so are there advantages of using one of ...
41
votes
14answers
3k views
Why do most of us use 'i' as a loop counter variable?
Has anyone thought about why so many of us repeat this same pattern using the same variable names?
for (int i = 0; i < foo; i++) {
// ...
}
It seems most code I've ever looked at uses i, j, ...
5
votes
1answer
151 views
A standard style guide or best-practice guide for web application development
I run a very small team of developers on a web application, just three people (and not even full time). We're all capable developers, but we write our code in very different ways: we name similar ...
15
votes
14answers
841 views
Coding standards and coding style, is it that much important?
There are a lot of ways of typing code, but I can't understand what is the good reason to adopt a certain standard or style if it does not change the way the code can be read and understood.
Everyone ...
14
votes
10answers
1k views
How important is a good coding style for the decision to hire a programmer?
Even as a student I am asked to review the code of programmers who have (not) passed a test (create a list of Fibonacci numbers on android).
While I am very strict on coding style I just read about ...
0
votes
2answers
154 views
[C] Address of array elements
What is the most readable way of using address of an array element?
I usually see &array[n] but I personally think array+n looks cleaner and more readable.
What do other C coders prefer?
1
vote
3answers
179 views
C# Coding Standard - Position of Attribute in relation to Target
I had thought that this was one of the few solved problems in C# coding standards / style; Attributes always appear on the line above the thing to which they are applied a la
[SomeClassAttribute]
...
10
votes
8answers
437 views
What about all those coding rules?
I always supported the idea of having coding rules for developers in a company or a specific project. Especially if the company is size greater than 10. The bigger the company the bigger the need. I ...
2
votes
5answers
666 views
How to not mix HTML with PHP?
I made an application in EXTJS, but my technical architect and project manager say we don't want big file, so removed the EXTJS and made in object oriented PHP and JavaScript code, mixing HTML with ...
9
votes
5answers
348 views
Evolution in coding standards, how do you deal with them?
How do you deal with evolution in the coding standards / style guide in a project for the existing code base? Let's say someone on your team discovered a better way of object instantiation in the ...
16
votes
9answers
576 views
Are long functions acceptable if they have internal structure?
When dealing with complicated algorithms in languages with support for nested functions (such as Python and D) I often write huge functions (because the algorithm is complicated) but mitigate this by ...
6
votes
9answers
810 views
What C++ coding standard do you use?
For some time now, I've been unable to settle on a coding standard and use it concistently between projects. When starting a new project, I tend to change some things around (add a space there, remove ...
24
votes
15answers
1k views
Space around operators? a=b/2; or a = b / 2; What are the arguments?
Personally I prefer space around operators. For me it makes the code much more readable. What are the arguments not have space around them? Line length?
An example from the Python style guide (I ...
11
votes
6answers
373 views
How important are code formatting guidelines?
Coding standards are common in any software development organization, but how important are they to follow? I can understand the need for some consistency, but when dealing with simple things like ...
65
votes
56answers
8k views
Worst coding standard you've ever had to follow? [closed]
Have you ever had to work to coding standards that:
Greatly decreased your productivity?
Were originally included for good reasons but were kept long after the original concern became irrelevant?
...