Benjamin Bannier
  • Member for 11 years, 4 months
  • Last seen more than a month ago
What are the best practices regarding unsigned ints?
12 votes

Encoding range information into types is A Good Thing. It enforces using reasonable numbers at compile time. Many architectures seem to have specialized instructions for dealing with int -> float ...

View answer
Zero as a constant?
7 votes

This might make sense since it explicitly defines Zero to be of type float. At least in C and C++ the value 0.0 is of type double, while the equivalent float is 0.0f. So assuming the x you compare ...

View answer
Need help eliminating dead code paths and variables from C source code
5 votes

You should check what clang's scan-build can do for your build. It can sometimes determine if a variable is only written to, but the results is never used (Dead store in scan-build's language). The ...

View answer
As a solo programmer, of what use can Gerrit be?
4 votes

For a single person I would consider Gerrit (which is awesome in bigger teams) to be unnecessary busywork. Yes, you could plug the verification by Jenkins into Gerrit to avoid merging broken code, but ...

View answer
Teaching myself, as a physicist, to become a better programmer
4 votes

You will be able to go a long way in Physics without knowing anything about "professional" style (speaking from experience). But I have seen many people waste endless time because they lost track of ...

View answer
How can I refactor a code base while others rapidly commit to it?
4 votes

Yes, a branch is a good solution for this. I would suggest you start working on this on a branch and make sure it applies cleanly on top of your current HEAD in the meantime (i.e. make test rebases ...

View answer
Is it bad interview practice to have candidates write a linked-list implementation?
4 votes

Of course most people would never need to implement a linked list, but to implement them from scratch one will probably need to handle pointers correctly. They idea is then that having formed a ...

View answer
Which version of C should I learn?
3 votes

I think you are confusing C language standards and specific extensions offered by compilers. As for standards, I would learn the latest you can use to produce running code. As for compiler, I would ...

View answer
Python interview questions
3 votes

I would go along the list in this answer. Try to refresh what you know following that list as far as you can. Don't worry if you cannot make it until the very end.

View answer
Tool that can do semantic search in a body of C code
2 votes

I use Mozilla DXR with C++ code for tasks like that. It relies on the clang platform to record code while compiling. It is a little work to setup correctly, but well worth it.

View answer
Is it a waste of time to free resources before I exit a process?
2 votes

If you implement your own data type "linked list" not writing a cleanup routine/deconstructor will give you more headaches in the long run than you might think. Without cleanup code reusing what you ...

View answer
How to fit beta versions into a numeric versioning scheme?
2 votes

If you are stuck with purely numeric revisions you could make odd minor revisions release betas for the corresponding major which has a even minor number, e.g. Beta : 1.3.11.df41a Release : 1.4....

View answer
What are some good online coding log/management tool?
2 votes

Redmine fits your fuzzy description pretty well. It integrates a lot of functionality. At the same time, all you want to do could easily be done with a spreadsheet in Google Docs.

View answer
Reorganizing code based on dependencies
1 votes

There is a the Makefile.GraphViz perl module uses GraphViz to generate dependency graphs from Makefile rules. The documentation has an example of how to use it.

View answer
Where do you optimize?
1 votes

You should use a profiler on a handful of typical runs and look at the total time spend in each part of the code, no matter how or how often you got there. Optimizing these parts should always give a ...

View answer
Why is there no Fortran standard library?
1 votes

cernlib did a lot of what you ask for for people working in high-energy physics and it is still useful.

View answer
Shell independence in programming groups
1 votes

A simple solution would be to use some neutral format for environment variable definitions, e.g. in some file env.file VARIABLE value and to generate the setup scripts for different shells ...

View answer
What are useful metrics for source code?
1 votes

I often work on a giant C++ package, and when looking for problematic code worth refactoring the Cyclomatic Complexity or horrible FanIn/FanOut are usually pretty good red flags to look for. Fixing ...

View answer
How to evaluate an open source project with joining in mind?
1 votes

Join if you will enjoy1 working on the project. 1: "enjoy" could mean whatever makes you happy.

View answer
Dependent on CVS tagging for automated builds
0 votes

Both git and subversion support the concept of tags, but since they both allow you to reference the state of your whole code base at any time you don't depend on it. CVS let's you checkout code from a ...

View answer