640 reputation
28
bio website
location London, United Kingdom
age
visits member for 2 years, 8 months
seen yesterday

Sep
25
comment Why is “tight coupling between functions and data” bad?
I added a link to another question that talks about the evil of global state. I might have been exercising some poetic license when I said it was the 'only plus side'. I think you misunderstood what I meant by 'average programmer'. I mean a normal human being whose profession is a programmer - and though some competence level is expected, it is elitist to require that level to be that of a psychic. I agree with you - any paradigm or language that forces or encourages readable code in some way is worth celebrating. Myself, I'm not always convinced by the OO approach, but that's me.
Jul
25
comment Where to load and store settings from a file?
I'm not sure what you mean by your first two questions. To answer your third - yes, basically.
Jul
25
comment Where to load and store settings from a file?
Case by case basis. Some of your top level classes might just need a reference to the whole Config instance passed into them if they rely on so many parameters. Other classes just need one or two parameter maybe, but there is no need to couple those to the Config object (making them even easier to test), just pass the few parameter(s) down through your application. As mentioned in my answer, if you build with a testable/DI oriented architecture getting the values where you need them will generally not be difficult. Use global access at your peril.
Jul
25
comment Where to load and store settings from a file?
.ini is easy to parse, and there are also lots of APIs that include .ini as a possible format. I'm suggesting that you use such APIs to help you do the grunt work of the textual parsing but that the end result should be that you have initialised a POD class. I use the term serialise in the general sense of copying to or reading in the fields of a class from some format, not the more specific definition of serialising a class directly to/from binary (as is typically understood for say java.io.Serializable).
Mar
14
comment Why use a database instead of just saving your data to disk?
Database stores data to disk anyway. It's just the end result of a natural evolution of systems for storing structured data to file. Chances are if you set out to use files to store your structured data you are going to find yourself reinventing features that have already been developed in databases. So why not just use a database from the start?
Mar
6
comment About the usage of assertions
Admittedly, whilst reading programmers.se I kind of put my language-agnostic hat on and tend to ignore the language tags so please take that statement for its general meaning.
Mar
6
comment Is imposing the same code format for all developers a good idea?
I disagree with Martin here, well sort of. My rule of thumb is if you make a logical/semantic change, then you are allowed to change the format of the lines you changed, otherwise you aren't allowed to change the format of lines just because you fancy it. Don't clog your version control log with petty reformatting changes.
Oct
9
comment Which order to define getters and setters in?
Added some reasons.
Jul
20
comment Best practice on if/return
What is the 'Do something more here' that you want to do? That could completely change how you design your function.
May
15
comment When is unit testing inappropriate or unnecessary?
In expressing my answer I was attempting to come up with a concise and all encompassing rule of thumb which answers whether unit testing is appropriate to what you are doing or not. In that respect therefore responding directly to the OPs question. I said also to write tests if the complexity "will likely in the future exceed" understanding to cover the case you suggested of "it may seem fairly trivial [now, but later...]".
May
9
comment When is unit testing inappropriate or unnecessary?
I'm saying unit testing provides a bridge over gaps in the understanding of an application. I did say that they were required to "extend" the application, in the sense that sometimes a feature and the impact of it is too difficult to keep track of all at once so unit tests can act as a framework to make that possible.
Apr
20
comment When to stop inheritance?
I'm guessing here that the reason you have to switch on colour is because in your MakeMove routine you have to know if a neighbouring piece is friend or foe. But of course here you don't need to know the actual colour, you just need to know if a target piece is the same/different colour as the one about to move, and change your expression to a relative comparison between colours. But you still need to make the colour a property of the piece.
Feb
9
comment Is it a must for every programmer to learn regular expressions?
Of relevance: thedailywtf.com/Articles/SQL-MUGging.aspx
Oct
27
comment Get 100 highest numbers from an infinite list
Since my solution seems not to have been convincing enough I've tried to elaborate.
Oct
27
comment Get 100 highest numbers from an infinite list
Yes, it does, but I deal with that later. Would you mind actually reading the rest please. If necessary I'll edit my answer to make it abundantly clear.
Oct
27
comment Get 100 highest numbers from an infinite list
No. Using the strategy I have described, where more hashtables are used to traverse the number space more quickly, it is O(1). Please read my answer again.
Oct
25
comment Is there justification for leaving conflict markers in checked-in code?
git. Sorry I didn't tag because I didn't feel the actual VCS was relevant. They were deliberately checked in, several, in several files. I'd agree that accidental is forgiveable once or twice.