16
\$\begingroup\$

Suppose I made up a programming language and was working on an interpreter for it. Would that interpreter make a good code review question? It would probably be largish at a couple hundred lines. It could definitely be reviewed for performance and best practices, but otherwise any review seems like it would be excessively high-level.

\$\endgroup\$
  • 4
    \$\begingroup\$ I would say doing code review for your interpreter is a great idea. Sure it can be tricky since you're developing a language, but it think that having a good interpreter for it is part of what make a good language. We would not review design decisions of your languages, this would be out of scope, but everything else to make your interpreter look goods and work nicely would be on-topic! \$\endgroup\$ – Marc-Andre Apr 17 '15 at 14:31
  • \$\begingroup\$ Sure you can see codereview.stackexchange.com/q/67480/47826 \$\endgroup\$ – bhathiya-perera Apr 18 '15 at 12:11
  • \$\begingroup\$ A simple compiler would be on-topic. However, as you indicate, hundreds of lines would be a problem. If it's shorter, go for it. \$\endgroup\$ – Mast Apr 23 '15 at 14:39
19
\$\begingroup\$

I am assuming that by "made up" language, you mean a language that you have defined and created.

Any code posted in that language prior to you completing the interpreter for it would by definition be hypothetical code. There's no way for anyone to verify that the code works as intended, because well... it doesn't work at all. There's nothing to run that code.

However, that's not what you asked. You asked if you could have your interpreter reviewed.

I see no reason why you couldn't. It would probably take a good bit of effort to explain the grammar behind your language, and it would probably be a good idea to break the code down into several reviews of manageable chunks, but why not?

Let's run down the magic list.

  • Is code included directly in my question? (See Make sure you include your code in your question below.)

Let's assume so.

  • Am I an owner or maintainer of the code?

Yup.

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

Sure is.

  • Do I want the code to be good code? (i.e. not code-golfing, obfuscation, or similar)

You wouldn't be here if you didn't.

  • To the best of my knowledge, does the code work as intended?

Does it? I'm assuming yes for the purpose of the meta.

  • Do I want feedback about any or all facets of the code?

Again, I don't think you'd be here if you didn't.

\$\endgroup\$

You must log in to answer this question.

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