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

46
votes
14answers
8k views

Are there problems with using Reflection?

I don't know why, but I always feel like I am "cheating" when I use reflection - maybe it is because of the performance hit I know I am taking. Part of me says, if it is part of the language you are ...
13
votes
5answers
1k views

When should you rewrite? [duplicate]

Possible Duplicate: When is a BIG Rewrite the answer? In Joel Spolsky's famous (or infamous) article Thins You Should Never Do, Part I, he makes the case that doing a rewrite is always a wrong ...
39
votes
20answers
9k views

What are the steps in beginning a large project, when all I have is a big idea? [closed]

I am computer engineering student. I've been thinking about how I can handle a big project. What should be my first step to reach my goal in a more efficient and effective way? When I come up with a ...
25
votes
10answers
7k 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 ...
12
votes
2answers
4k views

Is it true that “Real programmers can write assembly code in any language.”?

Real programmers can write assembly code in any language. (Larry Wall). As far as I can make out, Mr. Larry Wall is trying to say that to a real programmer any language can have the same ...
3
votes
11answers
853 views

Is a programmer's gut instinct an acceptable answer with regard to design decisions? [closed]

There are times where I can immediately recognize and suggest a fix for a problem design pattern. However, there are other times where putting it into words just isn't possible. I know something isn't ...
8
votes
7answers
519 views

What's the best way to prepare your design & code for those “unknown unknown” bugs from day one?

I am just wondering, is there any practical method or technique or even tricks to get avoid those "unknown unknown" bugs especially those nasty and random ones which are often emerge at the last ...
6
votes
5answers
1k views

What do you call different user roles in software design?

I'm just curious, I'm building a web app with a User model which has role-based permissions. I have the following roles: Visitor (anonymous user) ?? (logged-in user) Moderator Admin I'm having a ...
22
votes
15answers
5k views

Spending too much time debugging

Yesterday, I rolled out a v1.0 release of a Web project I've spent about 6 weeks working on (on and off, that is). I haven't made any exact records of my time, but according to my experiences I would ...
8
votes
4answers
3k views

Is it worth developing custom shopping cart? [closed]

We have handsome library of cakephp modules at my workplace, and we develop custom websites at good pace until the shopping cart comes our way to slow down the process. I have used various (Magento, ...
7
votes
3answers
484 views

Is it beneficial to have a long-term experience in a specific technology rather than short-term multiple ones?

I am currently working in asp.net and having almost 1 year of experience. Now my company wants to change my technology and wants to put me in mobile development (might be other than .net mobile ...
68
votes
17answers
7k views

How to train yourself to avoid writing “clever” code? [closed]

Do you know that feeling when you just need to show off that new trick with Expressions or generalize three different procedures? This does not have to be on Architecture Astronaut scale and in fact ...
8
votes
3answers
752 views

BDD: Getting started

I'm starting with BDD and this is my story: Feature: Months and days to days In order to see months and days as days As a date conversion fan I need a webpage where users can enter ...
3
votes
3answers
314 views

Rewriting code / better initial outline

Single-programmer project. I'm constantly having to rewrite my own code on an on-going project. It's not buggy, but every time I expand my program (which previously-planned features), I keep having ...
25
votes
10answers
1k views

Inspiring a co-worker to adopt better coding practices?

In the Handling my antiquated coworker question, various people discussed strategies for dealing with coworkers who are unwilling to integrate their workflow with the team's. I'd like, if possible, ...
29
votes
29answers
5k views

Does over-reliance on tools imply that you are lazy? [closed]

I started programming in C++ at uni and loved it. In the next term we changed to VB6 and I hated it. I could not tell what was going on, you drag a button to a form and the ide writes the code for ...
87
votes
10answers
31k views

Why do most of us use 'i' as a loop counter variable?

Has anyone thought about why so many of us repeat this same pattern using the same variable names? for (int i = 0; i < foo; i++) { // ... } It seems most code I've ever looked at uses i, j, ...
38
votes
11answers
4k views

Is it bad habit not using interfaces? [closed]

I use interfaces rarely and find them common in others code. Also I create sub and super classes (while creating my own classes) rarely in my code. Is it a bad thing? Would you suggest changing ...
0
votes
2answers
232 views

Looking for the fastest way to collect form data

I am developing an application in Flex. There are 20+ 'pages', each with its own form. I need to collect all the entered data and pass it to an API method. What I am wondering is when I should begin ...
8
votes
5answers
3k views

Trailing forward slash in directory names - good programming practice?

I want to ask the user of my bash script to pass a directory path as argument. Which one of the following is a good programming practice - to require that the user enter a trailing / (forward slash) ...
2
votes
1answer
313 views

Should I devise a FileHandler interface to deal with different Files?

My background has largely been manual testing and I started learning core java to be able to work with Selenium. I am wanting to write couple of reusable method, like reading/writing data from csv, ...
2
votes
2answers
227 views

Globally important concepts to understand? [closed]

I have a history of web development using LAMP + html/css (though I admit the LAMP aspect isn't in great depth) and would like to follow the career path of software developer, so I'm currently ...
32
votes
10answers
7k views

When to commit code?

When working on a project, the code may be developed reasonably fast in a single day or bit by bit for a prolonged period of few weeks/months/years. As code commits are becoming to be considered as a ...
12
votes
7answers
4k views

Best way to break down overwhelming code into manageable chunks?

I'm continually becoming overwhelmed by large projects, once they reach a certain level of complexity. Once I reach a certain point in a project, my progress slows to a crawl and I find myself ...
5
votes
1answer
413 views

Scoping recommendations while developing in C

While developing a library using C, what are your recommendations about variable and function scoping? In C++, OOP and namespaces made the whole thing a lot easier. But how to do that with plain C? ...
5
votes
1answer
976 views

Coding site with test harness for basic data structures like linked list,graph,strings etc [closed]

I just took an Amazon online test and I messed it up badly. I am out of practice and have low confidence in writing code. Are there any coding sites with test harnesses for basic data structures and ...
28
votes
7answers
13k views

What's wrong with being a code monkey? (Or, what is a code monkey?) [closed]

Programmers tend to talk about being a "code monkey" in a derogatory way. "Don't work there, you will just be a code monkey!". I have two offers for jobs, one at a small company, one at a very large ...
28
votes
9answers
3k views

Future proofing code

Where I work developers are always telling me that "I added this just in case for the future" or "I think it's a good idea to do this because they'll probably want it some day". I think it's great ...
10
votes
9answers
551 views

Coping with an unfixable endless project

We have a large (1200+ hours) website that has a lot of technical debt. This is mainly caused by the following (usual) reasons. Multiple programmers who come and go during development. Change of ...
5
votes
2answers
771 views

Library version control best practices

I may be violating some StackOverflow terms by asking a question which is more likely to yield discussion than a clean answer. Here goes, however. I've developed some software for a small company ...
6
votes
4answers
319 views

Avoiding problems when copying code

From time to time, I find myself copying a bit of code and modifying the copied version. I know very well that having two copies of the same code is a very bad idea, but those pieces of code are small ...
5
votes
4answers
414 views

What determines when an application requires mvvm?

I'm developing mobile applications for Windows Phone 7. This application calls some web services and occasionally sends responses out via web services. I recently started looking into MVVM and noticed ...
5
votes
5answers
392 views

When designing a protocol, is it better for a method to accept a single object of a specific type, or an array?

I'm currently designing a protocol for internal use, so it doesn't make a huge difference in this particular case, but it got me wondering: Is it better for a method to accept a single object of a ...
0
votes
1answer
346 views

Programmatically create header file

What's the best way to programmatically create a header file for another project? Here's the specific use case: one program fingerprints the device for discrete information like version number, id ...
31
votes
11answers
4k views

Scrum for a single programmer? [closed]

I'm billed as the "Windows Expert" in my very small company, which consists of myself, a mechanical engineer working in a sales and training role, and the company's president, working in a design, ...
9
votes
11answers
2k views

How to explain to non-programmers that programming is not a repetitive task? [closed]

Some people have the view of programming that it is just repetitive typing on a keyboard. None of this is true. First of all, there is so much more you have to do than actually typing down the code, ...
6
votes
8answers
422 views

What benefit do I get from good methodology?

One of my friends has worked for nearly 10 years, asked me why he needs to learn new things such as unit-testing, MVC, Multi-tier architecture (he creates 3-tier application but designs like 2-tier), ...
4
votes
5answers
421 views

How do you know what a program needs to do to complete a given task?

I am a noob when it comes to programming. I just know some Ruby, that's really it when it comes to programming, but it's definitely an interest. In learning to program, I give myself tasks to ...
7
votes
1answer
181 views

Preparing For a New Programming Project [closed]

I consider myself to be a novice programmer -- a noob is you like. As such I'm still not sure how to get started on a project where I will be doing stuff that I've never done before. For instance, I ...
14
votes
4answers
3k views

What is pattern based programming?

Can somebody explain the obsession with patterns and anti-patterns in programming? I ask because I have absolutely no idea what any of the patterns mean. When faced with a programming task I think ...
39
votes
12answers
25k views

Must a programmer learn text editors like Emacs and Vim? How important are they? [duplicate]

I have been writing code so far in conventional text editors that come with the OS so far or use an IDE in some cases. I know there are some advanced text editors like Emacs and Vim available solely ...
5
votes
6answers
988 views

Should you create a boolean function that does the opposite of an existing function just so its purpose is clear?

Based on this question. Would you consider it best practice to create a function that does the opposite of an existing function just to give it a different name. Example: If you already have bool ...
3
votes
2answers
552 views

Why would you use built-in WebDev instead of local IIS

Since starting developing ASP.NET projects I find myself familiar just touching F5 for debugging. I think most of us are learned that way? From then and much later I learned to live with the spooky ...
1
vote
3answers
645 views

Should I keep all my class definitions in the same class library?

I am starting to work with class libraries in my C# class. We were told to write code that can be used more than one time. Should I keep all my class definitions in one class library for the length of ...
33
votes
14answers
13k views

Is it ever a good idea to hardcode values into our applications?

Is it ever a good idea to hardcode values into our applications? Or is it always the right thing to call these types of values dynamically in case they need to change?
4
votes
3answers
2k views

When to deprecate and when to delete in Java

As part of a refactoring effort or just ongoing development, a particular method or maybe an entire class may become obsolete in some sense. Java supports the @Deprecated annotation to indicate that ...
-2
votes
7answers
415 views

Vector operations: vec1.dot(vec2) vs vec1 * vec2 vs dot(vec1, vec2) [closed]

What's your preferred way to implement/use vector operations? vec1.dot(vec2) allows to reuse vec1 but is hard to read for longer equations dot(vec1, vec2) A friend of mine prefers this as "dot" ...
19
votes
8answers
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? [...
19
votes
5answers
13k 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 ...
41
votes
10answers
35k views

How many lines per class is too many in Java? [closed]

In your experience, what is a useful rule of thumb for how many lines of code are too many for one class in Java? To be clear, I know that number of lines is not even close to the real standard to ...