conventions

"documentation" conventions and auto checking them

Were defining a C# module to outsource (I dont like it either ...) maintaining and evolving it will be done inhouse. Is there any good way to define and autocheck the in-code documentation quality ? thanks....

Do people use the Hungarian Naming Conventions in the real world?

Is it worth learning the convention or is it a bane to readability and maintainability? ...

Have there ever been any studies relating productivity to coding conventions?

There is always a lot of discussion about various coding conventions, with strongly held beliefs on all sides. But I am curious if there have been any studies comparing equivalent projects where there were different mandated coding conventions, or even no coding conventions whatsoever. I am especially curious as to what effect differen...

.NET Testing Naming Conventions

What are the best conventions of naming testing-assemblies in .NET (or any other language or platform)? What I'm mainly split between are these options (please provide others!): Company.Website - the project Company.Website.Tests or Company.Website Company.WebsiteTests The problem with the first solution is that it looks like .T...

What's the golden code/comment ratio?

Is there a code/comment ratio that you consider to be a sign of good (bad) code health? Can you give examples of open source projects that are considered to be well coded and their respective comment ratio? (I realize that no ratio is "true" for every project and there may very well be crappy projects that exhibit this theoretical gold...

Tabs versus spaces in Python programming

I have always used tabs for indentation when I do Python programming. But then I came across a question here on SO where someone pointed out that most Python programmers use spaces instead of tabs to minimize editor-to-editor mistakes. How does that make a different? Are there other reasons why you would use spaces instead of tabs for P...

Do you think a software company should impose developers a coding-style?

If you think it shouldn't, explain why. If yes, how deep should the guidelines be in your opinion? For example, indentation of code should be included? ...

Should one use < or <= in a for loop

If you had to iterate through a loop 7 times, would you use: for (int i = 0; i < 7; i++) or: for (int i = 0; i <= 6; i++) There are two considerations: performance readability For performance I'm assuming Java or C#. Does it matter if "less than" or "less than or equal to" is used? If you have insight for a different languag...

Should I use default(Foo), Foo.Empty, or null?

So C# now allows you to use default(Foo) to get a recognized "not filled in yet"/empty instance of a class -- I'm not sure if it is exactly the same as new Foo() or not. Many library classes also implement a Foo.Empty property, which returns a similar instance. And of course any reference type can point to null. So really, what's the ...

Are there any Ant conventions similar to Maven2 conventions?

For the past 2 years-(ish) I've been using Maven2 for my build/continuous integration solution. I used Ant a bit before that but really didn't get a lot of experience with it. Now I've taken a new job and the team I'm on now uses Ant. What I'm wondering about is this: In Maven we had directory conventions for seperating our java so...

Standard File Naming Conventions in Ruby

For a file containing the given class, SomeCoolClass, what would be the proper or standard filename? 1. somecoolclass.rb 2. some_cool_class.rb 3. some-cool-class.rb 4. SomeCoolClass.rb or some other variation? I noticed in the Ruby stdlib, versions 1, 2 and 3 are used. ...

When to Use Double or Single Quotes in JavaScript

console.log("double"); vs console.log('single'); I see more and more JavaScript libraries out there using single quotes when handling strings. What are the reasons to use one over the other? I thought they're pretty much interchangeable. ...

PHP Idioms?

I'm looking to improve my PHP coding and am wondering what PHP-specific techniques other programmers use to improve productivity or workaround PHP limitations. Some examples: Class naming convention to handle namespaces: Part1_Part2_ClassName maps to file Part1/Part2/ClassName.php if ( count($arrayName) ) // handles $arrayName being u...

How do I pronounce "=>" as used in lambda expressions in .Net

I very rarely meet any other programmers! My thought when I first saw the token was "implies that" since that's what it would read it as in a mathematical proof but that clearly isn't its sense. So how do I say or read "=>" as in:- IEnumerable<Person> Adults = people.Where(p => p.Age > 16) Or is there even an agreed way of saying it...

List of de facto standard keyboard shortcuts for Windows apps?

Let's say I'm developing a new desktop application for Windows. Is there a list somewhere that I can consult (either from Microsoft or a 3rd party) of keyboard shortcuts that all Windows applications should support? (Note: When I say "all Windows applications" here, I really mean "all Windows applications where a particular keyboard sh...

CSS Conventions / Code Layout Models

Has there been any attempt and creating a formalized method for organizing CSS code? Before I go and make up my own strategy for keeping things readable, I'm wondering what else is out there. Goggle hasn't been very helpful, as I'm not entirely sure what terms to search for. I'm thinking more along the lines of indenting/spacing, when ...

Visual Studio C#-settings and StyleCop (MS Source Analysis)

Does anyone have settings for Visual Studio, in XML or a .vssettings-file, that is compatible with StyleCop? I've used the book Framework Design Guidelines: Conventions, Idioms, and Patterns for Reusable .NET Libraries for guidance on what Microsoft finds to be the correct way to format C# and set my Visual Studio-settings accordingly. ...

Deploying a python application with shared package

Hey everyone, I'm thinking how to arrange a deployed python application which will have a Executable script located in /usr/bin/ which will provide a CLI to functionality implemented in A library installed to wherever the current site-packages directory is. Now, currently, I have the following directory structure in my sources: fo...

How do you resolve the discrepancy between "StyleCop C# style" and "Framework Design Guidelines C# style"?

After going through the Appendix A, "C# Coding Style Conventions" of the great book "Framework Design Guidelines" (2nd edition from November 2008), I am quite confused as to what coding style is Microsoft using internally / recommending. The blog entry A Brief History Of C# Style claims: In fact, the differences between the "StyleCo...

Referencing other peoples code.

I'm currently working on my Bachelors dissertation. This involves developing a software product and a 12000 word write-up, mainly covering research, design and development. Now where I am quoting other peoples written work, I am obviously referencing this, but what about code? There have been plenty of times where I've looked for a solut...