language-agnostic

Maintaining a healthy development team as a manager

As a manager it is your job I think to remove obstacles so that the development team can keep going. You must also try to keep some level of respect within the team so that when you have to take a tough decision the team respects it. Many people say you should stop coding, others say you should keep your hands in. My question has a sli...

Code golf: combining multiple sorted lists into a single sorted list

Implement an algorithm to merge an arbitrary number of sorted lists into one sorted list. The aim is to create the smallest working programme, in whatever language you like. For example: input: ((1, 4, 7), (2, 5, 8), (3, 6, 9)) output: (1, 2, 3, 4, 5, 6, 7, 8, 9) input: ((1, 10), (), (2, 5, 6, 7)) output: (1, 2, 5, 6, 7, 10) Note:...

How can I create a SEO friendly dash-delimited url from a string?

Take a string such as: In C#: How do I add "Quotes" around string in a comma delimited list of strings? and convert it to: in-c-how-do-i-add-quotes-around-string-in-a-comma-delimited-list-of-strings Requirements: Separate each word by a dash and remove all punctuation (taking into account not all words are separated b...

Should One Know Operator Precedence thoroughly?

Should the programmer be aware of operator precedence thoroughly? Using braces to group expressions should be okay, isn't? I always uses braces to be on safer side. And when asked a question on precedence, I cannot answer readily. ...

Can anybody give me an example of overused design patterns?

I've been hearing and reading about cases when people had come across cases of overused design patterns. Ok, missused design patterns are understandable phenomenon. What does it actually mean overused design patterns? Do you have any examples and why do you think there are too many patterns? ...

What is the difference between Type and Class?

What makes a type different from class and vice versa? (In the general language-agnostic sense) ...

How to solve the violations of the Law of Demeter?

Me and a colleague designed a system for our customer, and in our opinion we created a nice clean design. But I'm having problems with some coupling we've introduced. I could try to create an example design which includes the same problems as our design, but if you forgive me I'll create an extract of our design to support the question. ...

How independent are threads inside the same process?

Now, this might be a very newbie question, but I don't really have experience with multithreaded programming and I haven't fully understood how threads work compared to processes. When a process on my machine hangs, say it's waiting for some IO that never comes or something similar, I can kill and restart it because other processes aren...

How many classes should a programmer put in one file?

In your object-oriented language, what guidelines do you follow for grouping classes into a single file? Do you always give each class a seperate file? Do you put tightly coupled classes together? Have you ever specified a couple of implementations of an interface in one file? Do you do it based on how many lines of code the implementati...

The Same Old Song - New names for old things.

Reading this topic, I remembered of something that always bugs me. There are certain practices, methodologies, or whatever, that existed for a long time, were well known and used. And then someone wrote a book, put a new fancy name on it, and out of nothing it starts to appear as something new, revolutionary, the next big thing, etc etc...

Data Transfer Object Pattern??

Hi Guys I've got a problem where I need to generate a Word based reports on object “Customer”. I usually do this by passing Customer to a class which knows how to create a Word document, insert bookmarks etc. The problem with this, is that I find myself placing the logic for retrieving and formatting information about the Customer obj...

Moving applications between desktops in Windows

Hello, I am trying to figure out how can I send a running application do a new Windows desktop created with CreateDesktop. I can create a new Desktop, and then launch an application in it, bug I can't find the way to do it with a running application. All functions related to Desktop management (i.ec, SetThreadDesktop) always apply only...

Is design now a subset of refactoring?

Looking at the cool new principles of software development: Agile You Ain't Gonna Need It Less As A Competitive Advantage Behaviour-Driven Development The Evils Of Premature Optimization The New Way seems to be to dive in and write what you need to achieve the first iteration of scope objectives, and refactor as necessary to have ele...

Simple Backdoor-ing

Hi All, I was wondering what backdoor techniques you have used in the past during application development for testing. Which are the easiest, least invasive and easiest to remove prior to release methods? So far I have come up with two main approaches: 1) Active - i.e. the developer would send some type of command to the program eith...

How should I refactor my code to remove unnecessary singletons?

I was confused when I first started to see anti-singleton commentary. I have used the singleton pattern in some recent projects, and it was working out beautifully. So much so, in fact, that I have used it many, many times. Now, after running into some problems, reading this SO question, and especially this blog post, I understand the e...

What optimizations should be done early?

Anyone who reads a lot of SO questions knows that the need to preach against premature optimization is not going away anytime soon - but what about the other extreme, the projects that fail or struggle because they did not consider performance early enough? Should you just try and get a working system as quickly as possible so you can d...

Model view controller

I have a tree control in my GUI (with naturally lots of GUI/platform specific functions to handle the nodes). I have a data model with its own complex set of nodes, children, properties etc.. I want the tree to display a representation of the model, be able to send messages to the nodes inside the model and be told to redraw itself when ...

Object Normalization

In the same line as Database Normalization - is there an approach to object normalization, not design pattern, but the same mathematical like approach to normalizing object creation. For example: first normal form: no repeating fields.... here's some links to DB Normalization: http://en.wikipedia.org/wiki/Database_normalization ht...

How to test an application for correct encoding (e.g. UTF-8)

Encoding issues are among the one topic that have bitten me most often during development. Every platform insists on its own encoding, most likely some non-UTF-8 defaults are in the game. (I'm usually working on Linux, defaulting to UTF-8, my colleagues mostly work on german Windows, defaulting to ISO-8859-1 or some similar windows codep...

What is the best approach to take when you can't figure something out, and you have no one to ask?

The second part of that question is key. If you are one of a few programmers, and after banging your head on your keyboard for endless nights you can't figure something out, with no one else in your organization to ask, what do you do? Not having someone to ask has more to do with the fact that it would take too long to bring them up to ...