程序员学习新语言的最佳方法是什么?

发布于 2024-09-13 00:49:37 字数 369 浏览 3 评论 0原文

我知道这是相当主观的,但这是我一直在努力解决的问题。由于我将在下面概述的原因,我什至一直犹豫是否尝试学习一门新语言。如果这个问题被关闭,我想我只会笑着忍受,但这是我想解决的问题。

当我去学习一门新语言时,似乎大多数学习资源都是针对新程序员的。然后我最终阅读了“详细”教程或其他内容并感到无聊。我倾向于觉得我在变量如何工作、数据类型如何工作以及其他基本问题上浪费了很多时间。这些都是重要的事情,但我可以处理技术术语,不需要像初学者那样为我分解事情。

我还觉得,如果我只是投入一个项目,我会养成坏习惯,而无法从学习一门新语言中获得所有好处。我仍然会使用我已经知道的范式来做事,并将它们融入到新语言中。

所以,我的问题是:您发现最有助于充分利用新语言的策略是什么?您学到了哪些技巧?

I know that this is quite subjective, but is it something that I have struggled with quite a bit. I have even been hesitant to try to learn a new language because of the reason I will outline below. If this gets closed I guess I will just grin and bear it but this is something I would like to have addressed.

When I go to learn a new language it seems that most learning resources are directed at the new programmer. I then end up reading the "verbose" tutorial or something and getting bored. I tend to feel like I am wasting a lot of time with how a variable works, how data types work and other basic things. These are all important things but I can handle technical terminology and don't need things broken down for me like a beginner would.

I also feel like if I just dive into a project, I will learn bad habits and not get all of the benefit out of learning a new language. I will still do thing using the paradigms that I already know and hacking them into working on the new language.

So, my question is: What is the strategy that you have found most helpful to get the most out of a new language? What are some tips that you have learned?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

苦妄 2024-09-20 00:49:37

写代码。如果您有一点点使用该语言的经验,您将从书中获得更多。

您可能首先从另一种语言移植代码,这样您就可以专注于新语言的语法而不是算法。您的第一个端口可能会太直接,但没关系。然后,在您了解有关新语言的更多信息后,返回并再次移植您的代码,这次使用新语言的习惯用法。

Write code. You'll get more out of a book if you have even a tiny bit of experience using the language.

You might start by porting code from another language so you're focused on the syntax of the new language rather than on algorithms. Your first port will probably be too direct, but that's OK. Then after you've learned more about your new language, go back and port your code again, this time using the idioms of the new language.

白馒头 2024-09-20 00:49:37

有一个名为 Dive into Python 的 Python 教程,它完全解决了您所描述的问题 - 向您解释 Python 特定语法人们已经了解编程基础知识并直接深入代码而不是进行冗长的介绍。

您应该为您想要学习的语言寻找类似的书。

There is a tutorial for Python called Dive into Python that addresses exactly the issue you describe - explaining Python specific syntax to people that already know the basics of programming and diving straight into the code rather than having long introductions.

You should look for a similar book for the language you are trying to learn.

送你一个梦 2024-09-20 00:49:37

对于简单的语言,我会阅读一个通用教程,然后开始用它编写一些应用程序。如果我觉得我需要使用特定的库或技术,我会为此编写一个教程,然后进行编码。我通过实际解决问题学到更多。我用红宝石做了这个。

对于更难的语言,我可能会买一本书,花 6 个月的时间浏览它,阅读邮件列表等,之后可能会尝试用该语言维护一些开源软件,然后再从头开始开发一个应用程序。这就是我正在用 Haskell 做的事情。

For easy languages I go through one general purpose tutorial, then I start writing some app with it. If I feel I need to use a specific library or technique I do a tutorial for that then code. I learn more by practically solving problems. I did this with ruby.

With a harder language, I might buy a book, and spend 6 months going through that, and reading the mailing list etc, and after that probably try and maintain some open source software in that language before starting an app from scratch. This is what I am doing with Haskell.

独享拥抱 2024-09-20 00:49:37

我阅读了语言规范。有我需要知道的一切,没有多余的。之后,我拿一个示例程序并开始修改和扩展它,直到我开始熟悉新语言。然后我开始用它编写自己的程序。

I read the language spec. There is anything I need to know and nothing superflous. After that I take a example program and begin to modify and extend it until I begin to get familar with the new language. Then I start to write my own programs with it.

琉璃梦幻 2024-09-20 00:49:37

收听此播客:
http://www.se -radio.net/2009/11/episode-148-software-archaeology-with-dave-thomas/

Dave Thomas 谈论代码阅读和考古学。例如,他带领 Ruby 开发人员通过 Ruby 编译器,通过阅读源代码,他们了解了有关该语言的许多重要细节。

这可能不是您的第一步,但它应该成为您整体学习方法的一部分。

Listen to this podcast:
http://www.se-radio.net/2009/11/episode-148-software-archaeology-with-dave-thomas/

Dave Thomas talks about code reading and archaeology. For example, he takes Ruby developers through the Ruby compiler, by reading the source code, they learn a lot of significant details about the language.

This may not be your first step, but it should be apart of your overall approach to learning.

煮茶煮酒煮时光 2024-09-20 00:49:37

实现该语言的标准库。它们几乎总是以被认为是该语言的最佳实践的方式编写的,并且它将帮助您快速了解该语言的优点和高级功能。

Implement the language's standard libraries. They are almost always written in what's considered to be best practice for that language, and it'll rapidly get you up to speed in what's good and that language's advanced features.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文