9

This question already has an answer here:

I try to be a better programmer every day, and a big part of that is learning from people who are more experienced than me. (You are all awesome teachers!)

For example, in Java, if I want to know if, in general, I should set a field by passing in an argument when I create it or setting the field in the constructor, how do I find that out? This assumes I always know what to initialize the field to, such as setting something to a random position. It is an opinion based question, but there is a generally accepted practice (dependency injection). I would expect the question to be closed as being "primarily opinion based".

This answer may be opinion based, but someone who is asking this question does not have enough knowledge to form an educated opinion of his or her own. The asker would not know dependency injection is a thing, so would not know to read up on it.

The inability to ask questions like this, for me at least, slows my improvement as a computer scientist.

So my question is, where can I ask questions about programming conventions? This is a followup to my earlier question: Asking which way is better

marked as duplicate by gnat, Martijn Pieters discussion Dec 20 '14 at 9:16

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 2
    This is not a good fit for CodeReview. You are asking about an abstract concept of programming, which is out of scope for cr. I figure it may be okay to ask this question on programmers, but please don't quote me on that. You'd have to be careful about the opinion based thing again. – Vogel612's Shadow Dec 19 '14 at 20:34
  • 3
    This to me seems on topic for Programmers because it is a specific issue that can be addressed. However, it has probably been asked so make sure you search long and hard before posting something which to many may seem a little trivial - as trivial questions have usually been hashed and rehashed. – Travis J Dec 19 '14 at 20:43
  • I asked my question in Programmers. I have high hopes. Thanks! programmers.stackexchange.com/questions/266952/… – Evorlor Dec 19 '14 at 21:27
  • No downvotes or closing :) Thanks ppl! – Evorlor Dec 19 '14 at 21:41
5

Vogel612 mentioned that it is not a good fit for Code Review, and he is right.

However, here is how it could become a good fit for Code Review:

  • You code your program the way you feel is good
  • You make the program work (it does what it is supposed to do)
  • You ask a question on Code Review, adding your code, and describing a bit about what your program does
  • Profit!

Having spent more than one year on Code Review, I know that there is often something that can be pointed out in your code besides the things that you think about.

You are concerned with dependency injection? Someone might answer about that, while someone else might see something in your code and suggest that you rewrite a method to make it more re-usable. Someone else might find an algorithmic improvement, while another one discovers a possible memory leak.

There's always something that can be discovered. You never know what reviewers might find!

  • Thanks :-) it seems programmers is the place intended for convention questions, but this sounds like a nice way to get an answer and then some. But I'd prefer to ask a more directed question for general convention questions – Evorlor Dec 19 '14 at 22:04
  • 2
    @Evorlor The problem with general convention answers is that there is also an issue of when they are applicable or not. That's why Code Review gives custom advice for each specific situation. – 200_success Dec 19 '14 at 22:12
  • @200_success gotcha, thanks. I didn't really have a specific instance in mind, but I'll take note of that for future reference – Evorlor Dec 20 '14 at 0:03
2

Based on Travis J and Vogel612's Shadow's comments, Programmers is the appropriate site for Programming Convention questions. It has language tags and a conventions tag.

Please check out Simon's answer as well. Code Review is not the intended place for Programming Convention questions, but Simon makes very compelling arguments as to why Code Review should be considered for these types of questions (after reforming them).

Not the answer you're looking for? Browse other questions tagged .