techniques

What is recursion and when should I use it?

One of the topics that seems to come up regularly on mailing lists and online discussions is the merits (or lack thereof) of doing a Computer Science Degree. An argument that seems to come up time and again for the negative party is that they have been coding for some number of years and they have never used recursion. So the question is...

What is Inversion of Control?

Inversion of Control (or IoC) can be quite confusing when it is first encountered. What is it? What problems does it solve? When is it appropriate and when not?...

Why should I practice Test Driven Development and how should I start?

Lots of people talk about writing tests for their code before they start writing their code. This practice is generally known as Test Driven Development or TDD for short. What benefits do I gain from writing software this way? How do I get started with this practice?...

What do you think of developing for the command line first?

What are your opinions on developing for the command line first, then adding a GUI on after the fact by simply calling the command line methods? eg. W:\ todo AddTask "meeting with John, re: login peer review" "John's office" "2008-08-22" "14:00" loads todo.exe and calls a function called AddTask that does some validation and throws...

How do I search content, within audio files/streams?

I have always wondered how many different search techniques existed, for searching text, for searching images and even for videos. However, I have never come across a solution that searched for content within audio files. For example: Let us assume that I have about 200 podcasts downloaded to my PC in the form of mp3, wav and ogg file...

Techniques to detect Polymorphic and Metamorphic viruses?

What techniques can be applied to detect Polymorphic and Metamorphic viruses? How difficult is to implement these techniques? Are these techniques being applied in modern day anti-virus softwares? ...

Double dispatch in C#?

I have heard/read the term but don't quite understand what it means. When should I use this technique and how would I use it? Can anyone provide a good code sample? ...

IoC Explain and more important when to use it?

I am designing a new system and I want to know IoC and more important when to use it. Does it have to be implemented with interfaces or can be done with classes? Thanks ...

Managing/Using libraries with Debug builds vs Release builds

Hello all, I'm curious about everyones practices when it comes to using or distributing libraries for an application that you write. First of all, when developing your application do you link the debug or release version of the libraries? (For when you run your application in debug mode) Then when you run your app in release mode just...

What are some advantages of duck-typing vs. static typing?

I'm researching and experimenting more with Groovy and I'm trying to wrap my mind around the pros and cons of implementing things in Groovy that I can't/don't do in Java. Dynamic programming is still just a concept to me since I've been deeply steeped static and strongly typed languages. Groovy gives me the ability to duck-type, but ...

What can I do to get better at estimating how long projects are going to take?

I don't want to make life hard for management. I really don't. They're nice enough guys, but every time I am assigned a new project or task and get asked "how long do you think it will take to do this" I end up sputtering off ridiculous timeframes; "between a day and three weeks". I would like to believe that it's not entirely my faul...

Design by coding, its wrong but easier to visualize

I'm sure others agree, when code hits the pavement it is much easier to think of all the elements that will go into your application. Meaning, once you get going, you think of the what's next because you have reached a point where you have to design another table or class. The drawbacks of this approach are obvious and we don't need to...

What tools/techniques can benefit a solo developer?

Hello, I am a solo developer, working in a very small web development firm. There is occasional support for development from contractors, but for the most part, if code is written in the office, I am writing it. Many of the articles and such on here talk extensively about the tools and techniques used for collaboration of developers ...

How do you find your way around a new codebase

You don't always get to talk to the original author or authors of the code you maintain. Sometimes when I work on an existing project I feel like a special forces operative behind enemy lines trying to figure out the lay of the land without the use of a map. When you are in this situation how do you get the code under control? How do you...

Smart Pointers: Or who owns you baby?

C++ is all about memory ownership Aka "Ownership Semantics" It is the responsibility of the owner of a chunk of dynamically allocated memory to release that memory. So the question really becomes who owns the memory. In C++ ownership is documented by the type a RAW pointer is wrapped inside thus in a good (IMO) C++ program it is very r...

What is the best method to detect offline mode in the browser?

I have a web application where there are number of Ajax components which refresh them selves every so often inside a page (its a dashboard of sorts). Now, I want to add functionality to the page so that when there is no Internet connectivity, the current content of the page doesn't change and a message appears on the page saying that th...

Pointers and containers

We all know that RAW pointers need to be wrapped in some form of smart pointer to get Exception safe memory management. But when it comes to containers of pointers the issue becomes more thorny. The std containers insist on the contained object being copyable so this rules out the use of std::auto_ptr, though you can still use boost::sh...

How to detect if JavaScript is disabled?

There was a post this morning asking about: How many people disable javascript. Then I began to wonder what techniques might be used to determine if the user has it disabled. Anyone know of some short/simple ways to detect if Javascript is disabled? my intention is to give warning that the site is not able to function properly without th...

.NET Integer vs Int16?

I have a questionable coding practice. When I need to iterate through a small list of items whose count limit is under 32000, I use Int16 for my i variable type instead of Integer. I do this because I assume using the int16 is more efficient than a full blown Integer. Am I wrong? Is there no effective performance difference (however ...

Should log file streams be opened/closed on each write or kept open during a desktop application's lifetime?

Should log classes open/close a log file stream on each write to the log file or should it keep the log file stream open throughout the application's lifetime until all logging is complete? I'm asking in context of a desktop application. I have seen people do it both ways and was wondering which approach yields the best all-around re...