哪里可以获得代码的同行评审以及如何引起我的代码注意?

时间:2021-11-27 22:13:55

I'm just now learning to programming at age 17. It's hard for me to talk to other programmers as I'm just out of high school (which means I can't take programming courses). I know that I write terrible code, and not like Jeff Atwood terrible code, my code actually sucks. So where can I post some of my code and get real programmers to review it. I know if I had a question I could ask it on *, but I want to post a whole class and get a review on it.

我现在才开始学习17岁的编程。由于我刚从高中毕业(这意味着我不能参加编程课程),我很难和其他程序员交谈。我知道我编写了可怕的代码,而不是像Jeff Atwood那样糟糕的代码,我的代码实际上很糟糕。那么我在哪里可以发布我的一些代码并让真正的程序员来审查它。我知道如果我有一个问题我可以在*上问它,但我想发布一个全班并对其进行评论。

The real problem here is that I'm not going to be writing the next great piece of Software. I'm going to be writing a really useless class, which will serve no other purpose than to teach me how to program. This code will never be used, ever! EVER! How can I get an advanced (or even intermediate) programmer to look at my code?

这里真正的问题是我不会写下一个伟大的软件。我将要写一个真正无用的课程,除了教我如何编程之外别无其他目的。永远不会使用此代码! EVER!如何让高级(甚至中级)程序员查看我的代码?

Thanks in advance! ;-)

提前致谢! ;-)

8 个解决方案

#1


14  

Look to the open source community. There are plenty of existing and new projects that would love an eager (if inexperienced) developer to offer support.

看看开源社区。有很多现有的和新的项目都喜欢渴望(如果没有经验的)开发人员提供支持。

Going this route offers two advantages:

走这条路有两个好处:

  1. You get to see great code in action and learn from it
  2. 你可以看到很棒的代码并从中学习

  3. Any changes you submit will be reviewed by an experienced developer and they will often give you excellent suggestions as to how to improve your code before it will be accepted
  4. 您提交的任何更改都将由经验丰富的开发人员进行审核,他们通常会在您的代码被接受之前提供有关如何改进代码的绝佳建议

Start by choosing a project in your language (there are a bunch in c++) and check out the code. You don't need to understand it all, but you must be able to understand at least a portion of it.

首先选择您所用语言的项目(c ++中有一堆)并查看代码。您不需要全部了解它,但您必须能够理解它的至少一部分。

If the project looks way to complicated, keep looking. Younger projects tend to have less code that you need to learn.

如果项目看起来很复杂,请继续关注。较年轻的项目往往需要学习的代码较少。

#2


9  

Why don't you try RefactorMyCode?

你为什么不试试RefactorMyCode?

#3


9  

If you can't get great programmers to look at your code, do the next best thing: look at theirs!

如果你不能让伟大的程序员看你的代码,那就做下一个最好的事情:看看他们的!

Look for a bunch of code snippets that do the same (simple) thing. Before you look at them too closely, write your own code to perform the same task. Compare all of the snippets with your own (and each other!) and try to figure out the reasons for the differences.

寻找一堆做同样(简单)事情的代码片段。在仔细查看它们之前,请编写自己的代码以执行相同的任务。将所有片段与您自己(以及彼此!)进行比较,并尝试找出差异的原因。

I recommend looking for code from well established projects. Code from tutorials often ignores important details for the sake of simplicity.

我建议从完善的项目中寻找代码。为简单起见,教程中的代码经常忽略重要的细节。

#4


5  

I would try not to write useless code, but attempt to solve some particular problem. Your learning will be more advanced if you are learning in the context of a real-world scenario. It doesn't have to be a big business domain; could even be a game or a shareware utility.

我会尽量不写无用的代码,但试图解决一些特定的问题。如果您在真实场景的环境中学习,您的学习将更加先进。它不一定是一个大的业务领域;甚至可以是游戏或共享软件实用程序。

As for getting your code reviewed, the open source community is a good way to go as The Lame Duck says - in fact you're guaranteed it gets some form of review if you actually contribute to a project. Other avenues to explore: your local C++ users' group, checking out a co-op program available through a junior college, or engaging someone in a company that sponsors interns.

至于让你的代码得到审查,开源社区是一个很好的方式,因为Lame Duck说 - 事实上,如果你真的为项目做出贡献,你可以保证得到某种形式的审查。其他探索途径:您当地的C ++用户组,查看大专院校提供的合作项目,或聘请实体赞助实习生的公司。

I haven't tried sites such as RefactorMyCode as suggested by Gilad Naor, but that seems promising. And, yes, * is a good place for bite-sized chunks of code. If you do that, explain what you are trying to do, and why you are trying to do it that way, and ask if there's a better approach. Good luck!

我没有按照Gilad Naor的建议尝试像RefactorMyCode这样的网站,但这看起来很有希望。而且,是的,*是适合一口大小代码的好地方。如果你这样做,请解释你想要做什么,以及你为什么要这样做,并询问是否有更好的方法。祝你好运!

#5


4  

I think the best way to learn is the way I learned (I may be biased): trial and error. I just wrote programs all the time, teaching myself as I went. I'd write terrible code, and I would wrestle with making it do what I wanted. Often it would make me give up on that particular project. But on the next project, I'd take a different approach, and it would work better. Repeat ad nauseam. Once you know where the rough spots are in your designs, you'll be able to ask specific questions on places like SO, or, better yet IMHO, come up with better designs yourself. I independently invented all the major design patterns just through frustration at the solutions I'd created in the past. I think this gives me a valuable perspective, since for most people design patterns are just a "best practice", but I know the pain that comes with using other designs, and I can see signs of bad designs in code very easily (it takes one to know one). This last skill is one that I often see lacking in other programmers... they can't see why their design is deficient and they should use something else.

我认为最好的学习方式是我学习的方式(我可能有偏见):反复试验。我一直在编写程序,在我去的时候自学。我写了可怕的代码,我会努力让它做我想做的事情。通常它会让我放弃那个特定的项目。但是在下一个项目中,我采取了不同的方法,它会更好。重复广告恶心。一旦你知道你设计中的粗糙点在哪里,你就可以询问有关像SO这样的地方的具体问题,或者更好的是恕我直言,自己想出更好的设计。我只是通过对过去创建的解决方案感到沮丧,独立地发明了所有主要的设计模式。我认为这给了我一个有价值的观点,因为对于大多数人来说,设计模式只是一种“最佳实践”,但我知道使用其他设计带来的痛苦,我可以很容易地看到代码设计不良的迹象(需要一个人知道一个)。这最后一项技能是我经常看到的其他程序员所缺乏的......他们无法理解为什么他们的设计缺乏并且他们应该使用别的东西。

#6


1  

You could always try a site like Project Euler, where there are a whole load of problems that will test your skills and a whole bunch of solutions to those problems, submitted by others. Project Euler tends to focus on algorithms rather than higher level programming constructs, but I imagine that there are others in a similar vein.

您可以随时尝试像Project Euler这样的网站,其中存在大量问题,这些问题将测试您的技能以及其他人提交的一系列问题解决方案。项目Euler倾向于关注算法而不是更高级别的编程结构,但我想也有其他类似的东西。

#7


0  

Do something fun and don't worry too much about code style yet. I started out with BASIC on Commodore 64 without even realizing that there was such a thing as clean code vs dirty code. If I had worried a lot about that then, it might have hindered me from progressing. You always learn best when doing it playfully.

做一些有趣的事情,不要过多担心代码风格。我开始在Commodore 64上使用BASIC,甚至没有意识到存在干净代码与脏代码这样的事情。如果我当时担心很多,那可能会妨碍我的进步。在玩耍时总是学得最好。

#8


0  

Maybe a bit late, but since StackExchange has Code Review, it worth the answer:

也许有点晚了,但是由于StackExchange有Code Review,所以值得回答:

Code Review Stack Exchange is a question and answer site for peer programmer code reviews. It's 100% free, no registration required.

Code Review Stack Exchange是同行程序员代码审查的问答网站。它是100%免费的,无需注册。

Here is the link: Code Review Stack Exchange

这是链接:代码审查堆栈交换

#1


14  

Look to the open source community. There are plenty of existing and new projects that would love an eager (if inexperienced) developer to offer support.

看看开源社区。有很多现有的和新的项目都喜欢渴望(如果没有经验的)开发人员提供支持。

Going this route offers two advantages:

走这条路有两个好处:

  1. You get to see great code in action and learn from it
  2. 你可以看到很棒的代码并从中学习

  3. Any changes you submit will be reviewed by an experienced developer and they will often give you excellent suggestions as to how to improve your code before it will be accepted
  4. 您提交的任何更改都将由经验丰富的开发人员进行审核,他们通常会在您的代码被接受之前提供有关如何改进代码的绝佳建议

Start by choosing a project in your language (there are a bunch in c++) and check out the code. You don't need to understand it all, but you must be able to understand at least a portion of it.

首先选择您所用语言的项目(c ++中有一堆)并查看代码。您不需要全部了解它,但您必须能够理解它的至少一部分。

If the project looks way to complicated, keep looking. Younger projects tend to have less code that you need to learn.

如果项目看起来很复杂,请继续关注。较年轻的项目往往需要学习的代码较少。

#2


9  

Why don't you try RefactorMyCode?

你为什么不试试RefactorMyCode?

#3


9  

If you can't get great programmers to look at your code, do the next best thing: look at theirs!

如果你不能让伟大的程序员看你的代码,那就做下一个最好的事情:看看他们的!

Look for a bunch of code snippets that do the same (simple) thing. Before you look at them too closely, write your own code to perform the same task. Compare all of the snippets with your own (and each other!) and try to figure out the reasons for the differences.

寻找一堆做同样(简单)事情的代码片段。在仔细查看它们之前,请编写自己的代码以执行相同的任务。将所有片段与您自己(以及彼此!)进行比较,并尝试找出差异的原因。

I recommend looking for code from well established projects. Code from tutorials often ignores important details for the sake of simplicity.

我建议从完善的项目中寻找代码。为简单起见,教程中的代码经常忽略重要的细节。

#4


5  

I would try not to write useless code, but attempt to solve some particular problem. Your learning will be more advanced if you are learning in the context of a real-world scenario. It doesn't have to be a big business domain; could even be a game or a shareware utility.

我会尽量不写无用的代码,但试图解决一些特定的问题。如果您在真实场景的环境中学习,您的学习将更加先进。它不一定是一个大的业务领域;甚至可以是游戏或共享软件实用程序。

As for getting your code reviewed, the open source community is a good way to go as The Lame Duck says - in fact you're guaranteed it gets some form of review if you actually contribute to a project. Other avenues to explore: your local C++ users' group, checking out a co-op program available through a junior college, or engaging someone in a company that sponsors interns.

至于让你的代码得到审查,开源社区是一个很好的方式,因为Lame Duck说 - 事实上,如果你真的为项目做出贡献,你可以保证得到某种形式的审查。其他探索途径:您当地的C ++用户组,查看大专院校提供的合作项目,或聘请实体赞助实习生的公司。

I haven't tried sites such as RefactorMyCode as suggested by Gilad Naor, but that seems promising. And, yes, * is a good place for bite-sized chunks of code. If you do that, explain what you are trying to do, and why you are trying to do it that way, and ask if there's a better approach. Good luck!

我没有按照Gilad Naor的建议尝试像RefactorMyCode这样的网站,但这看起来很有希望。而且,是的,*是适合一口大小代码的好地方。如果你这样做,请解释你想要做什么,以及你为什么要这样做,并询问是否有更好的方法。祝你好运!

#5


4  

I think the best way to learn is the way I learned (I may be biased): trial and error. I just wrote programs all the time, teaching myself as I went. I'd write terrible code, and I would wrestle with making it do what I wanted. Often it would make me give up on that particular project. But on the next project, I'd take a different approach, and it would work better. Repeat ad nauseam. Once you know where the rough spots are in your designs, you'll be able to ask specific questions on places like SO, or, better yet IMHO, come up with better designs yourself. I independently invented all the major design patterns just through frustration at the solutions I'd created in the past. I think this gives me a valuable perspective, since for most people design patterns are just a "best practice", but I know the pain that comes with using other designs, and I can see signs of bad designs in code very easily (it takes one to know one). This last skill is one that I often see lacking in other programmers... they can't see why their design is deficient and they should use something else.

我认为最好的学习方式是我学习的方式(我可能有偏见):反复试验。我一直在编写程序,在我去的时候自学。我写了可怕的代码,我会努力让它做我想做的事情。通常它会让我放弃那个特定的项目。但是在下一个项目中,我采取了不同的方法,它会更好。重复广告恶心。一旦你知道你设计中的粗糙点在哪里,你就可以询问有关像SO这样的地方的具体问题,或者更好的是恕我直言,自己想出更好的设计。我只是通过对过去创建的解决方案感到沮丧,独立地发明了所有主要的设计模式。我认为这给了我一个有价值的观点,因为对于大多数人来说,设计模式只是一种“最佳实践”,但我知道使用其他设计带来的痛苦,我可以很容易地看到代码设计不良的迹象(需要一个人知道一个)。这最后一项技能是我经常看到的其他程序员所缺乏的......他们无法理解为什么他们的设计缺乏并且他们应该使用别的东西。

#6


1  

You could always try a site like Project Euler, where there are a whole load of problems that will test your skills and a whole bunch of solutions to those problems, submitted by others. Project Euler tends to focus on algorithms rather than higher level programming constructs, but I imagine that there are others in a similar vein.

您可以随时尝试像Project Euler这样的网站,其中存在大量问题,这些问题将测试您的技能以及其他人提交的一系列问题解决方案。项目Euler倾向于关注算法而不是更高级别的编程结构,但我想也有其他类似的东西。

#7


0  

Do something fun and don't worry too much about code style yet. I started out with BASIC on Commodore 64 without even realizing that there was such a thing as clean code vs dirty code. If I had worried a lot about that then, it might have hindered me from progressing. You always learn best when doing it playfully.

做一些有趣的事情,不要过多担心代码风格。我开始在Commodore 64上使用BASIC,甚至没有意识到存在干净代码与脏代码这样的事情。如果我当时担心很多,那可能会妨碍我的进步。在玩耍时总是学得最好。

#8


0  

Maybe a bit late, but since StackExchange has Code Review, it worth the answer:

也许有点晚了,但是由于StackExchange有Code Review,所以值得回答:

Code Review Stack Exchange is a question and answer site for peer programmer code reviews. It's 100% free, no registration required.

Code Review Stack Exchange是同行程序员代码审查的问答网站。它是100%免费的,无需注册。

Here is the link: Code Review Stack Exchange

这是链接:代码审查堆栈交换