language-agnostic

How to prioritize bugs?

In my current company there isn't clear understanding between the test and development teams as to how severe a bug should be? There are arguments which go back and forth to reduce or to increase the severity. We are not as of now aware of any documents which lays the rules. The tester raises the bug and assigns priority based on his int...

How to make developers follow coding standards?

How can I make developers follow coding standards? In our company: I've given documents and they don't have the patience to read it and follow it. I've tried telling them again and again "please do it this way" they nod their heads, but still do it the wrong way We're doing a project for the third time and still they don't seem to fo...

Metrics for measuring successful refactoring

Are there objective metrics for measuring code refactoring? Would running findbugs, CRAP or checkstyle before and after a refactoring be a useful way of checking if the code was actually improved rather than just changed? I'm looking for trends we can capture that can help us improve the code review process without wasting time on cod...

Most readable way to write simple conditional check

What would be the most readable/best way to write a multiple conditional check such as shown below? Two possibilities that I could think of (this is Java but the language really doesn't matter here): Option 1: boolean c1 = passwordField.getPassword().length > 0; boolean c2 = !stationIDTextField.getText().trim().isEmpty(); boo...

Best way to find recurring values in a set

What is the best way to find the most recurring values in a set? I'd like to use a one-pass algorithm, assuming that values are from the 1,2,3,4,..,m domain? If I had to write an algorithm to do that, how would I do that? ...

Smooth ( animated ) GUI transitions

From time to time you can see smooth animated transition displayed for resizing, expanding and appearing graphical controls. Not just some tail-wagging file search dog, but animation of widget configuration changing it's state structurally and/or geometrically. I haven't used Windows Vista much, but sure know that on XP you can set this...

What is the difference between mutex and critical section?

Please explain from Linux, Windows perspectives? I am programming in C#, would these two terms make a difference. Please post as much as you can, with examples and such.... Thanks ...

StackOverflow CAPTCHA Triggers

Normally whenever a CAPTCHA might be needed I always present it to the user apriori but the StackOverflow approach is much better, it only shows me the CAPTCHA when it thinks I might be a bot. I'm interesting in learning the requirements and how I could implement a similar system on my projects. What are the actions that make SO believe...

What does 'native' mean in the context of two related technologies?

The scenario in question relates to the much-maligned Microsoft Jet database engine. The assertion was that the Data Access Objects (DAO) data access technology is 'native' to Jet, the implication being that creating an object via the DAO model is 'superior' to doing the same via SQL code executed from within in the Microsoft Access user...

Retrieve current mixer levels with WMI?

Is there a way to get Windows audio mixer levels using WMI? For example, to get the current line input level. Ideally this would work on XP and Vista, although I'm aware the audio subsystem is completely different between the two, so I might need a different solution for each. Edit: suggestions in any language will do. ...

Smart and get things done, good enough?

I have been troubled by some stuff for some time now and would like to hear if anybody has opinions about it. Over the years I have seen several developers that would be considered smart and get things done. As it turns out the code they make is surprisingly crappy. I certainly don´t claim to be an expert myself but there are issues I c...

Algorithm for message code validation

Hi! If you read this thread before - forget everything I wrote, I must have been drunk when I wrote it. I'm starting over: I'm currently working on a project where we will be using some sort of algorithm for validating user input. There are three parties to consider; Client - Browsing our web pages Company - We, handling the Client r...

What is opinionated software?

I often see people say that certain software is "very opinionated" or that Microsoft tends to write "un-opinionated" frameworks. What does this actually mean? ...

When is enough abstraction enough?

I was having a conversation with a co-worker a few days ago. When I mentioned that a new coding technology he's interested in doesn't seem like anything that couldn't already be done with existing tools rather easily, he replied a bit dismissively, "that's what they said about object-oriented programming, too. It's just procedural progr...

When is enough abstraction enough

I tried asking this and it got closed very quickly for being too long. (Which it was.) But I think it's a genuine question that needs to be discussed, so here's a much shorter version: Abstractions are supposed to simplify your code. But in my experience maintaining other people's code, I consistently find that the trade-off for making ...

Getting a specific digit from a ratio expansion in any base (nth digit of x/y)

Is there an algorithm that can calculate the digits of a repeating-decimal ratio without starting at the beginning? I'm looking for a solution that doesn't use arbitrarily sized integers, since this should work for cases where the decimal expansion may be arbitrarily long. For example, 33/59 expands to a repeating decimal with 58 dig...

Tricks, hints, shortcuts in documentation / comments

Which tricks, hints or shortcuts do you use regularly when you document your sourcecode? What type of comment does help you most (or is most desired) when looking over a piece of sourcecode? For an example, we always use date, shortcut of name and a +, -, * (added, deletet/commented, modified) and then some description: // 30.04.09 PL...

Modelling a system after having defined the UML use case

...what's next? After you defined what actors do what actions, which way do you go? Do you model the database or do you prefer to start with the classes? I thought the better approach was to start with a class-like modelling diagram, to focus on relationships between objects. This has proven to be wrong because I went too deep in detai...

Everything is a flow?

Some of my recent web projects that I worked on, use a flow engine as the central abstraction in the presentation and/or (more or less the) business layer. Reflecting on my experiences, I can honestly say that I am not a fan of the flow-centric approach. On the contrary even. I see the same symptoms pop up in projects that use flows as c...

Rot13 for numbers.

EDIT: Now a Major Motion Blog Post at http://messymatters.com/sealedbids The idea of rot13 is to obscure text, for example to prevent spoilers. It's not meant to be cryptographically secure but to simply make sure that only people who are sure they want to read it will read it. I'd like to do something similar for numbers, for an appl...