Code Review Websites
There's an endless number of resources for programmers in the form of code repositories, article, forums, etc., all of which offer some level of free, community-based information. But I haven't seen one thing: code review.
A quick google search is plugged with a lot of products to help the process, and various project guidelines. But nothing offering community based code review.
I'm picturing something along the lines of a forum where users can post code to be criticized by other users. I know the same thing exists for authors: There are various sites that organize readings of manuscripts for writers looking for critical feedback before submitting their work to a publisher.
Is there something out there like this that I'm missing? If not, I'd be willing to build something myself--my motive here comes from not having anyone around who's better than me to review my code and point out what I'm missing. If a coercive element is required, I already have a model. Critters is an example of the manuscript-reading organizing site that I mentioned above, and they have a simple rule: to get reviewed, you have to review. You earn points for reading other's manuscripts and submitting *useful* criticism (as determined by the author); you spend points to get others to read your work.
codereview.com and .org go nowhere, and codereview.net is held by a squatter. I've registered codereview.ws pre-emptively if this is an idea that needs executing.
Justin Johnson
Thursday, April 8, 2004
"But nothing offering community based code review."
Yep, there'd need to be some kind of incentive for such a site to work. But allow me to state one probably-obvious reason why such sites don't exist: some managers would no doubt have a fit if proprietary code were posted for all the world to see.
Erehwon
Thursday, April 8, 2004
I've thought about building such a site myself. If you have time, this is certaintly worth executing.
too lazy to fill it in
Thursday, April 8, 2004
True. I.P. issues *might* arise. But that is no different then any other forum where a developer might post for help.
I think a code review would be a great idea. It would become an excellent repository for design patterns and educating us 'hacks' on how to improve our code. From software algorithms to plain simple reformatting.
I'm always curious on the input of what makes certain techniques better then others. And a community forum would be an excellent critic.
Go for it!
sedwo
Thursday, April 8, 2004
I'm skeptical. Code review is usually in the wider context of the application in question, as well as whatever guidelines you have at the specific place of employment. Seems like it sounds better than it might actually be.
Brad Wilson (dotnetguy.techieswithcats.com)
Thursday, April 8, 2004
I don't know about anyone else, but this is something I've been waiting for.
As a hobbyist with no C/S background, I'm never quite sure what I'm writing is "elegant" and not a hack.
Learning
Thursday, April 8, 2004
Sounds worth a try.
Dennis Atkins
Thursday, April 8, 2004
"Manuscript review" sites, like "How to be a writer" classes and so on, are generally patronised by the mediocre. Those people aren't good or published writers and generally never will be.
They're almost a self selecting indicator of incompetence. They arise because of the tough competition to be published, where those who don't succeed desperately look for anything to help them further their quest.
I suspect a code review site would be the same.
Thursday, April 8, 2004
Except that the amateur programmers stand to make money from their code if it can be gotten to just work ;-) and the site provides a forum to help them achieve that
Seun Osewa (afriguru.com)
Thursday, April 8, 2004
"are generally patronised by the mediocre"
Not always.
http://bar.baen.com and http://fmwriters.com are two sites that I know of that are frequented by published authors.
double_dark
Thursday, April 8, 2004
"'Manuscript review' sites, like 'How to be a writer' classes and so on, are generally patronised by the mediocre. Those people aren't good or published writers and generally never will be."
Critters is highly regarded, and its members frequently make money selling their work. It is a good point, though: the level of review has to be high enough, generally, to interest the kind of experienced people who will make it worth participating.
Hey, Joel's Forum could be just another l337 clubhouse, but it isn't. I think that's something where time will tell.
Justin Johnson
Thursday, April 8, 2004
As I think about it, though, the subject matter of a code review site would tend to attract older, more mature and professional coders, or those looking to become that, simply because it's the kind of concerns that experienced coders have, not amateurs. You have to be pretty comfortable with coding itself to be worried about style and design.
Justin Johnson
Thursday, April 8, 2004
Unlike literary writing, code writing is a collaborative work more often than not. For most coders, you get some review from co-workers whether you ask for it or not (often in the form of "your code sucks", but sometimes better).
Also, unlike literary works, code is functional, and thus various solutions can be subjected to an orange-to-oranges comparison. If you compare, e.g., 10 hash table implementations, 1 is going to stand out as being most elegent, 1 as most efficient, and the rest are going to have little to offer.
Ori Berger
Thursday, April 8, 2004
Rubbish. Rarely is one implementation going to be the most efficient at everything. There's no such thing as an uber hashtable - it's a series of tradeoffs.
One might be faster but require more memory. Another might be a little slower but have better worst case behaviour. And so on.
Likewise on the elegance. Some might have elegant code internally but a harder to use interface. Another might offer a more elegant interface through things like templates, but trade that off on the slower compile speed and portability that such things tend to bring.
I don't think that any more code samples will be clearly "the best" than writing samples will be. The similarities between writing a novel and writing a computer program run quite deep really.
Sum Dum Gai
Thursday, April 8, 2004
Justin Johnson: you can't get code reviewed for free, so if you upload snippets no one would care. Really. However if you upload entire useful projects others could use immediately, there's an incentive because they are part owner/user.
Li-fan Chen
Friday, April 9, 2004
Sum Dum: I used to think that way too, until I studied Python's original (up to 1.6) hash table implementation; Pure elegance, _and_ blazing speed, _and_ extremely good statistical behaviour, the only downside being that there are up to log(n) reallocations along the growth.
The latest Python hash table (as of 2.3) traded some elegance for more speed. Feels a bit more "kludgish" to read, but it's not too bad, and obviously justified.
Pick a hash table implementation you regard as elegant / fast / optimized in ${metric of choice}, and compare it to Python. You might be surprised.
Another example I like is automated Tic-Tac-Toe ("Noughts and Crosses"). Do a quick google search and you'd find hundreds of variations, most of them longer than 200 lines, many of them playing a less-than-perfect game. I've got an excerpt from a magazine posted some 20 years ago, that plays a perfect game, and fits in 20 short Basic lines (that also include the clumsy text gui).
Ori Berger
Friday, April 9, 2004
I would truly love a site like that. I work alone and therefore don't have co-workers to review my code.
The only problem I see is incentive. If I need someone to review my code, then I am probably not comfortable enough to review someone else's code. Likewise, someone who is an elegant coder will probably have not interest in having their code reviewed.
shiggins
Friday, April 9, 2004
I would love such a service. I would also pay for such a service and I would pay more for a review done by someone more senior then someone else.
I code alone and thus someone to review my code with would be great.
Jeff
Friday, April 9, 2004
Okay, there's enough interest here that I'll start collecting email addresses and getting a basic version of what I'm talking about working. I've put up a rationale and brief roadmap at http://www.codereview.ws/ . Email me if you want to do something about this.
Justin Johnson
Friday, April 9, 2004
Ori, I hope you post the Basic tic-tac-toe code there. (Or at least give us hints to the algorithm.) I hear there's an elegant mathematical solution to the generalized NxN game... or at least whether a given empty board is winning for the 1st player. The only solution I know is brute-force search.
Tayssir John Gabbour
Saturday, April 10, 2004
Will post it here when I find the magazine (an old 'Your Computer' from 85, I think - I know it's here _somewhere_). From memory - it's brute force, and uses a score function from David Levy's "Computer Gamesmanship" book, which is optimal (It's called "an explicit Grundy function" in game theory, if I recall correctly).
The same column (called "I could do that") also featured a one-line recursive closed-shape fill implementation for the ZX Spectrum basic, which I can reproduce from memory .....
9990 IF POINT(x,y) <> 0 THEN PLOT x,y: LET x=x-1: GO SUB 9990: LET x=x+2: GO SUB 9990: LET x=x-1: LET y=y-1: GO SUB 9990: LET y=y+2: GO SUB 9990: LET y=y-1
9991 RETURN
I llike the elegance, and the fact that it the only stack space needed is for the gosub/return address, and not for any local arguments (not that the Spectrum had any provision for local arguments .....)
Ori Berger
Saturday, April 10, 2004
Recent Topics
Fog Creek Home
|