Forgive me if there already is such a place on stackexchange. I'm new here and definitely don't really have the hang of the place as yet. But I haven't found such a forum.

What I think would be helpful (for me) isn't really appropriate for a 'question', unless the question is "what do you think of this code?" which seems inappropriate. I'd like to be able to post some code that is as good as I can make it and get feedback and suggestions from all the folk here that know a lot more than I do. This would accelerate my progress quite a bit, and might be useful for others as well.

I'm speaking of writing macros, packages, and classes, not layout questions or questions that can be answered by reading one of the commercially available books. As far as I know, there is no place on Earth where such a *TeX code review process happens, and it seems like this is the natural place for it.


5 Answers 5


Somewhat in common with the other answers, my initial reaction is against the idea.

My difficulties start around about the question of differentiating between a clear case of "I've gone as far as I can, what else can I do?" and "Here's some junk I threw together.". If my tex macro files are anything to go by, they are a complete mess of half-hacks and "cargo cult programming" held together by the flimsiest \ifs and \ofs to ensure that nothing conflicts with anything else. I'd would love to have someone take a look at that and (gently) point out all my mistakes, but I feel that that really would be a waste of their time.

Far better would be for me to identify the weak point in my code and ask a very, very specific question on that. I could include a little context, and thereby allow for someone to say, "By the way, you can collapse those twenty \expandafters to one \noexpand.".

So try to identify a task in your code, say, "Here's how I do X. Is there a better way?". Then you're not asking someone to rewrite your entire code, but just to give you a helping hand along the way.

SE is optimised for short, concise answers to focussed questions. It took me a while on MathOverflow to realise that, but now that I have then my life on the SE sites is a lot more relaxed!

One more thing. You comment about different methods of learning. Absolutely, there are many different ways of learning something. However (and this is why I don't really participate in math.SE), I'm not paid to teach you (or anyone else) anything here. To properly teach something where you aren't already most of the way there, I'd have to know a lot more about your background, what you already know, more about what you're trying to achieve, and so forth. That is too much information for the amount of time I have to spend on these sites. I'm happy to help, to share what I've learnt, but to a fellow traveller, not to someone at the start of their journey.

That may read harsher than it actually is. There's a heck of a lot that one can learn just by having someone, at the crucial time, say "Go left at the crossroads.". The SE architecture is set up (it seems to me) to help us identify those crossroads and stand there saying, "Go left here.". If lots of us are standing at lots of crossroads, then that's almost as good as having a guide for the whole route.

  • Background: PhD in Elec Engr,UCLA, (focus on MEMS, minors - Dyn Systems, Comp Modeling). 9 years engr@NASA,2 yrs @Cal-Tech. Started using *TeX 1992, started programming in TeX 2005. Written 2 packages and UCLA thesis class (the new one). I would consider myself a 'fellow traveler' by your definition. I look forward to getting your help on bringing my *TeX programming skills to the next level :-) . Thanks.
    – bev
    Commented Nov 26, 2010 at 20:11

After looking through some discussions on meta.so (e.g. this and this), I think the policy there is that code reviews are okay if used in moderation. The key paragraph seems to be

As long as there isn't a super massive chunk of code and the author of the post is pretty clear about what areas he is looking for critiques on, I don't see a problem with it.

People there are also suggesting to use Refactor My Code, but that doesn't have a TeX category, so it doesn't apply to us.

So, IMO posting short bits of code and a description what it should do and then asking something like β€œIs there a better way to do this?” is acceptable.

  • Thanks for the links. I think I see part of the resistance to this idea which hadn't occurred to me. The feeling I get is that there is a suspicion that people wanting others to look at their code are just lazy. They want others to do their work for them. I understand this fear, as I've had lots of people take advantage of me in this way. But that's not what I'm talking about. I'm talking about creating a method whereby people can learn more by getting help from people who know more. This whole site is about learning, no? That's why questions/answers are the core interaction.
    – bev
    Commented Nov 22, 2010 at 6:56
  • - con't - But questions and answers are not the only, or even always the best, method of teaching. Why should we limit ourselves to one method? Especially when that method has an inherent upper bound? (one can only ask a question about that which one doesn't understand. One can't ask a question about something outside of one's experience.) Maybe a "Learning Forum" where people could pose question specifically about such things. After all, no one has to read anything if they don't care to. Some people, me for instance, would be happy to do this when I have time.
    – bev
    Commented Nov 22, 2010 at 7:07
  • @bev: You won't get any official support through the software of this site. Stack overflow is rather single-minded in this aspect (which generally is a good --- it does only on thing, but does that exceptionally well). If you want a site dedicated to code review, you might try to lobby the Refactor My Code people to accept TeX. Otherwise, as I said I have nothing against code review questions an tex.SE, as long they are somewhat focused on specific issues.
    – Caramdir
    Commented Nov 22, 2010 at 7:10
  • 1
    Funny, but I emailed Marc Cournoyer (I think the main guy at refactormycode) right after I wrote my comment last night, asking whether he would consider including *TeX. In the meantime I'll do as you suggest.
    – bev
    Commented Nov 22, 2010 at 18:15


First off, welcome to TeX&Co., enjoy your stay, and help yourself to some questions!

There has been some discussions recently on meta.TeX (can't find the question right now) about a similar issue. AFAIR, the general agreement was that these are okay, as long as they are formulated as [meaningful] questions. In your particular example, it could look something like:

I'm trying to do [foo] in my thesis, and I tried the following:

<<decent amount of black magic code and helpful comments>>

That works all right, however, my [bar] is not exactly [squiggle], so I tried then packages tikz (people always suggest this), and [shnoo]. I couldn't make this work, so I'm looking for help on how to typeset my [bar]. Also, I would want to do this in {Con|Lua|La|Xe|XeLa}TeX{t|}, but I'd settle for a TeX solution as well.

Also, we had some discussion lately on whether answerers should try to improve submitter's code beyond what she requires -- fixing obsolete packages and commands, for example, and the general consensus seems to be that it's perfectly okay, if the time permits.

  • 1
    Martin, the problems is that I want to post code that is the best I can do, i.e. I won't have any questions. For me, questions arise when I don't know how to do something, or when I know that a better way exists but not what it is. But my 'finished code' is still not as concise or efficient or elegant as others who know more could make it. But how do I ask that question? "Hey fellas, can any of you make this code more elegant?" But that's a code review process, hence my desire to have such a forum.
    – bev
    Commented Nov 22, 2010 at 2:02
  • oh, and thanks for the welcome :-) . So far I'm very impressed with stackexchange. The interface is really wonderful. Well thought out and implemented. The people are friendly and knowledgeable. I haven't been here a week yet and I can already feel the strong sense of community.
    – bev
    Commented Nov 22, 2010 at 2:12

This might be a good use for chat....(since we still haven't found one for it...)

  • That would be great. Maybe the person who wants his code reviewed could get room, announce it somewhere on this site (sidebar for announced code-reviews?) and just see whether anyone shows up. The downside is that this would require busy people do work around your schedule rather than theirs, which I would wager wouldn't go over well.
    – bev
    Commented Nov 22, 2010 at 2:09

I'd normally ask on c.t.t. in these cases

  • c.t.t. seems to have gone down lately, not only there is lower activity IMHO it seems a lot of spam gets through. HN some time back allowed a Tell HN tag. This was well received and normally generates a lot of activity. I think bev's suggestion is good, provided not the whole code is posted, but only the interesting parts for comments and the full code posted on google code if necessary or git.
    – yannisl
    Commented Nov 21, 2010 at 18:30
  • I suppose you're correct, but as Yiannis points out, there's so much spam on it now I mostly don't bother. It sounds like you don't like my idea of doing it here. Would you care to share your reasons?
    – bev
    Commented Nov 22, 2010 at 2:05
  • @Yiannis, it seems plain that the big problem with the idea is that people might post too much code. So I like your idea of posting 'interesting' bits with the rest on google code. That seems like it would work.
    – bev
    Commented Nov 22, 2010 at 3:37

You must log in to answer this question.

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