自学成才程序员

    科技2023-12-05  107

    自学成才程序员

    One of my roommates in college was a computer science major that had an internship every summer at Google or another Alphabet company. The effect that had on me was I developed a strong case of imposter syndrome. In turn the imposter syndrome lead me to carving out lots of time to get better as a programmer, despite being an economics and statistics double major. As someone that is self taught (and by self taught I mean I really had hundreds of teachers on YouTube, LinkedIn Learning, Medium, and Stack Overflow), I’ve come to realize that there are some common problems with teaching yourself to code. In my opinion, making your own video game exposes those problems very quickly.

    我在大学里的一个室友是一名计算机科学专业的学生, 每年夏天在Google或其他Alphabet公司实习。 对我的影响是我患上了冒名顶替综合症。 反过来,冒名顶替综合症使我花了很多时间来提高自己成为一名程序员的能力,尽管是经济学和统计学双主修。 作为一个自学成才的人(通过自学成才,我的意思是说我在YouTube,LinkedIn学习,中等和堆栈溢出方面确实有数百名老师),我逐渐意识到,教自己编写代码存在一些常见问题。 在我看来,让自己的视频游戏暴露出这些问题很快 。

    明显的面向对象程序设计 (Obvious Object Oriented Programming)

    If you are self-taught, you have probably learned about object oriented programming (OOP) at some point, and you probably understand in theory it’s benefits. But this does not necessarily mean that you have been teaching yourself to consistently use OOP. The problem many self taught programmers (or any newbies really) experience when learning to program is that the basic challenges they are given are actually best done in a procedural format. Let’s take a problem from an online intro to Java course I did as an example. In this assignment, I was tasked with creating an Animal class, and Dog and Cat classes that inherit from the Animal class. Then I was told to create both Dog and Cat objects and run a their methods which printed “bark” and “meow” to the command prompt. While this teaches you about how to create a class, and what inheritance is, you don’t really see the advantage of OOP in action. In reality this simple animal example was still a procedural-esque programming task, since there was an explicit goal you were coding for, it just happened to use objects.

    如果您是自学成才,则可能已在某个时候学习了面向对象编程(OOP),并且从理论上您可能会了解它的好处。 但这并不一定意味着您已经在教导自己始终使用OOP。 许多自学成才的程序员(或任何新手,实际上)在学习编程时都会遇到的问题是,他们所面临的基本挑战实际上最好以程序形式解决。 让我们以我做过的Java课程的在线介绍中的一个问题为例。 在此作业中,我的任务是创建一个Animal类,以及从Animal类继承的Dog和Cat类。 然后,我被告知要同时创建Dog和Cat对象,并运行它们的方法,该方法将“ bark”和“ meow”打印到命令提示符。 尽管这教会了您有关如何创建类以及继承是什么的知识,但您实际上并没有真正看到OOP在操作中的优势。 实际上,这个简单的动物示例仍然是一个过程式编程任务,因为您要编写一个明确的目标,所以它恰好使用了对象。

    A good understanding of OOP comes from unplanned behavior, in my opinion. Imagine you’re coding a relatively simple game like Super Mario Bros. Since the player of the game can make any choice they want, you have to think carefully about how the objects interact and be prepared for any input that may lead to a state in the game that you did not pre-plan.

    我认为,对OOP的良好理解来自计划外的行为。 想象您正在编写一个相对简单的游戏,例如《超级马里奥兄弟》,由于游戏玩家可以做出他们想要的任何选择,因此您必须仔细考虑对象之间的交互方式,并为可能导致状态改变的输入做好准备。您未预先计划的游戏。

    Besides being required to write object oriented code, the objects you write in code actually manifest on screen. In this example, Mario and all the objects he can interact with are actual objects in your code that you have to create classes for. Now the objects and the advantages of object oriented programming are both obvious to the programmer, it is clear not only what the objects are, but there properties and methods as well. The benefits of OOP are also more likely to be reinforced in the development of a game like Mario. For example, you may say something like “When Mario touches an enemy I want him to ___” which makes you realize you need a super class for all enemies. Not only does that one example show you the need for abstraction and inheritance, but it also shows you the benefit of code modularity. If you later decide you want Mario to behave differently based on what happens when he touches different enemies, having code encapsulated to the relevant objects makes your job way easier.

    除了需要编写面向对象的代码外,您在代码中编写的对象实际上还显示在屏幕上。 在此示例中,Mario和他可以与之交互的所有对象都是您必须为其创建类的代码中的实际对象。 现在,面向对象编程的对象和优点对于程序员来说都是显而易见的,不仅对象是什么,而且属性和方法也很清楚。 在开发诸如Mario之类的游戏时,也更有可能增强OOP的优势。 例如,您可能会说“当马里奥碰到敌人时我要他___”之类的字眼,这使您意识到您需要为所有敌人提供超一流的技能。 该示例不仅向您展示了对抽象和继承的需求,而且还向您展示了代码模块化的好处。 如果以后您决定让Mario根据他碰到不同敌人时发生的事情来表现不同,则将代码封装到相关对象中将使您的工作变得更加容易。

    I suppose what I’m really saying here is that most self-taught programmers learn OOP when doing tasks where procedural methods best apply. When creating a video game, OOP is actually the best and most natural way of thinking about your code.

    我想我在这里真正要说的是,大多数自学成才的程序员在执行最适合程序方法的任务时都会学习OOP。 创建视频游戏时,OOP实际上是思考代码的最佳,最自然的方式。

    版本控制 (Version Control)

    Self-taught or not, if you’re someone that works a lot on personal projects, you’re likely going to be working alone a lot. Most non-commercial personal projects (in my experience) don’t teach you that much about version control because projects have narrow goals and the production of a project usually stops when the goal of a project is reached. On a typical project most people will make commit after commit to the main branch until it the project is finished.

    不管是不是自学成才的人,如果您是在个人项目上工作很多的人,那么您很可能会独自工作很多。 大多数非商业性个人项目(以我的经验)对版本控制的了解不多,因为项目的目标狭窄,并且通常在达到项目目标时才停止生产。 在一个典型的项目中,大多数人都会在提交到主分支之后再提交提交,直到该项目完成为止。

    In a video game there are way more optional features or additional levels that can be added. On a video game, each enhancement ends up as its own branch and better enforces the practice of merging. When every feature is necessary for your projects completion, there is much less need to create a branch for a feature, it might as well all be done together.

    在视频游戏中,可以添加更多可选功能或附加级别。 在视频游戏上,每个增强功能最终都作为其自己的分支,并且更好地实施了合并实践。 当每个功能对于完成项目都是必需的时,为功能创建分支的需求就更少了,它最好一起完成。

    好有趣 (It’s Fun)

    My personal theory about why students seem to like reading and social sciences more than math is that the delayed feedback achieved in learning math. When you read something or learn a new fact, that fact is immediately understood and you now have the pleasure of knowing it. When it comes to math some problems take at minimum a few minutes of work before you find the correct answer. It’s fun to learn and I think that having to wait to receive feedback on your understanding can be scary and daunting for many people trying to learn something. I think programming is an enjoyable thing to do because the second you run your code you get pretty quick feedback if it worked or not, sometimes immediate. This is why it’s so easy to get lost in your code and then suddenly realize it’s 2:00 AM and you’re still happily at work.

    我个人关于为什么学生似乎比数学更喜欢阅读和社会科学的个人理论是,在学习数学方面获得了延迟的反馈。 当您阅读某些东西或学习一个新的事实时,该事实会立即被理解,您现在很高兴知道它。 在数学方面,某些问题至少需要花费几分钟的时间才能找到正确的答案。 学习很有趣,而且我认为必须等待接收对您的理解的反馈对于许多尝试学习某些东西的人来说可能是令人恐惧和艰巨的。 我认为编程是一件令人愉快的事情,因为在您运行代码的第二秒钟,无论是否有效,有时都会立即得到快速反馈。 这就是为什么它很容易迷失在您的代码中,然后突然意识到是凌晨2:00,而您仍然很高兴地在工作。

    Finally, I’ll say that people of all stripes find video games interesting. Even if you don’t find video games intrinsically fun, you do at least have an understanding of what a game is and how your code affects the game. When you write yet another trivial program about a Dog class inheriting from an Animal class in yet another tutorial, it’s difficult to see how any of it applies to the real world. There is something about interacting with something you have programed yourself that brings about a much higher level of satisfaction. Good luck in your coding endeavors!

    最后,我会说各行各业的人都觉得电子游戏很有趣。 即使您并不觉得视频游戏本身具有乐趣,您至少也应该了解游戏是什么以及代码如何影响游戏。 当您在另一个教程中编写关于Dog类从Animal类继承的另一个琐碎程序时,很难看到其中的任何一个如何应用于现实世界。 与自己编程的东西进行交互会带来更高的满意度。 祝您编码工作顺利!

    翻译自: https://medium.com/the-innovation/why-you-should-make-a-simple-video-game-if-youre-a-self-taught-programmer-f7f10030abb9

    自学成才程序员

    相关资源:四史答题软件安装包exe
    Processed: 0.009, SQL: 8