6

I have a general question about validations, data integrity, building APIs -- and specifically, when writing validations, should I be concerned only with user input?

Where is the right place to ask this question?

0

1 Answer 1

1

CodeReview may be a place to ask such question.

Suggestions on API design likely better be asked from expected users of that API.

"Best practice" and general "the best way..." questions are usually too broad/opinion based for SO - so unless you have particular problem with your current approach asking somewhere else is better.

If you want to shape question for SO: show your current approach and clarify problem that this approach does not solve. Specify what would you consider "better" approach: faster, more declarative, nicer errors, whatever else.

Note that even that does not guarantee that post will not be closed as "opinion based"/"search for external tools". Limiting options to particular framework (like "solutions that are provided by ASP.Net MVC5") and clarifying that "no" is acceptable answer may need to be added if you feel that post still asking for "shopping list".

Assuming you are not using universally bad approach (i.e. for SQL questions constructing queries with string concatenation of user input - which will bring in plenty of downvotes/duplicate) you likely will get recommendations for better approaches that you'd have to evaluate yourself.

4
  • 5
    There needs to be reviewing of actual code involved for it to be appropriate for Code Review (as per their help center) - it's difficult to tell whether that's the case here. If not, Programmers might be more appropriate, although it's difficult to say for sure since the question seems pretty vague and I'm not exactly an experienced Programmers user. Jul 27, 2015 at 14:36
  • I think 80% of all answers are "best practise" answers, as in SW development you can solve things often by multiple ways.
    – Pepster
    Sep 11, 2016 at 13:24
  • @Pepster there is a big difference between solution to concrete problem (which is SO is good place for) and open discussion on what could be better by random undefined criteria (which none of SE sites welcome). Sep 11, 2016 at 19:26
  • @Alexei Levenkov, Perhaps you're right, but often in practise I found those less concrete questions with multiple answers more useful (most of the time, the concrete questions are just a case of RTFM).
    – Pepster
    Sep 13, 2016 at 8:13

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