How do you keep yourself coding to standards? There is stylecop and resharper for C#. Are there any tools/eclipse plugins for code analisys in Java? Which of them do you use?
Please can you help me to find some tools which will help developers to follow coding conventions for .NET( .NET Naming Guidelines,...)
I found this ones:
StyleCop
FxCop
Please can you help me to find some tools which will help developers to follow coding conventions for .NET( .NET Naming Guidelines,...)
I found this ones:
StyleCop
FxCop
Hi ,
we're trying to implement new coding style guidelines for our team, the php codesniffer is printing an warning on switch case statements when no "break" is found like:
switch ($foo) {
case 1:
return 1;
case 2:
return 2;
default:
return 3;
}
is there any good reason to use :
switch ($foo) {
…
Hi all,
We currently have 3 devs with, some, conflicting styles and I'm looking for a way to bring peace to the kingdom...
The Coders:
Foo 1: Likes to use Func's & Action's inside public methods. He uses actions to alias off lengthy method calls and Func's to perform simple tasks that can be expressed in 1 or 2 lines and will be used…
I saw two common approaches for coding standards for private member variables:
class Foo
{
private int _i;
private string _id;
}
and
class Foo
{
private int m_i;
private string m_id;
}
I believe the latter is coming from C++. Also, many people specify type before the member variable: double m_dVal -- to indicate…
I'm looking for a script/tool that can be customized to check and enforce coding/naming conventions on a C/C++ code.
It should check for example:
Code lines are wrapped at some length.
Private variables have prefix _
Code is indented properly.
All functions are documented.
So, lets say you have two SQL Server Databases on the same server that reference each others tables in their Views, Functions and Stored Procedures.
You know, things like this:
use database_foo
create view spaghetti
as
select f.col1, c.col2
from fusilli f
inner join database_bar.dbo.conchigli c on f.id = c.id
(I know that cross-database…
From Herb Sutter and Andrei Alexandrescu's 'C++ Coding Standards', Item 16: Avoid Macros under Exceptions for this guideline they wrote:
For conditional compilation (e.g.,
system-dependent parts), avoid
littering your code with #ifdefs.
Instead, prefer to organize code such
that the use of macros drives
alternative…
I was just curious what coding standards people followed.
I for one use the following:
Brackets ALWAYS go on the next line. For instance:
int main()
{
//Blah...
}
I never use code folding. (Yes my IDE's do support it (Xcode and Eclipse).
Put related functions/methods single-spaced, otherwise double…
I'm a noob to Ubuntu, but not computers. I installed a full version of Ubuntu version 12 whatever it is. I run it on a machine that has Win7/Win8 on another hard drive. My wireless adapter is some tiny USB stick I got on eBay - it works great in Windows, but I can't get it to work in Ubuntu. More precisely, Ubuntu is…
Hi,
I'm pretty new to Python, and I want to develop my first serious open source project. I want to ask what is the common coding style for python projects. I'll put also what I'm doing right now.
1.- What is the most widely used column width? (the eternal question)
I'm currently sticking to 80 columns (and it's a…
Recently i found out that there is a thing called "coding dojo". The point behind it is that software developers want to have a space to
learn new stuff like processes, methods, coding details, languages, and
whatnot in an environment without stress. Just for fun. No competition.
No results required. No…
As programmers, we often take incredible pride in our skills and hold very strong opinions about what is 'good' code and 'bad' code.
At any given point in our careers, we've probably had some legacy system dropped in our laps, and thought 'My god, this code sucks!' because it didn't fit into our notion of…
...in percentage. For example 60/40 or 90/10 or 100/0.
My hypothesis is that the bigger the proportion of time you spend thinking the smaller your code can be as a result (and the less time will be needed to write it down). Think more, write less, in other words. Do you think it is true?
As a side note,…
Hello to the gaming community. I am a budding game designer, learning to code for the first time in my life. I did learned c++ in school, 8 years back, so I sort of understand the logic when people are doing coding and I can suggest them the right route also, but to an extent I can't code. I am beginning…
Personally I can't stand region tags, but clearly they have wide spread appeal for organizing code, so I want to test the temperature of the water for other MS developer's take on this idea.
My personal feeling is that any sort of silly trick to simplify code only acts to encourage terrible coding…
In no way shape or form am i advertising/promoting my programming style, but as far as 'multiple variable declarations' are concerned, which case is more acceptable professionally and commonly:
case 1:
private $databaseURL = "localhost" ;
private $databaseUName = "root" ;
private…
Okay, I have reached a sort of an impasse.
In my open source project, a .NET-based Oracle database browser, I've implemented a bunch of refactoring tools. So far, so good. The one feature I was really hoping to implement was a big "Global Reformat" that would make the code (scripts,…
Hi Guys.
In some part of my code I need something like this:
$product_type = $product->type;
$price_field = 'field_'.$product_type.'_price';
$price = $product->$$price_field;
In other words I need kind of KVC - means get object field by field name produced at the runtime.
I…
Hi all,
Is there a document describing how to name enumerations?
My preference is that an enum is a type. So, for instance, you have an enum
Fruit{Apple,Orange,Banana,Pear, ... }
NetworkConnectionType{LAN,Data_3g,Data_4g, ... }
I am opposed to naming it:
FruitEnum…
This maybe a controversial question and may not be suited for this forum (so I will not be insulted if you choose to close this question).
It seems given the current capabilities of Java there is no reason to make constructors public ... ever. Friendly, private, protected…
Hi,
I need huffman code(best in python or in java), which could encode text not by one character (a = 10, b = 11), but by two (ab = 11, ag = 10). Is it possible and if yes, where could i find it, maybe it's somewhere in the internet and i just can'd find it?
I vastly prefer coding to discussing coding style, just as I would prefer to write poetry instead of talking about how it should be written.
Sometimes the topic cannot be put off, either because some individual coder is messing up a shared code base and needs to be…
I'm in my first real job as programmer, but I can't solve any problems because of the coding style used. The code here:
Does not have comments
Does not have functions (50, 100, 200, 300 or more lines executed in sequence)
Uses a lot of if statements with a lot of…