language-agnostic

When should you start optimising code?

How do you know when you should worry about optimising code? Are there any rules of thumb for this? ...

How else can one present an architecture document besides as a series of views?

Most, if not all architecture documents I've seen (and developed) have been presented as a series of views (Logical, Physical, Use-case etc). Is this the preferred layout? What other styles are there? ...

Doesn't the ability to cast defeat the purpose of typed variables?

So, I'm working under the assumption that we have typed languages because we make a lot of mistakes... so typing is one way to have the compiler do a lot of checks for us and help us out a bit (please let me know if it is my assumptions that's incorrect). However, if we introduce casting to a typed language, don't we re-introduce most t...

Are exceptions really for exceptional errors?

It's my understanding that common wisdom says to only use exceptions for truly exceptional conditions (In fact, I've seen that statement here at SO several times). However, Krzysztof Cwalina says: One of the biggest misconceptions about exceptions is that they are for “exceptional conditions.” The reality is that they are for ...

Uppercase first two characters in a column in a db table

I've got a column in a database table (SQL Server 2005) that contains data like this: TQ7394 SZ910284 T r1534 su8472 I would like to update this column so that the first two characters are uppercase. I would also like to remove any spaces between the first two characters. So T q1234 would become TQ1234. The solution should be able to...

Seating plan software recommendations (does such a beast even exist?)

I'm getting married soon and am busy with the seating plan, and am running into the usual issues of who sits where: X and Y must sit together, but A and B cannot stand each other etc. The numbers I'm dealing with aren't huge (so the manual option will work just fine), but being of the geeky persuasion, I was wondering if there was any s...

What exactly does the word Patch mean when refering to 'submitting a patch'?

What exactly does the word patch mean when refering to 'submitting a patch'? I've seen this used a lot, especially in the open source world. What what does it mean and what exactly is involved in submitting a patch? ...

Do you ever feel confident in your skills?

As a self taught developer i always find myself questioning my skill and knowledge and always feel like i am falling behind in using new technology. Over a period of nearly 9 years i've studied most mainstream languages (especially C based ones), used lots of different OSes, read and absorbed many books and even written one myself. But i...

Simple but powerful programming language for a hobby software project

Long time back, I used to do some home projects in Basic. It was fun and I could get things done without reading tons of documentation (or whatever documentation was available at that time). I guess it is the not the same anymore. Nowadays, programming languages comes with a heavy baggage of framework, environment setup etc. Even for w...

What is the difference between a deep copy and a shallow copy?

What is the difference between a deep copy and a shallow copy? ...

When do you design the GUI first and the backend code later, or vice versa?

When I'm working on a project, sometimes I'll design the GUI first and then write the backend code to make it work, but other times I'll do the opposite and make the GUI once I have the system working. How do you choose which way round to code and are there any particular types of project or circumstances that would lean you either way? ...

How to determine what log level to use?

The log levels WARN, ERROR and FATAL are pretty clear. But when is something DEBUG, and when INFO? I've seen some projects that are annoyingly verbose on the INFO level, but I've also seen code that favors the DEBUG level too much. In both cases, useful information is hidden in the noise. What are the criteria for determining log leve...

What code metric(s) convince you that provided code is "crappy"?

Code lines per file, methods per class, cyclomatic complexity and so on. Developers resist and workaround most if not all of them! There is a good Joel article on it (no time to find it now). What code metric(s) you recommend for use to automatically identify "crappy code"? What can convince most (you can't convince all of us to some c...

What is your "generic" web application testing plan ?

Like, testing for : invalid inputs (strings containing "'"s) giving random id's in url parameters to access "unauthorized" pages prevent sql injection ... ...

Do you personally identify with your code?

On the latest episode of the Stack Overflow podcast (episode #25), Steve Yegge mentioned how bad it was to get emotional with your favorite framework, language, technology, etc. Do you call yourself a <insert your language here> developer? Is this a good thing? ...

Best practices for creating various language-packs on a site? PHP

I've created a language pack for a site before, but I'm not sure if what I'm doing is the best method. Basically, all I have is a file with variables defining string constants. Usually a set of arrays where an array usually refers to a particular elements of the site. Then the site code just includes the appropriate file based on a fl...

What is a trampoline function?

During recent discussions at work, someone referred to a trampoline function. I have read the description at Wikipedia. It is enough to give a general idea of the functionality, but I would like something a bit more concrete. Do you have a simple snippet of code that would illustrate a trampoline? ...

Stop overlooking minor details

Compared to most people on this site I am admittedly a novice. I wanted to get some advice from the pros on how to avoid making stupid errors in your code. Is there anyone else who had the problem when they were first starting out of missing some detail that causes big problems? Are there any habits or behaviors that helped you over co...

What are the specific differences between a CS and CIS degree?

I know CIS is more business oriented and CS is more math based, but what specific developer related classes/skills are taught only in CS? I currently have a CIS degree and am trying to understand the typical "gaps" in development knowledge that exist for CIS degreed developers vs CS. ...

How do you version your projects and manage releases?

Our situation is as follows, but I'm curious about this problem in any situation. We have a framework consisting of 4 projects: beans util framework web We also have modules that need a version and depend on a version of beans and util. Finally we have a customer project that consists of a specific version of the core projects and ...