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

0
votes
3answers
1k views

Key bindings war in my brain

How many key bindings are there in your brain? I personally use Intellij Idea as my primary IDE for development, but sometimes switch to Eclipse and Netbeans a bit, and sometimes I use ...
6
votes
5answers
2k views

Spartan programming… What is it good for? [closed]

We are being forced to use Spartan programming on a project, to everybody's dismay. So I get it, it makes the methods really short and it handles the simple cases first. But is it really worth the ...
15
votes
13answers
4k views

Is using ELSE bad programming? [closed]

I've often come across bugs that have been caused by using the ELSE construct. A prime example is something along the lines of: If (passwordCheck() == false){ displayMessage(); }else{ ...
22
votes
18answers
7k views

What should be the maximum length of a function? [closed]

What should be the maximum length of a function? And are there cases which are an exception to this?
0
votes
5answers
386 views

Deciding factors in pair programming

Are there specific things that you look out for before getting the team into pair programming? Obviously pairing someone who's great with C++ with another who knows ASP.NET best won't get me far, but ...
3
votes
3answers
373 views

How much to “automatically” do?

I'm reading Code Complete 2, and I'm at the chapter where it says to (paraphrasing) "avoid programming through the interface." Why is it bad to program "through" the interface? A more concrete ...
8
votes
2answers
3k views

UI automation patterns and best practice for desktop applications

Background I'm currently automating some tests for a plugin for MS Office. We are creating Coded UI tests in VS 2010. I suppose I could use the "Coded UI test builder" tool, but it does not really ...
4
votes
6answers
290 views

Coding style - define fields separate or not

Some use this convention: private String event; public getEvent() { return this.event; } public setEvent(String value) { this.event = value; } private int id; ... same as above ... In some ...
19
votes
12answers
626 views

Refactor or Concentrate on Completing App

Would you refactor your app as you go or focus on completing app first? Refactoring will mean progress of app app will slow down. Completing app will mean you get a possibly very hard to maintain app ...
12
votes
12answers
1k views

What do programmers “micro-optimize” for today? [closed]

Back in the "good ol' days," when we would copy shareware onto floppies for friends, we also used a fair bit of assembly. There was a common practice of "micro-optimization," where you would stare and ...
8
votes
3answers
2k views

Is there a good reason to use Java's Collection interface?

I've heard the argument that you should use the most generic interface available so that you're not tied to a particular implementation of that interface. Does this logic apply to interfaces like ...
8
votes
11answers
602 views

Should my colleagues review each others code from source control system?

So that's my story: one of my colleagues uses to review all the code, hosted to revision system. I'm not speaking about adequate review of changes in parts that he belongs to. He watches the code file ...
49
votes
6answers
32k views

Method vs Function vs Procedure

Simple question, but I often hear these three terms defined with such ferocity, but which have been known to me to mean different things over the years. What are the "correct" definitions of ...
6
votes
4answers
798 views

How to deal with complex codes in (huge) projects

I am preparing a memoir about "Why do (some) IT projects become too complex and how to avoid it ?". If you have ever encountered projects having complex codes or were hard to maintain, how did you ...
6
votes
1answer
359 views

About compilers, coding, large code bases, and some other stuff too

This is not purely a programming question. I work in a large company. We have lots of code written in C++ language: Multiple simultaneous projects in progress and implementations that have to be ...
5
votes
6answers
312 views

Is Extreme Programming (XP) the best way of learning from experts? [closed]

I have been involved in many development models, and have found XP to be the best for a new programmer from the aspect of learning, as the collaboration between the team members is very high and the ...
5
votes
2answers
1k views

What's the proper way to exit program in C?

There are many ways how to exit program in C. Some of them are returning zero or error code, using exit function with EXIT_SUCCESS, EXIT_FAILURE, exit(0), exit(1) or some other error code, abort and ...
10
votes
6answers
1k views

What software do you use to help plan your team work, and why?

Planning is very difficult. We are not naturally good at estimating our own future, and many cognitive biases exacerbate the problem. Group planning is even harder. Incomplete information, ...
4
votes
7answers
424 views

Not specifying a return in a function, good or bad?

I have coded like this many times, and I've never encountered an issue, but the compiler always warns when it expects a return and there is none. For instance, look at this: -(NSString ...
9
votes
3answers
2k views

Exceptions or Error codes

We are building a web service(SOAP, .Net) which would be talking to (mostly) native clients (windows, C++) and we are wondering what is the best way to communicate errors to the client (e.g. ...
19
votes
9answers
983 views

Tips on persuading boss that code review is a good thing [closed]

Let's say one works in a hypothetical company that has several developers that rarely worked together on projects and the Boss didn't believe that code reviews are worth the time and cost. What are ...
12
votes
5answers
771 views

When to start writing Exception Handling, Logging

When do you start writing your Exception Handling Code? When do you start writing Logging Statements. For the purpose of elaborating this question, let us assume that we are on .NET platform with ...
11
votes
5answers
2k views

“Forgot Password” - How to handle this?

I read this answer and found a comment insisting not to send password by email: passwords should not be able to be retrieved by email, I hate that. It means my password is stored in plain text ...
19
votes
9answers
2k views

How to teach Exception Handling for New Programmers? [closed]

How do you go about teaching Exception Handling to Programmers. All other things are taught easily - Data Structures, ASP.NET, WinForms, WPF, WCF - you name it, everything can be taught easily. With ...
11
votes
7answers
794 views

Which specific practices could be called “software craftsmanship” rather than “software engineering”? [closed]

Although not a new idea there seems to have been a big increase in the interest in software craftsmanship over the last couple of years (notably the often recommended book Clean Code's full title is ...
7
votes
1answer
306 views

String class based on graphemes?

I'm wondering why we don't have some string classes that represent a string of Unicode grapheme clusters instead of code points or characters. It seems to me that in most applications it would be ...
11
votes
12answers
2k views

Maintainability of Boolean logic - Is nesting if statements needed?

Which of these is better for maintainability? if (byteArrayVariable != null) if (byteArrayVariable .Length != 0) //Do something with byteArrayVariable OR if ((byteArrayVariable != ...
5
votes
12answers
395 views

What are your initial three steps when you are first presented with a software problem? [closed]

I am curious about the very early steps that a programmer's mind takes when it first encounters a problem that it is supposed to solve. How do you start reasoning about it ? What are the first ...
15
votes
9answers
834 views

How common are “bandage” fixes? [closed]

Imagine the following scenario: You've detected that your (or someone else's) program has a bug - a function produces the wrong result when given a particular input. You examine the code and can't ...
1
vote
7answers
570 views

Would you use UML if it kept stakeholders from requesting changes frequently? [closed]

As much as programmers hate to document their code/system and draw UML (especially, Sequencing, Activity and State machine diagrams) or other diagramming notation, would you agree to do it if it kept ...
10
votes
3answers
209 views

Unit tests, write them before or after the framework? [closed]

This is my first question here, so i'll make it short and to the point. When Writing unit tests, should you write them before or after you have made the underlying framework for them? This came up in ...
25
votes
5answers
9k views

Are there any major alternatives to Waterfall and Agile? [closed]

I am curious if anyone knows of any methodologies that are significantly different (not a recombination) and I would especially appreciate anyone who brought forward any experience with alternatives.
85
votes
17answers
27k views

How to visualize code? [closed]

I've mostly only had to read my own code. As such, I've had no need to visualize the code as I already know how each and every class and module communicate with one another. But the few times I've ...
17
votes
12answers
1k views

Commented short fancy code vs. uncommented longer easy-to-understand code - which is preferred?

Sometimes an algorithm can be written in two ways: The short, fancy way; or The longer, easy-to-understand way. For example, here is a longer, easier way of copying a string source to dest in C: ...
7
votes
6answers
2k views

Do you handle Out-Of-Memory conditions?

What do you do when malloc returns 0 or new throws exception? Just halt or try to survive OOM condition/save the user's work?
21
votes
8answers
2k views

How did you become a const correctness convert? [closed]

After 15 years of C++, I've still haven't learn to love using const. I understand it's use, but I've never actually been in situation where being const correct would have avoided the problem I was ...
12
votes
4answers
792 views

Which web site gives the most accurate indication of a programmer's capabilities?

If you were hiring programmers, and could choose between one of (say) the top 100 coders on topcoder.com, or one of the top 100 on stackoverflow.com, which would you choose? At least to me, it would ...
14
votes
10answers
851 views

How do you normally layout a class's regions?

I was wondering if there was a standard for laying out a class's regions. I currently use Fields Constructor Properties Public Methods Private Methods Fields being Private Properties and ...
3
votes
3answers
71 views

Getting a coherent view of the state of the data

Here is a theoretical problem. It could apply to many systems. Let's assume RESTful Web services for example. You want to find out something but as it happens you can't get it in a single query. ...
35
votes
8answers
2k views

Is Linq having a mind-numbing effect on .NET programmers?

A lot of us started seeing this phenomenon with jQuery about a year ago when people started asking how to do absolutely insane things like retrieve the query string with jQuery. The difference ...
13
votes
17answers
512 views

What do you consider to be the prime cause of software defects (and how to minimize them) [closed]

I define defect as : "something within the application design or code which prevents it functioning as per requirements." I'm looking for ideas about the causes of defects, eg the human factor, ...
11
votes
9answers
463 views

What mistakes do your users make, and how can you update your application to handle them? [closed]

In fact this question is about cautions to be taken to enhance quality user experience and reduce avoidable support calls.
24
votes
11answers
2k views

Is it okay to use a language that isn't supported by your company for some tasks?

I work for a company that supports several languages: COBOL, VB6, C# and Java. I use those languages for my primary work, but I often find myself to coding some minor programs (e.g. scripts) in Python ...
8
votes
2answers
2k views

5 things before starting a project? [closed]

What are the first 5 things you do before starting a new project? Do you always spend a day researching new frameworks? Or, using similar or competing products?
22
votes
13answers
5k views

Why isn't literate programming mainstream? [closed]

Literate programming has good ideals. Why do you think that this isn't mainstream? It is because it has failed to deliver?
29
votes
5answers
2k views

Test driven development - convince me! [closed]

I know some people are massive proponents of test driven development. I have used unit tests in the past, but only to test operations that can be tested easily or which I believe will quite possibly ...
14
votes
10answers
1k views

Will correctness proofs of code ever go mainstream? [closed]

All but the most trivial programs are filled with bugs and so anything that promises to remove them is extremely alluring. At the moment, correctness proofs are code are extremely esoteric, mainly ...
16
votes
12answers
6k views

Is it ever worthwhile using goto?

Goto is almost universally discouraged. Is this statement every worthwhile using?
22
votes
12answers
3k views

Should developers be forced to check-in before leaving work each day, even if the code does not compile? [closed]

During a previous consulting position, the developers where told to check-in code on a nightly basis, regardless if it complied or was complete. Managers were afraid of losing any code and said now we ...