Have a look to the following method: It's hard to understand what is the Single Responsibility accomplished by this method and the difference with his caller: GetDetailForEvent. Who is _client? Does the word new refer to the lack of the event in the cache?

Would you discourage this kind of code in your team? Can I open this question or is not constructive?

    private void GetDetailForNewEvent(int @event)
        lock (_eventDetails)
            if (!_eventDetails.ContainsKey(@event))
                _eventDetails[@event] = _client.GetEventDetail(@event);

                //TODO: what is the following instruction for???
                _eventDetailsLock[@event] = new object();
  • one may argue that conceptually, questions like this have been addressed in How would you know if you've written readable and easily maintainable code?
    – gnat
    Oct 6 '14 at 11:08
  • @gnat: I've answered that question: programmers.stackexchange.com/a/258185/114829. But I think there is a huge difference of abstraction between my actual question here and that one. Can you look to the text of my actual question (the title can be fuorviating, probably I should change it).
    – Revious
    Oct 6 '14 at 11:53
  • the difference doesn't look substantial. If your question was more concrete, with more of a real code, it could probably make it into CR (you'd have to ensure that it meets their six-yes requirements to be posted there)
    – gnat
    Oct 6 '14 at 12:11
  • @gnat: thanks.. I would like to ask a question, but it's not a polemic. Since you (as a community) refuse a lot of kind of questions I wonder if you already have too many questions and also which kind of questions are you looking for.. how is going this section? (it's really not a critic, I'm just looking for info)
    – Revious
    Oct 6 '14 at 12:16
  • 1
    you can take a look at recent open questions tagged coding-style to find out what kind tends to fly well
    – gnat
    Oct 6 '14 at 12:19
  • @gnat: Thanks.. Looking at those questions I think the problem with my question is that it's not very clear.. and opinion based for how I formulated it.. and also it's not clear what kind of answer I expect from the community.. I think it could maybe fit the community, but my score is too low to try..
    – Revious
    Oct 6 '14 at 12:23
  • The title led me to think that you are looking to hire some developers. I'd never have guessed that it's a code quality question.
    – Caleb
    Oct 10 '14 at 19:53

You must log in to answer this question.

Browse other questions tagged .