2

The FAQ of Programmers describes this site as a site for professional programmers who are interested in getting expert answers on conceptual questions about software development .

Since business logic is an important part (in fact its the foremost deciding factor in software) of the programming model, I think there must be certain guidelines as to which parts of the business logic may and may not be discussed here.

Edit 1: Example

Assuming a simple e-ticketing system for an event. The business logic here is

Check ticket availability -> If available book an order and proceed to checkout -> If checkout successful reduce ticket qty else cancel transaction

So the most probable design (for simplicity's sake) would be to have a counter for tickets, a order system and a checkout module. Now just have a list of questions and where they fall?(parenthesis indicate my suggestion)

  • When to update my counter; before or after transaction? (possibly Stack Overflow)
  • How to implement a queue algorithm? (Theoretical Computer Science)
  • Should I create separate tables for orders and counters (belongs at Code Review)
  • What to do when two users simultaneously access the system? (cannot decide)
  • What is the generally accepted practice (vague but a general answer be provided)
  • What checkout module is available in Python? (definitely Stack Overflow)

But I believe the following questions be asked here?

  • Can I implement a single queue or a multiple queue? (architecture)
  • How can I prioritize my queue? (algorithm)
  • Should I completely lock the counter when a transaction is in place or have a cached copy? (design)
  • Shoud I isolate orders from counter (design)

Can these questions be asked about business logic?

  • I have implemented the above logic for a single event. How to apply it for multiple events?
  • If ticket not available, the user must be put in a waiting list and must be allocated when a user cancels transaction. How about this implementation?

I believe these questions must never be asked here

  • Is my business logic right?
  • What web application should I use?

Could even give an elaborate example if required

1

Given your example questions, I think you mostly correctly identified where you want to ask them and what's on (and off) topic here:

Where there's disagreement

How to implement a queue algorithm? (Theoretical Computer Science)

Like Yannis mentions, Theoretical Computer Science is research-level only: unless you're talking about it at a graduate-level or higher, this wouldn't be on-topic there. If you're talking about putting it into code, you'll want Stack Overflow. If you're talking about putting it into programming terms (but still at the conceptual stage), it'll likely be fine here.

What is the generally accepted practice (vague but a general answer be provided)

9 times out of 10, this isn't a real question, or at best it's a non-constructive question. Questions need to provide specific, solvable problems: if that's missing, the answer to most "best practices" questions is "it depends" which really doesn't help anyone.

But given the set that are answerable, some are going to be Stack Overflow (I have X problem, my code isn't working, what's the generally accepted way to fix it?), some Code Review (What's the generally accepted way to refactor this code?), and some us (more whiteboard stuff)

What checkout module is available in Python? (definitely Stack Overflow)

They're definitely off-topic here, but recommendation questions have been asked so many times on Stack Overflow, it's hard to imagine one that would actually be high quality or not duplicated. The best way to ask these are, "I'm doing X. Here is my code with solution Y, but it doesn't do Z requirement. Is there a better way to accomplish what I'm doing?" and let the recommendation for a different library come naturally from the answers provided.

How can I prioritize my queue? (algorithm)

There really isn't a good place to ask these types of questions on the network, but I think right now it's settled on Programmers being the best fit, even though it's unlikely to get a very good answer. There's a non-research level Computer Science site proposal in the works, where non-implementation questions about algorithms will probably wind up being best answered.

The ones you couldn't decide on

What to do when two users simultaneously access the system?

This would depend on the specifics of the question, but it sounds like high-level stuff that would be a fit here. If it was implementation specific (like really heavy into code), you might be better suited on Stack Overflow, but it likely would be fine here even still.

I have implemented the above logic for a single event. How to apply it for multiple events?

Again, if you're supplying code and you want to know how to adapt it, Stack Overflow is the better choice. If you're still talking abstractly, it's on-topic here.

If ticket not available, the user must be put in a waiting list and must be allocated when a user cancels transaction. How about this implementation?

This is a bit tricky: it's definitely not a fit for us, but as to where it's on-topic it could either go Stack Overflow or Code Review. The safe bet would likely be Stack Overflow, but if flagged, I'd still run it by the mods on Code Review.

  • Where to post to get information about generally-accepted/followed industry practices? – Ubermensch Dec 19 '11 at 12:30
  • @Ubermensch Probably here. – yannis Dec 19 '11 at 12:42
  • @Ubermensch Depends on the question: most questions that ask for generally-accepted/followed best practices are usually too vague to be answerable (i.e. the answer is going to be "it depends"). But given the set that are answerable, some are going to be Stack Overflow (I have X problem, my code isn't working, what's the generally accepted way to fix it?), some Code Review (What's the generally accepted way to refactor this code?), and some us (more whiteboard stuff) – user8 Dec 19 '11 at 16:23
1

When to update my counter; before or after transaction? (possibly Stack Overflow)

Possibly.

How to implement a queue algorithm? (Theoretical Computer Science)

Nope, Theoretical Computer Science is for research-level questions. I don't think that How to implement a queue algorithm qualifies as research-level. Clustering algorithm for non-dimensional data is one example question they consider on topic there.

So, depending on complexity, it could be on topic here and there (and some on both sites). Ultimately it's about where the question has more chances to generate good answers.

Should I create separate tables for orders and counters (belongs at Code Review)

Definitely doesn't belong at Code Review. Code Review is strictly for reviews of working code, in this instance it might be acceptable to post your table structure for review, but even that might not be on topic there - Code Review is still in beta, what's on topic definition is still a work in progress.

Depending on what exactly is being asked, it might be acceptable here or Database Administrators - Stack Exchange - database design is on topic there.

What to do when two users simultaneously access the system? (cannot decide)

  • If what to do is asking for code, and it presents problematic code plus some effort to fix it, StackOverflow.
  • If the question asks for a conceptual design, a workflow, anything language agnostic, it should be on topic here.

What is the generally accepted practice (vague but a general answer be provided)

Depends on the practice, really.

What checkout module is available in Python? (definitely Stack Overflow)

Definitely doesn't belong here. Most similar questions are of extreme low quality (can be answered with minimal effort), for that alone I'm hesitant to say it belongs anywhere. Most of these are shopping advice questions, and those definitely don't belong on any Stack Exchange.

Can these questions be asked about business logic?

  • I have implemented the above logic for a single event. How to apply it for multiple events?
  • If ticket not available, the user must be put in a waiting list and must be allocated when a user cancels transaction. How about this implementation?

Yeap, I think these would fit here. How about this implementation? would qualify a question for Code Review, if and only if it's actual working code.

I believe these questions must never be asked here

  • Is my business logic right?
  • What web application should I use?

These cannot be safely decided on, they are extremely vague and we should approach them per case. Most What web application should I use are of low quality, but not as bad as the What checkout module is available in Python? type, and there are some that are quite good - those that present a very specific scenario and can only be answered by truly experienced developers.


I don't really think there's an easy answer to this. Your example is theoretical, it'd be a lot easier if you could identify existing example questions that fit your titles (if such exist).

And of course it's always possible for a borderline question to find a good home here, if it generates great answers. More often than not it's a judgement call, and questions get re-opened all the time.

Finally, there are rare cases that might be perfectly on topic here and on another site.

  • Regarding algorithms, I think questions regarding how algorithm works should be in Theoretical Computer science and how can i use it should have a place here – Ubermensch Dec 19 '11 at 12:28
  • algorithm and data structure concepts are clearly on topic here. I can't find any meta question that specifies it further, so if you think they should be off topic you should post another question and let the community decide. As for if they should be in Theoretical CS, that's up to the crowd over there to decide, and it doesn't have anything to do with whether we define questions regarding how algorithm works as off topic. I think your example question and everything that's not research level is off topic there, but I won't pretend to be 100% certain on what they regard research level. – yannis Dec 19 '11 at 12:39
  • @YannisRizos We had one question that attempted to define what we mean by "algorithms and concepts", but it didn't go into a lot of detail IMHO. – Adam Lear Dec 19 '11 at 17:49
  • @AnnaLear Of course my "let's keep some algorithms here, instead of TCS" sentiment is a little biased: I miss all those questions I had no idea what they were about. 99% percent of our current questions I couldn't answer, but still to find one that makes me feel I'm staring at a black hole - but of course hadn't gone through all of them yet. We need some research-level questions here... – yannis Dec 19 '11 at 23:15
  • I agree with Rizos. There should be more questions regarding robust design, working with algorithms, abstract elements and more. Still cannot a question here that distinguishes design and architecture of a software – Ubermensch Dec 20 '11 at 4:53
  • Well, finally, we got one algorithm question that made me feel like staring at a black hole. It got quickly migrated to CrossValidated, and found an answer there instantly (in the form of a duplicate question)... Still, nice we got it here first, even if to send it away... – yannis Dec 21 '11 at 13:33

You must log in to answer this question.

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