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

19
votes
9answers
492 views

Which software development practices would you recommend non-programmers implement in their fields of work? [closed]

Say you had to give a talk to non-programmers who were looking to learn something from software development that they could apply to their own functions. Question: What practices would you preach? ...
19
votes
12answers
574 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 ...
19
votes
5answers
583 views

Is staying implementation agnostic really worth it?

I have a project that I'm working on currently using Tomcat, Spring 4, Spring Security, MySQL, and JPA w/ Hibernate. I picked JPA from the standpoint that it's suppose to make swapping out the ...
19
votes
3answers
13k views

Which is a better practice - helper methods as instance or static?

This question is subjective but I was just curious how most programmers approach this. The sample below is in pseudo-C# but this should apply to Java, C++, and other OOP languages as well. Anyway, ...
19
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; ...
19
votes
5answers
1k views

How to avoid giant glue methods?

In my current job, I've been tasked with cleaning up old code a few times. Often the code is a labyrinth and the data behind it is even more tangled. I find myself combing out things into nice, ...
18
votes
9answers
2k views

Definition of a Software bug. Blizzard Entertainment insists that my “bug” is not a bug at all. Are they right? [closed]

According to Wikipepdia, A software bug is the common term used to describe an error, flaw, mistake, failure, or fault in a computer program or system that produces an incorrect or unexpected ...
18
votes
12answers
6k views

Is it possible to reach absolute zero bug state for large scale software?

I am talking about 20-30+ millions lines of code, software at the scale and complexity of Autodesk Maya for example. If you freeze the development as long as it needs to be, can you actually fix all ...
18
votes
9answers
2k views

Procedural Code vs OOP code

I've finished a project in PHP of 13000+ lines in Procedural Style [because I'm very familiar with that, though I know OOP], and the project is running perfectly. But should I convert it to OOP? ...
18
votes
8answers
2k views

Is it normal for a programmer to not have 100% clarity over their own code at times? [closed]

I'm not an expert programmer so this may be why, but I've come to notice that whenever I create complex code (like a Chess game I recently made), I am able to write the correct code to get the program ...
18
votes
3answers
2k views

Is it good to review programs with seniors and boss even if it is working fine?

In my company, before delivery of any project, my boss asks my seniors to review programs written by me or other team members or sometimes boss also sits with us for review. I think it is a good way ...
18
votes
7answers
1k views

How to become a good team player?

I've been programming (obsessively) since I was 12. I am fairly knowledgeable across the spectrum of languages out there, from assembly, to C++, to Javascript, to Haskell, Lisp, and Qi. But all of ...
18
votes
5answers
1k views

Progressive Enhancement vs. Single Page Apps

I just got back from a conference in Boston called An Event Apart. A really popular theme amongst the speakers was the idea of progressive enhancement - a site's content should go in the HTML, and ...
18
votes
7answers
780 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 ...
18
votes
1answer
907 views

How often is seq used in Haskell production code?

I have some experience writing small tools in Haskell and I find it very intuitive to use, especially for writing filters (using interact) that process their standard input and pipe it to standard ...
17
votes
16answers
2k views

Do Programmers sometimes intentionally over complicate code? [closed]

It seems alot of times on stackoverflow, that people (programmers especially) tend to over complicate a solution to a problem to where the solution is vastly much more complicated then the original ...
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 ...
17
votes
4answers
2k views

Why is test driven development missing from Joel's Test?

I was reading this blog by Joel Spolsky about 12 steps to better code. The absence of Test Driven Development really surprised me. So I want to throw the question to the Gurus. Is TDD not really worth ...
17
votes
5answers
2k views

Descriptive naming vs. 80 character lines [closed]

I frequently hear these two valuable programming practices: (1) lines of code should be 80 characters or less and (2) use descriptive names for variables, methods, classes, etc. I understand the ...
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: ...
17
votes
3answers
3k views

What are combinators and how are they applied to programming projects? (practical explanation)

What are combinators? I'm looking for: a practical explanation examples of how they are used examples of how combinators improve the quality/generality of code I'm not looking for: explanations ...
16
votes
19answers
1k views

What programming skill do you use most often that you are terrible at? [closed]

What are the techniques that you use just about everyday, but are still awful at? Are you bad at it because of the difficulty of the task, laziness to learn better, or some other reason?
16
votes
10answers
3k views

What are the best practices regarding unsigned ints?

I use unsigned ints everywhere, and I'm not sure if I should. This can be from database primary key id columns to counters, etc. If a number should never be negative, then I will always used an ...
16
votes
5answers
5k views

When and why you should use void (instead of i.e. bool/int)

I occasionally run into methods where a developer chose to return something which isn't critical to the function. I mean, when looking at the code, it apparently works just as nice as a void and after ...
16
votes
4answers
2k views

Is the “Gets or sets ..” necessary in XML documentation of properties?

I am looking for a recommendation of a best practice for XML comments in C#. When you create a property, it seems like that the expected XML documentation has the following form: /// <summary> ...
16
votes
5answers
697 views

Reconciling contradictory programming advice: get something working and iterate vs. really think it through before coding

I am an intermediate programmer with a few years of professional experience who is halfway through a masters degree. In learning to program I've often heard two pieces of seemingly contradictory ...
15
votes
13answers
3k 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{ ...
15
votes
12answers
4k views

Is it ever worthwhile using goto?

Goto is almost universally discouraged. Is this statement every worthwhile using?
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 ...
15
votes
7answers
1k views

Should I refactor large functions that mostly consist of one regex? [closed]

I just wrote a function that spans approximately 100 lines. Hearing that, you are probably tempted to tell me about single responsibilities and urge me to refactor. This is my gut instinct as well, ...
15
votes
5answers
3k 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 ...
15
votes
9answers
706 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 ...
15
votes
8answers
1k 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 ...
15
votes
3answers
3k views

What is the meaning of 'high cohesion'?

I am a student who recently joined a software development company as an intern. Back at the university, one of my professors used to say that we have to strive to achieve "Low coupling and high ...
15
votes
5answers
8k views

What are the pros and cons of HTML5, native and hybrid mobile app approaches?

I want to develop a mobile application .. I read lately an article on Telerik Forum : it compares among three types of mobile application and I don't know which one should I select to begin with .. ...
15
votes
4answers
764 views

Can applications affect power consumption in a substantial way?

Is there anything that can be done for a single general purpose application to affect the power consumption of the device it is running on? I am not familiar with how optimizations to individual ...
14
votes
11answers
837 views

Is it efficient to attach a comment on every function?

I moved to this company recently, and my first reaction of the development process leaves me with doubts. Here is where I really doubt the efficiency: Every single function must have Javadoc style ...
14
votes
10answers
933 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 ...
14
votes
10answers
3k views

Preferring Python over C for Algorithmic Programming

I've been studying a bit of algorithms and have been looking at sites like SPOJ.pl TopCoder etc. I've seen that programmers prefer C or C++ usually for most algorithmic programming contests. Now ...
14
votes
7answers
1k views

How did you become a const correctness convert?

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 ...
14
votes
10answers
798 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 ...
14
votes
2answers
644 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 ...
14
votes
4answers
806 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 ...
14
votes
2answers
666 views

Which is better: a bunch of getters or 1 method with a selection string parameter?

Our knowledge domain involves people walking over a pressure-recording plate with their bare feet. We do image recognition which results in objects of the 'Foot' class, if a human foot is recognized ...
13
votes
11answers
922 views

How do you keep track of the authors of code? [closed]

This is something I was never taught. I have seen alot of different types of authoring styles. I code primarily in Java and Python. I was wondering if there was a standard authoring style or if ...
13
votes
12answers
1k views

What to do with a not well organized application? [duplicate]

I'm a newly graduate programmer and just got hired before my graduation. In the office, I used to create and revise modules of some applications developed by other programmers in our company. The ...
13
votes
14answers
2k views

Can a candidate be judged by asking to write a complex program on “paper”?

Sometime back in an interview, I was asked to write following program: In a keypad of a mobile phone, there is a mapping between number and characters. e.g. 0 & 1 corresponds to nothing; 2 ...
13
votes
17answers
476 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, ...
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. ...
13
votes
4answers
1k views

What is the limit to the number of a class methods?

In different design books that I read, sometimes big emphasis is put on the number of methods that a class must have (considering an OO language, as java or C# for instance). Often the examples ...