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

13
votes
7answers
2k views

A defense for boilerplate?

To me, boilerplate code is obviously bad. However I've met a developer who displays resistance in any attempt to reduce boilerplate. I realized I didn't have a readily formed, well thought out ...
9
votes
3answers
447 views

How to gain personal practice at heavyweight development methodologies?

I'm in a new job where the project needs to meet strict quality standards, be heavily documented, managed in great detail, UML diagrams, and all those things that are opposite of "cowboy coding" where ...
4
votes
2answers
893 views

Manage query strings in JDBC methods

I am trying to find out which is the best practice when organising the PreparedStatement strings in a application which uses JDBC to connect to the database. Usually this is the way I retrieve the ...
5
votes
3answers
625 views

What should I consider when deciding if I should use a web service backend instead of traditional MVC?

We're trying to decide what architecture to use for an upcoming web application that will eventually have a mobile portion as well. The core of the project is a social networking web application, and ...
4
votes
5answers
329 views

Is it normal to feel like you forgot many things in language after a lapse? [closed]

I'm coming back to C++ after a month. I still didn't start practicing but seeing my old code gives me nauseous feeling like I'm seeing something new even with simple small code. Is this normal? Will ...
12
votes
2answers
2k views

Best overview to modern C++ paradigms?

I used to write C++ extensively between 8 and 10 years ago. I have since moved on to C# for professional reasons. However, from time to time I see statements like "If you're still manually ...
20
votes
9answers
6k views

Alternatives to the singleton pattern

I have read different opinions about the singleton pattern. Some maintain that it should be avoided at all costs and others that it can be be useful in certain situations. One situation in which I ...
8
votes
3answers
602 views

When comparing a combination of String literals, is it convention to call .equals() on the literal? [closed]

There are benefits to each, and I understand the differences - but what is considered best / standard practice? Why? "myString".equals(myStringVar) Avoids a potential NPE and does not require a ...
2
votes
11answers
311 views

Build functionality around the design, or the other way around?

When you build an application, is it better to design the UI first (in Photoshop or whatever), then implement the functionality following the UI you just designed, or do the programming and build the ...
4
votes
5answers
479 views

variable comparison without initialising

I am working with a project in VC++ which involves co-ordinate system having x,y,z axis. I am trying to check for if a variable(Point with x,y,z values) is assigned on the coordinate system or its a ...
2
votes
3answers
2k views

Any Course/Lecture videos on Design Patterns

I am planning to read some design patterns and I took the book on "design patterns in C++' by gang of four. However, I am not really some one who reads book and prefers reading slides/watching course ...
14
votes
4answers
891 views

Writing a company-wide developer's handbook

I work for a small company. The software development arm of the company before I was hired consisted of one self-taught overworked guy. Now that I've been writing software for the company for a few ...
-3
votes
1answer
637 views

Writing-Reading a hashtable to a text file

I'm implementing a hashtable structure for a dictionary. Dictionary is in a text file. There are 2 words on each line. I'm generating the hashtable by using the first word as a key. I'm holding the ...
18
votes
7answers
794 views

How to improve the training of students regarding maintainability?

Maintainability is a major stake of professional software development. Indeed, maintenance is nearly always the longest part of a software life cycle, as it lasts from the project release until ...
6
votes
2answers
248 views

Any recognized convention for repository changelogs?

We use TortoiseSVN, but we have no bug tracking system. I know, lame, but beyond my control. There were times when svn wasn't in daily use. Now I've had succeeded in pressing for using it regularly, ...
1
vote
1answer
769 views

Effective programming of data layer management/access

Short Version: What is the term/concept which describes the efficient design of programming the data layer for efficient data access and what are some sources/books/articles/website which discuss this ...
15
votes
6answers
5k views

Efficient try / catch block usage?

Should catch blocks be used for writing logic i.e. handle flow control etc? Or just for throwing exceptions? Does it effect efficiency or maintainability of code? What are the side effects (if there ...
4
votes
6answers
1k views

The bracketless if statement is frowned upon, but is it still bad style if your IDE is equipped for it?

This type of conditional statement is generally frowned upon if(condition) statement; because if you add another statement, like this if(condition) statement; statement; it gives the ...
6
votes
3answers
400 views

What is your approach to multi-paradigm programming?

I have been learning some Ruby recently and I had the following experience. I had written a small tool of about 200 lines of code and, as an inexperienced Ruby programmer, I had used several loops to ...
7
votes
5answers
464 views

For what reasons should I keep “using” section clean in C#?

Once when I was refactoring my code, I went up the IDE to the using section of my C# class, and cleaned unused namespaces and duplicate namespaces, and sorted them all. My pair (pair programming) ...
5
votes
5answers
1k views

How not to degenerate into only a programmer who stitches together APIs? [closed]

This one I heard when I was recently interviewing a person and asked him why he was looking for a change within an year of joining his previous company. Particularly a company which is known to be in ...
9
votes
5answers
1k views

When to stop inheritance?

Once upon time ago I asked a question on Stack Overflow about inheritance. I have said I design chess engine in OOP fashion. So I inherit all my pieces from Piece abstract class but inheritance still ...
3
votes
3answers
260 views

How to be productive as an infrequent programmer?

My current day job is mostly project management and client liaison work, but I sometimes get involved in actual coding. I do this either because I have a clear vision of what I want the result to look ...
5
votes
4answers
255 views

Should I include dependencies for which I have the source as projects in my solution?

We have various projects in source control for web and desktop applications. Invariably, many of them use third-party open source projects or even common libraries within our organization as ...
50
votes
11answers
11k views

What kind of problems does MapReduce solve?

I have been reading about MapReduce for a while -- but what I can't understand is how someone would make a decision to use (or not use) MapReduce. I mean, what are the problem patterns that signal ...
12
votes
5answers
3k views

Is monkeypatching considered good programming practice?

I've been under impression, that monkeypatching is more in quick and dirty hack category, rather than standard, good programming practice. While I'd used from time to time to fix minor issues with 3rd ...
3
votes
2answers
760 views

Lazy Processing of Streams

I have the following problem scenario: I have a text file and I have to read it and split it into lines. Some lines might need to be dropped (according to criteria that are not fixed). The lines ...
4
votes
8answers
496 views

Testing loses its effectiveness if all programmers don't use them

Let's assume you are convinced that the extra time spent unit testing has merit and improves production. Does that still hold up when everyone working on the same code doesn't use them? This question ...
8
votes
4answers
433 views

On improving commit practices

I was thinking about ways to improving my commit practices. Is there any co-relation between no. of source code lines and no. of commits? In a recent project that I was involved in, I was going at ...
8
votes
2answers
266 views

Low coupling processing big quantities of data

Usually I achieve low coupling by creating classes that exchange lists, sets, and maps between them. Now I am developing a Java batch application and I can't put all the data inside a data structure ...
17
votes
13answers
2k views

How often do experienced programmers have trouble getting their code to perform its intended purpose?

I'm kind of inexperienced with programming (ie less than a year) and I have recently been getting discouraged, mostly from not being able to solve problems with my own code (Not forgetting parentheses ...
2
votes
2answers
89 views

Standard way of allowing general XML data

I'm writing a data gathering and reporting application that takes XML files as input, which will then be read, processed, and stored in a strongly-typed database. For example, an XML file for a "Job" ...
4
votes
3answers
170 views

Is it more advantageous to write a program to test your code (ie a client) or just use the main portion of your program?

For instance if I had a program with a bunch of methods. public class Dog{ public boolean ishappy{..} public int weight{...} public static void main{ ...
7
votes
6answers
1k views

How to recover from finite-state-machine breakdown?

My question may seems very scientific but I think it's a common problem and seasoned developers and programmers hopefully will have some advice to avoid the problem I mention in title. Btw., what I ...
6
votes
4answers
742 views

Should injecting dependencies be done in the ctor or per method?

Consider: public class CtorInjectionExample { public CtorInjectionExample(ISomeRepository SomeRepositoryIn, IOtherRepository OtherRepositoryIn) { this._someRepository = ...
5
votes
6answers
1k views

Why is C++ backward compatibility important / necessary? [closed]

As far as I understand it is a wide-spread opinion within the C++ community that certain features of C++ (including some features inherited directly from C), while still usable in themselves, do not ...
5
votes
2answers
165 views

What are approaches for analyzing the cost-benefits of a development methodology?

There are many development practices (TDD, continuous integration, cowboy-coding), principles (SOLID, layers of abstraction, KISS), and processes (RUP, Scrum, XP, Waterfall). I have learned you can't ...
13
votes
9answers
1k views

Does your programming knowledge decrease if you don't practice? [closed]

I'm a novice programmer. I study languages such as C, C++, Python and Java (mainly focusing on C++). I'm what you'd call "young and inexperienced" and I admit that because I can't claim otherwise. ...
4
votes
3answers
2k views

URL Encryption vs. Encoding

At the moment non/semi sensitive information is sent from one page to another via GET on our web application. Such as user ID or page number requested etc. Sometimes slightly more sensitive ...
3
votes
3answers
192 views

To reorganize code, what to choose between library and service?

I want to reorganize a large application with lot of code duplication into multiple components. Plus, some code is also duplicated over other applications. The common set of functionality that can be ...
20
votes
7answers
2k views

while(true) and loop-breaking - anti-pattern?

Consider the following code: public void doSomething(int input) { while(true) { TransformInSomeWay(input); if(ProcessingComplete(input)) break; ...
54
votes
17answers
4k views

How to deal with tautology in comments?

Sometimes I find myself in situations when the part of code that I am writing is (or seems to be) so self-evident that its name would be basically repeated as a comment: class Example { /// ...
21
votes
11answers
2k views

Should I be concerned that I can't program very fast without Google? [duplicate]

Possible Duplicate: Google is good or bad for programmer? I'm currently in college to be a software engineer, and one of the main principles taught to us is how to learn for ourselves, and ...
7
votes
3answers
2k views

Should main method be only consists of object creations and method calls?

A friend of mine told me that, the best practice is class containing main method should be named Main and only contains main method. Also main method should only parse inputs, create other objects and ...
11
votes
9answers
5k views

if/else statements or exceptions [duplicate]

Possible Duplicate: Defensive Programming vs Exception Handling? I don't know, that this question fit better on this site, or Stack Overflow, but because my question is connected rather to ...
2
votes
2answers
104 views

User input and automated input separation

I have a MySQL database and an automation script which modifies the data inside once a day. And these columns may have changed by an user manually. What is the best approach to make the system only ...
0
votes
5answers
910 views

Do I have to write a lot of boilerplate code if I keep working using Java? [closed]

I'm working for a company writing ERP applications. My problem is that I have to write tons of boilerplate code. I came up with ideas to automatize/prevent the drudgery but only some of them were ...
143
votes
22answers
13k views

How would you know if you've written readable and easily maintainable code?

How would one know if the code he has created is easily maintainable and readable? Of course in your point of view (the one who actually wrote the code) your code is readable and maintainable, but we ...
2
votes
1answer
125 views

A job role where connection with other developers along with writing code

Is there a position in companies (and which ones?) where the role is writing some code along with going on to the seminars to connect with other developers who maybe the clients of your/company's ...
1
vote
2answers
566 views

Is it better to build HTML Code string on the server or on the client side?

The result of the following process should be a html form. This form's structure varies from one to user. For example there might be a different number of rows or there may be the need for rowspan and ...