TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

How to rapidly improve at any programming language (2016)

468 点作者 jcubic超过 3 年前

36 条评论

travisgriggs超过 3 年前
This seems great for language&#x2F;library knowledge. As an experienced polyglot, the languages are not where I&#x27;m hitting the wall these days though. It&#x27;s the tooling. I can learn new language basics faster than I can figure out the ecosystem&#x2F;tooling.<p>For example, my current conundrum is how to deploy an Elixir Phoenix&#x2F;MQTT app. Writing the app was a fun curve to climb. And I could use techniques like described here to learn from others in the actual programming. But how to build an executable I can wrap in a systemd process running on a different machine? Those are actions people do, not expressed so much in code I can look at. The few blogs I can find on the subject are mired in deep CI toolchains.<p>I want the blog that discusses the secret sauce to learn to acquire the knowledge to work the raft of ever evolving tools we have to work with now days. The &quot;materials&quot; (the languages) are the easy part now days. It&#x27;s the massively automated complicated machinery we&#x27;ve built around the language of ideas that are my personal pain point of entry.
评论 #28580101 未加载
评论 #28581540 未加载
评论 #28579053 未加载
评论 #28580332 未加载
评论 #28581414 未加载
评论 #28581262 未加载
评论 #28582020 未加载
评论 #28580080 未加载
评论 #28579194 未加载
评论 #28590564 未加载
147超过 3 年前
Hey, author here. Surprised to see this on the front page of HN since I wrote it 5 years ago.<p>I&#x27;ve always been fascinated with talent acquisition and skill development and would probably different recommendations today after having more experience and reading Ultralearning by Scott Young.
评论 #28578641 未加载
评论 #28578476 未加载
评论 #28579229 未加载
评论 #28578661 未加载
评论 #28578459 未加载
rafaelvasco超过 3 年前
Two things I did and always do: Code things that solve real problems you want to solve. The harder the problem, the better you&#x27;ll get in the language and as a programmer in general.<p>Second, look at existing open source, well written code that, again, solves a problem you&#x27;re interested in. I always emphasize this: Things you&#x27;re passionate about. That way you can master any language&#x2F;framework. By master here, I mean you can code anything you want in the technology efficiently. Your final app will be: Easy to modify&#x2F;enhance, easy to understand in terms of code. Memory and CPU efficient in terms of runtime.
评论 #28586059 未加载
_skhan_超过 3 年前
I feel like the approach the author laid out near the end is passive and would lead to one assuming they have retained some knowledge. At the most, it would help someone avoid a similar bug&#x2F;mistake.<p>A better approach would be to checkout the repo at a commit before the fix and try to replicate the solution in a short amount of time. You would then build context around what the contributor had to figure out and in the worst case you&#x27;ll have a &quot;gold standard&quot; solution to fallback on (assuming the PR was successful).
评论 #28579441 未加载
评论 #28578684 未加载
raman162超过 3 年前
I never thought about reviewing existing open source project PRs to get better at a language. It seems so obvious considering it&#x27;s similar to how I get ramped up with new projects.<p>&gt; 2. When you want to level up, start reading the diff, and review the code and changes yourself before reading the comments.<p>&gt; 3. Finally, when you start feeling more confident, start leaving those comments on new PRs so that the maintainer doesn’t have to. You’re starting to contribute to open source!<p>The steps from two to three are pretty dramatic, I personally would replace step 3 with tackling an open issue related to code you reviewed before. I feel like to give feedback on a PR you need to be intimately familiar with the code, something you get from writing and&#x2F;or making changes to it.
评论 #28588844 未加载
zarzavat超过 3 年前
My hack to improve at a new programming language is to read its grammar. We instinctively try to learn programming languages the same way as we would a natural language, bottom up. But unlike natural languages, programming languages have complete grammars that can be read in a session. This will prime you with the right questions to ask (&quot;WTF is an XYZ?&quot;).<p>Doesn&#x27;t work for Clojure though :)
评论 #28578934 未加载
评论 #28580693 未加载
评论 #28577986 未加载
darkbatman超过 3 年前
If someone need my suggestion, here is what you do - try doing different sort of questions (multiple topics too) on leetcode from different topics may be just 20-30 in language you want to learn.<p>Its different way but you will learn a lot of new libraries, ways to mutate objects, lists, all sort of data structures and new things really really fast.
评论 #28577885 未加载
评论 #28577758 未加载
评论 #28577593 未加载
ineedasername超过 3 年前
<i>I learned that using the collection functions on strings in Clojure is much less performant... But it doesn’t have to be my PR. It can be anybody’s.&quot;</i><p>This reveals a fundamental problem in coding. Best practices for performant code shouldn&#x27;t require ad hoc digging into PR&#x27;s, and as long as it does then we&#x27;ll have code that is buggy &amp; slow(er than necessary).<p>Learning from others, in any field, will always be a valuable source of improvement, but it just doesn&#x27;t seem that, in software dev, it results in laying down solid incremental increases in general knowledge that makes its way back into the education of future devs or current devs in a language new to them:<p>If this was structural engineering, you&#x27;d have to have taken a &quot;materials&quot; course and learn all about different types of materials, their properties, load capacities, degradation profiles and how to evaluate new ones that come your way under the same criteria.<p>Maybe that&#x27;s what we need for software development. A structural engineer wouldn&#x27;t use a composite material without knowing its performance characteristics. Why should a programmer use something like string collection from a language without knowing its performance characteristics?<p>This is on <i>us</i> to demand this, to standardize-- not languages themselves-- but the performance profiles &amp; characteristics that we must know about in order to make a choice on which tool to use. And it shouldn&#x27;t be that each user has to figure it out on their own, dig into PR&#x27;s or whatever. Again, there will always be experiential learning. But <i>too much</i> is experiential right now.
评论 #28579217 未加载
评论 #28579394 未加载
评论 #28580582 未加载
rob74超过 3 年前
In the spirit of this, the Go project has a &quot;common code review comments&quot; document (<a href="https:&#x2F;&#x2F;github.com&#x2F;golang&#x2F;go&#x2F;wiki&#x2F;CodeReviewComments" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;golang&#x2F;go&#x2F;wiki&#x2F;CodeReviewComments</a>) - topics that come up frequently when reviewing pull requests. Reading these can certainly help you get better at writing (idiomatic) Go...
aloisdg超过 3 年前
My own take, to improve at any programming language, use them to build actual small project. The smaller the better. Something familiar. Something easy. A library to convert celsius to fahrenheit. A webapp to count the day until Halloween. This kind of useless-ish stuff.<p>My last example is to add a state machine with xstate to a project fetching some data and formatting a nice output. Do I need a state machine? Not really, but it is a good way to learn it. btw, the goal of the project is to smooth attribution to stack overflow&#x27;s answer. I just started it, sorry for any bug.<p>the app: <a href="https:&#x2F;&#x2F;stacktribution.vercel.app&#x2F;" rel="nofollow">https:&#x2F;&#x2F;stacktribution.vercel.app&#x2F;</a><p>the code: <a href="https:&#x2F;&#x2F;github.com&#x2F;aloisdg&#x2F;Stacktribution" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;aloisdg&#x2F;Stacktribution</a>
评论 #28577818 未加载
评论 #28577785 未加载
评论 #28578545 未加载
评论 #28577987 未加载
greggman3超过 3 年前
A lot of people seem to be saying &quot;build a small project&quot; and I&#x27;m not saying that doesn&#x27;t work but...., but, something I&#x27;ve experienced a lot is that people stick to their old ways, myself included.<p>As a C&#x2F;C++ programmer I used to hate JavaScript (pre ES5). I didn&#x27;t like it&#x27;s function based scoping system. I didn&#x27;t like it&#x27;s prototype based class system. I loathed using it and wrote as little as possible, only enough to make a small WebGL demo or add a tiny feature to my blog. I was basically trying to use JavaScript as C&#x2F;C++ and hating it.<p>At some point though I flipped. I actually started using JavaScript and playing to its features. I embraced prototypical inheritance and all the ways it&#x27;s more flexible than class based. I embraced JavaScript&#x27;s dynamic typing using, where appropriate, the ability to easy wrap APIs, to write more generic and flexible code. I also really loved closures and building functions that closed over data, something that, at the time, C&#x2F;C++ didn&#x27;t have.<p>I also really enjoyed that, at least in the browser, JavaScript is bundled with a lot of CROSS PLATFORM functionality (graphics, GPU access, audio, video, networking, UI) that pretty much no other language has and of course that I could share anything I made with just a link.<p>Then ES5 to current shipped with better scoping, import, map&#x2F;reduce, promises, async&#x2F;await<p>But, I bring this up because I still work with 30-40 people that, even in 2021, they work on the browser teams (Chromium, WebKit, Firefox) and yet none of them really know JavaScript. They all still have the same attitude that I had 15yrs ago. They avoid it as much as possible and they treat it like C&#x2F;C++. Some of them have been doing this for 15+ years. They&#x27;ve written 1000s of even 10s of 1000s of lines of JavaScript to create tests for the features they&#x27;re implementing but they still having really &quot;learned the language&quot;.
评论 #28578242 未加载
评论 #28578078 未加载
评论 #28578564 未加载
评论 #28578140 未加载
评论 #28580746 未加载
评论 #28578080 未加载
评论 #28578065 未加载
评论 #28578372 未加载
enduku超过 3 年前
In addition to wonderful responses already posted, I&#x27;d like to add one more: Learn Forth. Learn Lisp. Learn APL. No need to be good at these; just enough to learn their programming models. Imperative, functional, OOP, or any other, it doesn&#x27;t matter. Learning the programming model in such languages changes the way you think. Then start with a language you wish to master. Start with a problem in mind. Always have a problem in mind. Try coding the thought on paper. Do the same with the target programming language. Though it appears as an idealistic procedure, it does serve its purpose and instills confidence in the learner like no other approach out there.
bradneuberg超过 3 年前
Does anyone know good open source projects that are using modern c++ (c++ 11 to 17 techniques) that I can study and possibly contribute to to get better at c++?
评论 #28579293 未加载
jamisteven超过 3 年前
This is precisely why I hate coding, even the articles about coding dont make sense to me.
评论 #28578280 未加载
评论 #28578237 未加载
eyelidlessness超过 3 年前
The is a great suggestion. I’ve also learned a lot just from reading the already-merged code of projects I’m interested in, and stepping through git history to see how it evolved. I even frequently do this on my phone when I want time away from the desk.<p>For instance I’ve been super interested in SolidJS[1] for months. I learned from reading the source that a lot of the work is done by its underlying dom-expressions[2] compiler. And in reading <i>its</i> source, I learned enough about JS AST transformation that, when I had a need to do some AST transforms of my own for work, I knew enough to confidently timebox a proof of concept to two hours (and actually finished the work in that time!). All from reading code casually on my phone.<p>Sure, I front-loaded a lot of that work in my free time. But I did it because I was genuinely interested in the project I was learning from.<p>1: <a href="https:&#x2F;&#x2F;www.solidjs.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.solidjs.com&#x2F;</a> 2: <a href="https:&#x2F;&#x2F;github.com&#x2F;ryansolid&#x2F;dom-expressions" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;ryansolid&#x2F;dom-expressions</a>
lordnacho超过 3 年前
Here&#x27;s what I do when learning a new language. I&#x27;ve written projects in C#, VB6, C++, Python, Rust, Kotlin, Java, Swift, Objective-C and a tiny bit of typescript.<p>- First of all, find out what the typical toolchain is. What IDE do people tend to use? What compiler? How is package management done? These can be really complicated or super simple to answer.<p>- Compile a Hello World and see that it runs. If it&#x27;s reasonably specific and supported by a bigcorp, there&#x27;s often extensive downloadable examples. Android and iOS for instance will tell you a lot in their tutorials. If there&#x27;s a book, get the book and see how the author presents it, just skim it for key concepts, don&#x27;t get bogged down in the cpp templates SFINAE explanation, it will only make sense once you have done some coding.<p>- Find out how modules work in your language. Every language has this, and you need to know it before you can get anywhere, both reading and writing.<p>- Note down keywords from the tutorial code. Recurring things you see, look them up. If you&#x27;re doing Rust maybe you see `match, await, clone, some, and unwrap` quite often. If it&#x27;s iOS maybe `controller`, or if it&#x27;s Android maybe `fragment`. Google all these things.<p>- Look for the libs that you need. If you need a websocket, look for that. Major frameworks will tend to have good examples in idiomatic style. You can&#x27;t know all the libs you&#x27;ll need, so just get the ones that are obvious. This will give you a better histogram of keywords and soon key concepts.<p>- Start to code your actual thing you want to make. As you run into issues the errors will give you keywords. This will improve your knowledge as you google those as well. After a short time you will run into larger issues than syntax, and those issues will turn out to have been mentioned in the appropriate books.
adamnemecek超过 3 年前
Also reading the source code for the standard library can be illuminating.<p>Note that some languages have pretty subpar standard libraries. This might have changed but ~10 years ago the Ruby standard library really left some things to be desired. I don&#x27;t recall the details but I wasn&#x27;t a fan of parts of it.<p>On the other hand, the Rust standard library is top notch.
评论 #28578812 未加载
journey_16162超过 3 年前
For me working with different languages and seeing different codebases helped a lot.<p>I have always been a solo dev, I have some 6 years of experience, including 3 years getting paid for it. However, up until 1 year ago, I knew only PHP and JavaScript - and I did not know about many good practices in either language - i.e. I did not even use a linting plugin, I was sloppy with git commits.<p>Then one year ago I picked TypeScript for a long-term personal project. TypeScript is now my main language.<p>- I was still working in PHP ocassionally (to get paid) - after using TypeScript and Eslint, I decided I at least need to use some linter in PHP. The linter had a very useful rule I did not not have in Eslint, rule that said: &quot;This looks like commented out code&quot;. Thanks to this, my new TypeScript project is now not polluted with commented out comments all over the place. I&#x27;m not sure if I would have picked it up if not for this small detour.<p>- I was used to describing what every function does, even if it was obvious just from the name of it. This is because it&#x27;s a very common practice in some PHP projects - I presume this is probably because of lack of the type system, you have to use PHP doc to comment function parameters, and if you comment function parameters, you may want to add the description of the function anyway. Thankfully I took some detour, I wanted to learn a bit of C++. I looked at some codebases, particularly Chromium - and I was surprised to see how little comments it had, compared to say, WordPress (PHP). I immediately knew this is the right approach for me. I started dropping any obvious comments and not repeating myself and instead name variables &#x2F; functions to be more descriptive.<p>- I also looked a bit into Rust and saw how the language is using return results rather than exceptions. I compared both approaches and decided that it would be better if I used return results rather than exception, as Typescript has no way to annotate that a function throws and what it throws.
tienthanh8490超过 3 年前
Nice advice. I always hear people suggest building some projects to learn the language, but I doubt if it&#x27;s realistic given other constraints in life (I also tried it but the initial excitement wears off pretty quickly). In the end, knowledge can come from anywhere, we just have to find the right source.
stardenburden超过 3 年前
I can tell an anecdote from my own life to confirm this theory.<p>My first PR at nixpkgs, I had to close because I didn&#x27;t understand what the maintainers were complaining talking about, it was like they were speaking a different language. It was only one month later, after reading other PR reviews, talking on IRC and thinking about all of it, could I make sense of what they wanted from me. Since then I&#x27;ve started doing exactly what the author described: comment on other PRs with things that I was confronted with, and&#x2F;or saw others be. By now I&#x27;ve gained enough knowledge to come up with own criticisms - indicating that I&#x27;ve learnt quite a lot.
wefarrell超过 3 年前
As a first step I like solving basic problems on Exercism (but any other leetcode platform will probably work) and then working my way up to the more advanced ones. Then I like to read a thick, in-depth guide to the features of that language while continuing to work on increasingly harder problems. When I start actually using the language for work or other real-world problems I’ll read through the code of the libraries I’m using.<p>I’ve used this approach to come in as a lead developer to unfamiliar languages and give meaningful feedback to developers who have worked in that language for 10+ years.
einpoklum超过 3 年前
But don&#x27;t only a few languages&#x2F;frameworks&#x2F;library collections have such a repository of &quot;PR&quot;s, with diffs and review comments and everything?
评论 #28580653 未加载
ipiz0618超过 3 年前
Contributing to open source is, to me, very similar to learning a language at work. The difference is that you seldom have the chance to learn a new language at work because you generally have to first be experienced with it.<p>To me, I always learn the best when there&#x27;s a necessity to ship my code. Side projects won&#x27;t do, and I always revert to using my skills developed at work. Therefore, this sounds like a very good piece of advice to start with.
habibur超过 3 年前
First try it yourself. Then read how others did it.<p>You will improve rapidly.
DoreenMichele超过 3 年前
This is potentially approachable advice for a total noob who can&#x27;t really code: Just read the pull requests and comments in open source if you want to start learning.<p>It&#x27;s thought provoking and not what I expected. I&#x27;m used to hearing &quot;If you want to learn, build something.&quot; That assumes some basic knowledge I simply don&#x27;t have, so I haven&#x27;t yet managed to pull it off.
ChrisMarshallNY超过 3 年前
I just feel that taking on projects I can&#x27;t [yet] do, is the best way for me to improve.<p>It bucks up my language skills, design skills, debugging skills, research skills, framework skills, etc.<p><a href="https:&#x2F;&#x2F;littlegreenviper.com&#x2F;miscellany&#x2F;thats-not-what-ships-are-built-for&#x2F;" rel="nofollow">https:&#x2F;&#x2F;littlegreenviper.com&#x2F;miscellany&#x2F;thats-not-what-ships...</a>
voidnullnil超过 3 年前
This only works for so long until the devs get tired of spoonfeeding. More importantly: There shouldn&#x27;t be subtle nuances in something like a web routing library which is _supposed_ to be trivial. Just the other day I had the experience of watching a grown man give a presentation on his beloved HTTP library, explaining fundamentals of asynchronous (TM) programming and syntax as if the audience does not understand their own programming language in 2021, after seeing the previous 500 LangX.FrameworkY.HTTPlibs. This shouldn&#x27;t be a thing. We shouldn&#x27;t be relearning basic shit every day. The problem aside from UNIX being a giant pile of garbage, and HTTP being utterly pointless (can you even name what problem is being solved when you create a new p2p application and make them talk HTTP to each other?), is that everyone keeps making their new languages and libs to &quot;fix&quot; one tiny issue, and they _always_ lack basic knowledge of the past 50 years of PL history, such as Standard ML which is better than whatever they just came up with.
bbertelsen超过 3 年前
I love this approach. I think looking at the FAQ for a programming language&#x27;s tag is also an amazing way to dive into a programming language. Lots of detail, different approaches and people discussing best practices on even the simplest of programming tasks.
dudul超过 3 年前
&quot;start reading them from the beginning. Just a few a morning for warmup while you drink your morning coffee and catch up on email.&quot;<p>How do you read PRs while you catch up on emails?<p>Not to discount the overall advice, but this statement is kind of weird.
schwurb超过 3 年前
I came up with this trick (reviewing other PRs, after thinking how I would to it) to speed up learning technology at my working place where we don&#x27;t have enough man power to do mentoring.
betwixthewires超过 3 年前
This is actually a great idea that I hadn&#x27;t thought of. I&#x27;ve been trying to learn a new language for something important and it&#x27;s been a bit much. I&#x27;m going to try this.
e9超过 3 年前
When I need to learn new language I try to solve basic coding questions with minimum number of characters. You learn a ton about language this way pretty quickly.
1vuio0pswjnm7超过 3 年前
&quot;1. Every morning, take your favorite open source library or one from a language you&#x27;re learning, go to the closed PRs on Github and start reading them from the beginning.&quot;<p><pre><code> s&#x2F;library.*learning&#x2F;operating system&#x2F; s&#x2F;on Github&#x2F;&#x2F;</code></pre>
zeroxfe超过 3 年前
I&#x27;ve always found that writing lots of code and reading a variety of real world code are the most effective ways to learn new languages.<p>But I recently discovered coding livestreams, and the good ones are really amazing! It&#x27;s really eye-opening (and sometimes fun) to watch experts talk through their thinking process, while deciding between language features or primitives, or while picking dependency libraries, observing their tooling and stacks, and watching them test and debug things.<p>I&#x27;m learning Rust right now, which I think is a deep and complex language, and watching these streams have been incredibly useful.
评论 #28578931 未加载
rStar超过 3 年前
i play guitar every morning in my free time. work is for work. you’re a good enough programmer already. enjoy yourself.
评论 #28577630 未加载
评论 #28577746 未加载
评论 #28578023 未加载
评论 #28577757 未加载
评论 #28578505 未加载
black_13超过 3 年前
Being good at anything or anything in demand doesn’t translate into an income.