14
\$\begingroup\$

I am currently developing an Android application, which makes use of tabs. Because I faced some problems when updating individual tabs in the UI, I have created a new app whose sole purpose is to act as something I can safely tinker with.
Eventually, I found a solution, which I want to integrate into my real app.

Question: Can I post my pseudo-app?

A point of contention could be the answer to the question from the FAQ below:

• Is it actual code from a project rather than pseudo-code or example code?

I would argue that my pseudo-app does not fall under the pseudo-code category because

  • it does contain real code, which I plan to fully integrate into my real app, and
  • the code isn't out of context. The (UI) logic the pseudo-app should demonstrate is wholly self-contained.
\$\endgroup\$
  • 10
    \$\begingroup\$ Change your mental perspecive to re-classify your pseudo-app as: "A small project to create a working proof-of-concept", and now your project is "real", and the code is real. We do this all the time for people doing learning exercises. \$\endgroup\$ – rolfl Mar 29 '15 at 17:03
15
\$\begingroup\$

Yes, on two conditions:

  1. Don't oversimplify.

    If you strip out so much information that the question no longer makes sense, then the code becomes harder to review, not easier.

    Also be aware that stripping out context can alter the quality of the answer.

  2. Don't include a disclaimer that it is a simplified version of the real thing.

    We can review the code that you posted. We cannot possibly review the code that exists in your mind that you chose not to post. Please do not tell us that what you have posted is a simplified version of something grander — that only makes your question either Unclear or Hypothetical.

    Also, if you receive an answer that improves your simplified example, but somehow isn't relevant the application that you had in mind, please bite your tongue and refrain from asking "But what if …?"

    If your question looks so obviously fake that you feel like you need a disclaimer, you've probably oversimplified.

In summary, be very careful what you trim out. If in doubt, tell us more, not less. Code Review works best when you show us your code in its native habitat, not an artificially sterilized version of it.

\$\endgroup\$
8
\$\begingroup\$

I'd say:

Yes, but be careful with how pseudo it is.

Code snippets which are simplified for the sake of posting to Code Review are generally going to be off-topic. If you simplify elements, you're eliminating aspects which would otherwise be part of the review.

But reviewing an entire application is well out of the question... the scope of the question would just be way too broad.

The better approach would be a complete recreation of the particular tab in question (in iOS we'd be talking about a view controller) and posting that up for review.

If you've developed a sandbox application for the sake of testing this chunk of code and then intend to move this code exactly as is into the full project, then this code might be a good fit for a Code Review question.

But this isn't Stack Overflow. We don't want you to boil your code down to just the area of most specific concern and abstract out all of the other stuff. If it looks like you've done that, we might close your question.

\$\endgroup\$
  • \$\begingroup\$ possibly related meta answer of mine meta.codereview.stackexchange.com/a/5162/3766 \$\endgroup\$ – Vogel612 Mar 29 '15 at 17:02
  • \$\begingroup\$ If posting the actual code verbatim isn't an option for one reason or another, then Code Review may not be the resource you're looking for. \$\endgroup\$ – nhgrif Mar 29 '15 at 17:04
  • 2
    \$\begingroup\$ But reviewing an entire application is well out of the question... the scope of the question would just be way too broad. -- I just want to say that there is no real definition on "how much code is too much". The maximum limit for a Code Review question (description + code + concerns) is 30 000 characters, that's it. \$\endgroup\$ – Simon Forsberg Mar 29 '15 at 17:29

You must log in to answer this question.

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