For someone like who is just starting out with TeX programming, it can be hard to produce quality code. I try to read as much as I can from various guides, but often my code may look dirty and ugly to the eye of an expert, even if it's completely doing its job.
Say I wrote some code, but then I wonder whether that's some good code or not. The best solution I can think of would be to ask a question like this:
CNCComment my code please?
I need some code to test if a letter is a Q, a T or something else. I wrote this:
\def\awesomemacro#1 {% \let\ivebeenhere0 \if#1Q This letter was a {\bf Q}\let\ivebeenhere1 \fi \if#1T This letter was a {\bf T}\let\ivebeenhere1 \fi \ifx\ivebeenhere0 This letter is so weird\fi }
It works. Can I improve it?
After writing this, one may hope for answers like
You should indent your code
or
You should use a boolean
or
Why don't you go fishing instead?
Of course, such a generic title would help no one: it would be extremely hard to find if you google it, and it's going to pop up with unrelated searches. But if the title were something like Is this the best way to write an else-if
statement?, it would be easy to find and maybe even helpful. Then again, I actually needed what I was asking, i.e. a cnc on my work (including things like the use of \bf
instead of \textbf
), which the new seo-friendly title does not represent completely.
So, my question here is: what's a good way to ask "cnc this" questions?
EDIT: ff524 pointed out that this kind of question would be perfect for Code Review. I totally forgot about that site. Feel pretty dumb right now.
EDIT2: Ok removed the cnc part. It was just "comment and criticism", it's often used in graphic design forums to ask others what they think about your work without sugarcoating. Sorry.
\bf
is deprecated in LaTeX but not in plain or ConTeXt, so with a low-level question of this type its not necessarily clear that\textbf
would be 'right'.)[tex]
tag; two of which I would not even consider as real TeX programming questions. So yes, while CodeReview should be the site for this kind of questions, it just won't help you unless people like egreg, David, Heiko, ... become regular users there. I would always try to ask here!