Programming Practices are the commonly or not so commonly used practices in development of software. These can include things like Agile Development, Kanban, Coding shortcuts, etc.

learn more… | top users | synonyms

6
votes
3answers
205 views

Holding mutable data in a single place

Given a mutable property, it generally makes sense to only hold/store that property in a single place. When the data needs to change you only need to update a single field, and you can completely ...
3
votes
1answer
182 views

serving static or dynamic web-content based on user group

I need help understanding a problem I have, and that others surely have had as well. I'm working on a web-application that allows users to interface with a database. The application in general has ...
8
votes
2answers
606 views

Can I ask the job interviewer to show me their code before joining the company? [duplicate]

Possible Duplicate: Asking for a code sample of the company at an interview Last year I changed jobs twice.. In the interviews with the companies, everything was so ideal and perfect. Latest ...
4
votes
1answer
467 views

How to handle the input file provided in programming contests?

In programming contests like Google CodeJam, Facebook Hacker Cup, each question is provided with an input file for testing one's code for that program. I get struck at this point only. I don't ...
2
votes
3answers
428 views

Does the use of personas in Agile have any value during implementation?

This is about the use of personas, primarily in the agile development realm. What value, if any, do personas give during implementation? On agile modeling, the discussion about personas remains in ...
19
votes
5answers
5k views

Is every number in the code considered a “magic number”?

So every number in the code that we are sending to a method as an argument is considered as a Magic Number? To me, it shouldn't. I think if some number is let's say it is for minimum length of user ...
5
votes
3answers
841 views

How can I create and manage permissions more dynamically?

I want to implement a security system into my web-based Intranet application which allows security administrators to 'fine-tune' exactly what type of access a user/role has to an object. For example, ...
43
votes
9answers
16k views

Should the methods of a class call its own getters and setters?

Where I work I see lots of classes that do things like this: public class ClassThatCallsItsOwnGettersAndSetters { private String field; public String getField() { return field; }...
9
votes
4answers
3k views

What are the differences between algorithms using data structures and algorithms using databases?

The General Question What are the differences between algorithms using data structures and algorithms using databases? Some Context This is a question that has been bugging me for some time, and I ...
3
votes
1answer
2k views

How to create view models - Constructor, Factory Method, …?

I'm trying to lead a charge for re factoring our rather bloated controllers. We currently have a BaseModel from which all our other models inherit. The BaseModel contains things common to all pages, ...
0
votes
2answers
175 views

Custom error handling

I'm trying to figure out the best way to handle custom errors in my application. Option 1: if(expr) { } else { $_SESSION['error'] = "Some message describing the error"; } Option 2: if(expr) { ...
8
votes
3answers
441 views

Would it be better to have extra checks, or would it be a waste of time? [duplicate]

In your opinion, do you think it is a waste of time to make checks that you know there is no possible way of it being there/not being there, or would you just put it there just in case there is a bug ...
1
vote
1answer
1k views

Static Tables vs Dynamic Entity Attributes Storage Configurations

I am trying to figure out a better way to decide table storage configurations whether it will use static configurations using tables or dynamic configurations using EAV (entity-attribute-value) When ...
1
vote
1answer
217 views

How does a competition like Rails Rumble Work?

I am not sure weather it is a proper question to ask out here but it is really bothering for a while. As the official website writes: The Rails Rumble is a distributed programming competition ...
4
votes
2answers
4k views

JavaScript and callback nesting

A lot of JavaScript libraries (notably jQuery) use chaining, which allows the reduction of this: var foo = $(".foo"); foo.stop(); foo.show(); foo.animate({ top: 0 }); to this: $(".foo").stop()....
8
votes
7answers
824 views

Is it appropriate for a class to only be a collection of information with no logic?

Say I have a class Person that has instance variables age, weight, and height, and another class Fruit that has instance variables sugarContent and texture. The Person class has no methods save ...
5
votes
3answers
788 views

Multiple parameters vs single parameter(object with multiple properties)

I have an Entity Student with following properties - (name, joinedOn, birthday, age, batch, etc.) and a function fetchStudents(<params>). I want to fetch students based on multiple filters. In ...
10
votes
7answers
6k views

Is it a bad practice to include all the enums in one file and use it in multiple classes?

I'm an aspiring game developer, I work on occasional indie games, and for a while I've been doing something which seemed like a bad practice at first, but I really want to get an answer from some ...
173
votes
17answers
11k views

How do you balance between “do it right” and “do it ASAP” in your daily work? [closed]

I find myself pondering over this question from time to time, again and again. I want to do things the right way: to write clean, understandable and correct code that is easy to maintain. However, ...
4
votes
3answers
568 views

What is the best practice, point of view of well experienced developers [closed]

My manager pushes me to use his self defined best practices. All of these practices are based on is own assumptions. I disagree with them and I would like to have some feedback of well experienced ...
1
vote
3answers
1k views

When should one use “out” parameters?

In Objective-C, there are several methods like initWithContentsOfFile:encoding:error: where one passes in a reference to an NSError object for the error: parameter. In this example, the value of the ...
2
votes
3answers
88 views

Location of development solutions on disk - Common or upto the individual

In our team meeting today a senior member brought up the proposal that we should be having a common location/structure for our development solutions. A couple of his points were: Making it common ...
0
votes
2answers
117 views

Necessary Infrastructure for large project with many components communicating through IPCs

I have a fairly in depth question which probably doesn't have an exact answer. As a software engineer, I am usually tasked with working on a program or project with minimal understanding of how other ...
9
votes
9answers
1k views

Tips or techniques to use when you don't know how to code something? [closed]

I have a background as UI designer. And I realized that it is a bit hard for me to write a pieces of logic. Sometimes I get it right, but most of the time, I end up with something hacky (and it ...
5
votes
2answers
2k views

What are the benefits vs costs of comment annotation in PHP?

I have just started working with symfony2 and have run across comment annotations. Although comment annotation is not an inherent part of PHP, symfony2 adds support for this feature. My ...
5
votes
6answers
903 views

Is it bad to be the only person supporting software you have developed?

My employer has a need for a web-based application to manage and share data within the department, with approximately 50-75 possible users. I feel I have the ability to write it for them. I would ...
6
votes
2answers
10k views

Naming convention: field starting with “m” or “s”

I saw lot of code (for example some Android source code) where fields name start with a m while static fields start with s Example (taken from Android View class source): private SparseArray<...
10
votes
3answers
5k views

Child to Parent linking - bad idea?

I have a situation where my parent knows about it's child (duh) but I want the child to be able to reference the parent. The reason for this is that I want the child to have the ability to designate ...
5
votes
4answers
2k views

Learning by doing (and programming by trial and error) [closed]

How do you learn a new platform/toolkit while producing working code and keeping your codebase clean? When I know what I can do with the underlying platform and toolkit, I usually do this: I create ...
28
votes
12answers
3k views

Why should a class be anything other than “abstract” or “final/sealed”?

After 10+ years of java/c# programming, I find myself creating either: abstract classes: contract not meant to be instantiated as-is. final/sealed classes: implementation not meant to serve as base ...
8
votes
3answers
968 views

how to programtically build a grid of interlocking but random sized squares

I want to create a two dimensional layout of rectangular shapes, a grid made up of random sized cubes. The cubed should fit together and have equal padding or margin (space between). Kind of like a ...
8
votes
3answers
406 views

Is there such a concept as “pseudo implementation” in software development?

I'm looking for a label to describe the practice of using human-based computation methods or other means of "faking" an algorithm for the sake of getting a product or demo off the ground quickly ...
14
votes
2answers
943 views

Build one to throw away vs Second-system effect

On one hand there is an advice that says "Build one to throw away". Only after finishing a software system and seeing the end product we realize what went wrong in the design phase and understand how ...
1
vote
3answers
305 views

Programming C++ using Qt4 [closed]

Hey guys I am really new to the C++ programing I have a little knowledge in C and a bit more in C++, but I do not know them enough to call myself a programmer. I am working as a PHP Web Developer I ...
6
votes
2answers
270 views

What would be a non-contrived reason to have an object with Private Copy Constructor as well as Assignment Operator?

Looking for non-conceptual/non-contrived reasons of when one would need to use an object with both a private copy constructor and a private assignment operator? As in what problem does this technique/...
13
votes
2answers
2k views

What is the best approach for inline code comments?

We are doing some refactoring to a 20 years old legacy codebase, and I'm having a discussion with my colleague about the comments format in the code (plsql, java). There is no a default format for ...
11
votes
13answers
3k views

Dealing with curly brace soup

I've programmed in both C# and VB.NET for years, but primarily in VB. I'm making a career shift toward C# and, overall, I like C# better. One issue I'm having, though, is curly brace soup. In VB, ...
7
votes
3answers
543 views

Does studying other people's programs help in self growth? [closed]

Should I be studying big softwares written by other people in our company? My work may be a small sub module on the top of that software, and I may not be required to know what goes beneath the hood, ...
6
votes
3answers
2k views

Exception Handling Frequency/Log Detail

I am working on a fairly complex .NET application that interacts with another application. Many single-line statements are possible culprits for throwing an Exception and there is often nothing I can ...
8
votes
6answers
726 views

How to write good code with new stuff? [closed]

I always try to write easily readable code that is well structured. I face a particular problem when I am messing around with something new. I keep changing the code, structure and so many other ...
1
vote
6answers
2k views

Learning good OOP design and unlearning some bad habits [duplicate]

Possible Duplicate: What books or resources would you recommend to learn practical OO design and development concepts? I have been mostly a C programmer so far in my career with knowledge of C+...
3
votes
3answers
233 views

What is the best practice for when to check if something needs to be done?

Let's say I have a function that does x. I pass it a variable, and if the variable is not null, it does some action. And I have an array of variables and I'm going to run this function on each one. ...
9
votes
3answers
838 views

Are XML Comments Necessary Documentation?

I used to be a fan of requiring XML comments for documentation. I've since changed my mind for two main reasons: Like good code, methods should be self-explanatory. In practice, most XML ...
15
votes
8answers
2k views

Is perfectionism a newbie's friend or enemy? [duplicate]

Possible Duplicate: Where do you draw the line for your perfectionism? I see that the development community is very focused on doing things the right way and personally I would like to do the ...
1
vote
2answers
330 views

Should HTTP Verbs Be Used Semantically?

If I'm making a web application which integrates with a server-side backend, would it be considered best practice to use HTTP methods semantically? That is, for example, if I'm fetching data (e.g., to ...
7
votes
6answers
2k views

Refactoring and Open / Closed principle

I have recently being reading a web site about clean code development (I do not put a link here because it is not in English). One of the principles advertised by this site is the Open Closed ...
34
votes
15answers
5k views

Why use other number bases when programming

My coworkers and I have been bending our minds to figuring out why anyone would go out of their way to program numbers in a base other than base 10. I suggested that perhaps you could optimize longer ...
4
votes
3answers
521 views

What kind of process should I use to learn a big system? [duplicate]

Possible Duplicate: How do you dive into large code bases? I just joined a new company and started to study one of the their bigger system. For me to be productive, I need to understand the ...
6
votes
5answers
800 views

Everything has an Interface [duplicate]

Possible Duplicate: Do I need to use an interface when only one class will ever implement it? I am taking over a project where every single real class is implementing an Interface. The vast ...
3
votes
6answers
711 views

Is it a bad practice to write shell script with many if-else statment and for loops?

I am maintaing several data process shell scripts which are full of if-else statements and for loops . I try to make the scritps tidy and easy to debug. When I read some suggestions about shell code ...