Questions tagged [programming-practices]

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.

Filter by
Sorted by
Tagged with
8 votes
1 answer
820 views

What benefits do I get from learning Scheme? [closed]

I'm a java programmer and I've decided to learn a bit about theoretical computer science. I don't have a degree in that and a little background would help me a lot since I don't know anything other ...
3 votes
3 answers
3k views

Code to simulate a users actions, such as logging in

I've recently begun working on a PHP application, replacing another developer. I believed the application was using an API to communicate with a remote service but when I looked through the code I ...
  • 700
44 votes
11 answers
28k views

Logging: Why and What? [closed]

I've never written programs which make significant use of logging. The most I've done is to capture stack traces when exceptions happen. I was wondering, how much do other people log? Does it depend ...
49 votes
14 answers
76k views

Do most programmers copy and paste code? [closed]

I learned very early on that cutting & pasting somebody else's code takes longer in the long run that writing it yourself. In my opinion unless you really understand it, cut & paste code will ...
3 votes
1 answer
1k views

What source code organization approach helps improve modularity and API/Implementation separation?

Few languages are as restrictive as Java with file naming standards and project structure. In that language, the file name must match the public class declared in the file, and the file must live in ...
0 votes
3 answers
313 views

Most commonly forgotten thing to do when programming/web developing [closed]

Does anyone else have that one thing they always forget to do when programming or developing a website? Personally mine is forgetting to include the Doctype in a website...the amount of time i have ...
15 votes
11 answers
17k 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 ...
  • 2,084
45 votes
16 answers
13k views

Are there concrete reasons not to use libraries and code snippets heavily? [closed]

Overall I'm in programming for about 8 years now and it seems to me that I'm relying more and more on open source libraries and snippets (damn you GitHub!) to "get the job done". I know that in time I ...
7 votes
3 answers
10k views

Defensive Programming Techniques [closed]

I was attempting to identify an element of software engineering that I think is overlooked, not emphasized or not taught in typical undergraduate course work for CS or SE. What I came up is the ...
  • 5,375
32 votes
17 answers
11k views

Am I copy/paste programmer? [duplicate]

When ever I am stuck with a particular problem, I search for a solution in Google. And then I try to understand the code and tweak it according to my requirement. For example recently I had asked a ...
13 votes
5 answers
1k views

What happened to Alan Cooper's Unified File Model?

For a long time Alan Cooper (in the 3 versions of his book "About Face") has been promoting a "unified file model" to, among other things, dispense with what he calls the most idiotic message box ever ...
4 votes
3 answers
3k views

Beginner need help on learning Qt programming [closed]

Thought of learning Qt. Need help from experienced ones out here. How should I begin. Some good books to refer. Some good tutorials to learn... Edit: Also which is the good IDE available out there ...
12 votes
0 answers
650 views

How do you dive into a big ball of mud? [duplicate]

Possible Duplicate: How do you dive into large code bases? So there is a question about understanding code. Mine is a similar problem. It started when I joined my current org. and like I always ...
  • 3,679
23 votes
17 answers
14k views

Why are regular expressions so morbidly attractive?

Exhibit 1, Exhibit 2, I guess you won't find it hard to recall other examples. Thing is: if there is more than one way to solve a problem, the PHP programmer (I usually browse the PHP tag on ...
2 votes
4 answers
3k 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 Jedit,Notepad++,...
  • 137
8 votes
5 answers
4k 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 ...
19 votes
13 answers
16k 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{ ...
  • 6,529
50 votes
18 answers
42k views

What is proven as a good maximum length of a function? [closed]

Does function length affect the productivity of a programmer? If so, what is a good maximum number of lines to avoid productivity loss? Since this is a highly opinionated topic please back up the ...
0 votes
5 answers
437 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 ...
  • 7,533
3 votes
3 answers
397 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 ...
  • 335
9 votes
2 answers
4k 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 ...
5 votes
6 answers
311 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 ...
  • 245
23 votes
11 answers
797 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 ...
  • 2,251
14 votes
12 answers
2k 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,222
12 votes
3 answers
8k 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 java....
  • 639
9 votes
11 answers
717 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 ...
126 votes
6 answers
160k 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 "...
126 votes
27 answers
10k views

What are the worst false economies in software development? [closed]

What are the worst false economies (that is ways of saving money that ultimately cost more than they save) prevalent in the software industry and how do you combat them?
9 votes
4 answers
3k 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 ...
  • 91
5 votes
6 answers
405 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 ...
6 votes
2 answers
3k 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 ...
  • 573
11 votes
6 answers
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, ...
  • 5,742
4 votes
7 answers
452 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 *)...
  • 141
12 votes
3 answers
3k 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. ...
  • 1,952
21 votes
9 answers
1k 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 ...
  • 3,426
13 votes
5 answers
949 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 ...
  • 2,238
18 votes
5 answers
7k 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 ...
  • 3,103
99 votes
45 answers
28k views

What popular "best practices" are not always best, and why? [closed]

"Best practices" are everywhere in our industry. A Google search on "coding best practices" turns up nearly 1.5 million results. The idea seems to bring comfort to many; just follow the instructions,...
21 votes
9 answers
3k 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 ...
  • 2,238
12 votes
7 answers
2k 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 ...
  • 5,789
10 votes
1 answer
805 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 ...
  • 101
11 votes
12 answers
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 != ...
  • 4,008
5 votes
12 answers
438 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 ...
user avatar
105 votes
47 answers
72k views

Make a big deal out of == true?

There is a colleague of mine who constantly writes: if (someBool == true) It drives me up the wall! Should I make a big deal of it or just drop it?
18 votes
9 answers
3k 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 ...
  • 17.1k
14 votes
9 answers
806 views

How can I bootstrap a software development community at my school?

I'm a student at the University of South Florida who's frustrated with the educational environment in the Computer Science program. Right now, I'm taking "Program Design." I should be learning how to ...
17 votes
4 answers
584 views

Does your company have a written policy about personal (technical) blogging? [closed]

Does your company have a written policy about personal (technical) blogging? Care to share? We encourage our developers to keep personal blogs and talk about technical problems they've encountered ...
  • 1,088
1 vote
7 answers
871 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 ...
  • 2,195
11 votes
3 answers
246 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 ...
36 votes
5 answers
30k 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.