code-maintainability

What is the maximum number of lines that should be allowed in a single file?

At some point, things get unwieldy. Where do you draw the line and try to break things out? ...

Inputs for improving code debuggability apart from logs and error codes

Apart from error codes, error strings and logs, are there any other features which can be incorporated in the code to increase getting debug / trace information during code runtime which can help debug issues (or let us know what is going on) at runtime? ...

Is 100% code coverage a really good thing when doing unit tests?

I always learned that doing maximum code coverage whit unit tests is good. I also hear developers from big companies such as Microsoft saying that they write more lines of testing code than the executable code itself. Now, is it really great? Doesn't it seem sometimes like a complete loss of time which has an only effect to making maint...

Maintainable CSS vs. theme-ability

The above seem to be contradictory goals. On the one hand, making CSS maintainable seems to me to suggest keeping CSS structured and orderly, and keeping all the styles of an element together in one place. So for example, the style of a top logo would look like this: #logo { width:50px; height:30px; background-image:url(/images/...

How much performance do I lose by increasing the number of trips to SQL Server?

I have a web application where the web server and SQL Server 2008 database sit on different boxes in the same server farm. If I take a monolithic stored procedure and break it up into several smaller stored procs, thus making the client code responsible for calls to multiple stored procedures instead of just one, and I going to notice ...

What's the normal way of organising a header file in Objective-C?

I do start off organising my .h files with the best intentions but somehow they get disgustingly messy. Below is an example (which isn't that bad, but i've seen much worse!). I've tried grouping sections with #pragma mark but it seems to look even messier. All the UILabels and UIButtons are required (as mentioned above) as they're sh...

Can I create a named default constraint in an add column statement in SQL Server?

In SQL Server, I have a new column on a table: ALTER TABLE t_tableName ADD newColumn NOT NULL This fails because I specify NOT NULL without specifying a default constraint. The table should not have a default constraint. To get around this, I could create the table with the default constraint and then remove it. However, there...

Challenges of refactoring unit-tests to be maintainable and readable when dealing with List<T> objects

In the book The Art of Unit Testing it talks about wanting to create maintainable and readable unit tests. Around page 204 it mentions that one should try to avoid multiple asserts in one test and, perhaps compare objects with an overridden Equals method. This works great when we have only one object to compare the expected vs. actual re...