Live data from Hacker News

Teach Yourself Programming in Ten Years (1998)

norvig.com

91–100 of 117 posts

Re: Teach Yourself Programming in Ten Years (1998)

#91

>> Learn at least a half dozen programming languages I'm always surprised by how many people disagree with this; they're on the search for that one language they can use for every task. Or even worse, they think they've found it and their search is over, that's a tragic situation given how spoiled we are for great languages today. Clojure (STM / refs, vars, atoms & agents), kdb/q (non-loopy array code), Rust (ownersh…

I think it's fine to "learn" lots of languages, but you're going to be pretty bad at most of them. And I personally wouldn't be comfortable with building a system that will reach hundreds of thousands of LOC in the majority of the dozen or so languages I've "learned" over the years. If you're really going to learn a language - as in, build idiomatic programs - its a constantly moving target and requires a lot of effo…

I think it depends on the language and background. Learning Go is maybe a 20 hour enterprise. Learning C++ if you're coming from Rust? Maybe 20-40 hours, not sure. Learning C++ coming from Python? Well....buckle up.

Same in reverse btw. Going from C++ to Python is probably easier than Python to C++, but it's still not going to be as easy as, let's say, java -> C# imo.

Re: Teach Yourself Programming in Ten Years (1998)

#92

>> Learn at least a half dozen programming languages I'm always surprised by how many people disagree with this; they're on the search for that one language they can use for every task. Or even worse, they think they've found it and their search is over, that's a tragic situation given how spoiled we are for great languages today. Clojure (STM / refs, vars, atoms & agents), kdb/q (non-loopy array code), Rust (ownersh…

I think it's fine to "learn" lots of languages, but you're going to be pretty bad at most of them. And I personally wouldn't be comfortable with building a system that will reach hundreds of thousands of LOC in the majority of the dozen or so languages I've "learned" over the years. If you're really going to learn a language - as in, build idiomatic programs - its a constantly moving target and requires a lot of effo…

I mostly agree, but I think 2–3 is too few. I think I'm pretty good at C, bash, Python, make, and JS, and also (if we're counting languages that aren't programming languages) SQL and HTML. I used to be pretty good at Perl, but the language has moved on since then. I think I have more than "passing familiarity" with i386 assembly, PostScript, OCaml, Java, C++, BASIC, Bicicleta, Scheme, Lua, and Brainfuck; that is, I can figure out how to write things in them without constantly looking stuff up, and I'd be comfortable writing hundreds of KLOC in them, but what I write is surely not fully idiomatic. And there are another 32-64 languages I have passing familarity with, meaning that I've written useful complete programs in them, including Golang, Rust, Excel, Smalltalk, PV-WAVE IDL, Prolog, Common Lisp, Scala, Octave, Elisp, Ruby, Pascal, Clojure, Forth, R, and Tcl, but I can't think of most of them right now.

I guess in the context of your comment this sounds like bragging, but that's not my intent; I'm trying to rebut your comment, using myself as an example, because I think this level of polyglot programming is pretty close to normal, at least after you've been at this stuff for a few decades. Maybe if you're getting into a rut of only knowing 2–3 languages well, you'd benefit from putting more effort into exploration. Unless you're about to stop programming, in which case you won't have time to take advantage of your newfound powers.

I don't think percentages are a good way to think about language fit. I think it's more like an effort multiplier. In theory I can solve any programming problem in C, but when the problem isn't huge and performance isn't much of a challenge, I can usually solve it about with about a tenth of the effort in Python. There are problems where solving them in SQL is about three times easier than in Python, and problems which can barely be solved in SQL, so solving them in Python is about a hundred times easier.

As an example, in my experience it's pretty common for Python to be about half as much effort as Scheme, but there are much better Scheme implementations out there, so when performance is a challenge, solving them in Scheme can be a hundred times easier than solving them in Python. But if you know Scheme and not Python, you can often get twice as much done by learning Python, even for problems where you might say Scheme is a pretty good fit. But it's true that at the beginning, when you have barely any experience in Python, you won't be faster; you'll be slower. And you won't know if that will ever change.

Most commonly, though, people use the language that is best integrated with their chosen platform, because that saves them the effort of writing a bunch of integration code in addition to the actual application code. If you're writing DHTML, for example, use JS, not C. If you need to invoke JVM libraries, reasonable options include Python, JS, Kotlin, Clojure, and Java, but not Perl, C, or C#. If you're writing a Minetest mod, do it in Lua.

So, if you only have more than passing familiarity with 2–3 languages, I think you're going to frequently run into cases where that ignorance costs you a factor of 2 or 3 in effort.

I certainly agree, though, that choosing the right language won't solve all your problems, and it's easy to have exaggerated hopes for it.

Re: Teach Yourself Programming in Ten Years (1998)

#93

Earlier quoted context omitted.

> And, I would say that the number of jobs that require the mastery of the craft is not large. This mindset is how we end up with layers upon layers of badly designed and buggy software that underpins almost every aspect of modern life. Just apply the same reasoning to other areas: Would you want to drive in a bus with a bus driver who just barely got his driver's license? Would you want to use a bridge designed by a…

How often do you check your surgeon's grades? Or any of those things you mention? I normally just trust that the bus company has hired a guy with a license.

When people say driver license, they mean the one kids can get at age 16. Driving a bus requires a commercial driver license, which is referred to as a CDL - it's a much more rigorous test.

How often are you driven around by bus drivers who just finished their learner's permit?

Re: Teach Yourself Programming in Ten Years (1998)

#94

>> Learn at least a half dozen programming languages I'm always surprised by how many people disagree with this; they're on the search for that one language they can use for every task. Or even worse, they think they've found it and their search is over, that's a tragic situation given how spoiled we are for great languages today. Clojure (STM / refs, vars, atoms & agents), kdb/q (non-loopy array code), Rust (ownersh…

The thing, in my opinion, is to avoid spreading yourself too thin.

I started using C/C++ more than 20 years ago and even if I feel really comfortable with the language (except the latest revisions) I am still learning and improving.

I don't think I could achieve the same level of mastery on half a dozen languages.

Re: Teach Yourself Programming in Ten Years (1998)

#95
It does not take ten years to learn things. It might take 10 years to be good at something. I recently took up lawn bowls. I learned it in about 30 mins. It's quite simple. I'm not any good at it.

I used the Learn C++ in 24 Hours book as an undergraduate. It was excellent. It was the book the university recommended, and it was probably the only book I bought as an undergraduate engineer that was actually indispensable. I actually used it, page by page, and during that course I produced a really cool 'moon lander' game in 3D. Was I an accomplished programmer? Absolutely not. Had I learned the basics? Yeh. Good enough for an undergrad electrical engineer.

It feels like you are railing against one premise (a programming language can be learned in 24 Hours) only to propose another similarly bonkers premise (a programming language can't be learned in less than 10 years). What's the point?

Re: Teach Yourself Programming in Ten Years (1998)

#96
post #39

Earlier quoted context omitted.

> And, I would say that the number of jobs that require the mastery of the craft is not large. This mindset is how we end up with layers upon layers of badly designed and buggy software that underpins almost every aspect of modern life. Just apply the same reasoning to other areas: Would you want to drive in a bus with a bus driver who just barely got his driver's license? Would you want to use a bridge designed by a…

not all code is life threatening in worst case scenario. Better comparison would be "would you like to be served by first time waiter or rather expert one?". In most cases it doesn't matter, and when it does, the price point of the service is significantly higher.

I hate to do this, but:

Stop equating programming and bus drivers or waiters. They aren't equal. Programming is difficult in its depth and breadth in a way that waiting tables is not.

Stop treating all programming tasks as equal. They are not. Most of the easy ones are only easy because they run on top of all the difficult programs. That is the goal of the difficult programs, to make it possible for laymen to do work that would require an expert for certain repetitive tasks if the underlying program did not exist.

Most people would not be capable of getting Hello World to run without the OS and high-level abstractions that take expertise to develop. And making that possible requires many many experts in many different kinds of programming.

Stepping off of the single thread and single machine model into concurrent and distributed computing to enable even more laymen to make stuff takes even more experts.

There is a meme in the industry that people shouldn't strive for expertise. We still need more experts, and you become an expert through practice while still a layman. Nothing would be worse off if we had more experts capable of deciding when to use something extensible off of the shelf to enable laymen to do simple tasks, and when to build a platform to eventually enable that task to be done by a layman.

A lot of things would be worse off if we encouraged all people to stop at the layman level. We should encourage everyone to at least become a layman for their own enrichment. But we should also encourage laymen to strive for expertise to lower the barriers to entry to produce more laymen capable of doing simple tasks.

Re: Teach Yourself Programming in Ten Years (1998)

#97
post #49
post #48

Earlier quoted context omitted.

I was one of those who disagreed with that, but then I was forced to learn several new languages for work. Now I agree with it wholeheartedly. my favs: -clojure for processing deeply nested data -rust for general stuff -java for concurrency support and general stuff -c for easy pointer manipulation and "tricks" -sql -bash for scripting (I'm that weirdo who would rather make a huge shell script rather than using pytho…

Careful with Bash... https://mywiki.wooledge.org/BashPitfalls

I write huge scripts with bash. I know many of the pitfalls referenced on that list (and more), but this a great resource for teaching others. Thanks for sharing it!

Re: Teach Yourself Programming in Ten Years (1998)

#98

Earlier quoted context omitted.

JS isn‘t a general purpose language, even though is has been shoehorned to be one.

I'd be curious to hear some examples where JS doesn't fit as a general purpose language. In my arrogance I suspect it would be hard to give examples that don't also disqualify other scripting langs like python and ruby. Perhaps you don't consider those to be general purpose either?

For example, without something like Node, you cannot even open a file. I consider this a very basic requirement for being "general purpose".

Re: Teach Yourself Programming in Ten Years (1998)

#99

The title is a bit misleading to me. 10 years is not to "teach yourself programming," it's to "become an expert in programming." Most people do not want to learn programming to become experts, most people want to learn programming to get a job. After getting a job, some will plateau right away, others will plateau after some time, and others still will keep learning even after years and years. The problem is "how lon…

> And, I would say that the number of jobs that require the mastery of the craft is not large. This mindset is how we end up with layers upon layers of badly designed and buggy software that underpins almost every aspect of modern life. Just apply the same reasoning to other areas: Would you want to drive in a bus with a bus driver who just barely got his driver's license? Would you want to use a bridge designed by a…

> This mindset is how we end up with layers upon layers of badly designed and buggy software that underpins almost every aspect of modern life.

No, it’s not. Changing requirements by adding features is by far the biggest cause of badly designed and buggy software. I’ve worked on multiple teams where everyone was fully committed and highly skilled, and it didn’t magically fix the problems of software. It wasn’t any better than working on teams of people who were less interested. Our inability to stop adding features is what kills us, and this inability is actually stronger with people who think they’ve ‘mastered’ the art of programming than with people who can finish a one-off task.

> they will probably not be a general purpose solution of the problem at hand

Ironically, perhaps, in my decades of professional programming, the number one biggest waste of money I’ve seen is people over-engineering something under the banner of making something “general purpose” that didn’t need to be. I’ve watched a couple of different teams of very smart people waste literally tens of millions of dollars by deciding to rewrite something that didn’t need rewriting, and dramatically overestimate their ability to finish it in a reasonable amount of time and avoid the same mistakes they made the first time.

> If you want to write dependable, high-quality, maintainable, reusable software you better know more than the bare minimum.

This sounds good in theory, but is specious. The real way to get high quality software is to define what that means and stick to it ruthlessly. You don’t need to know a lot about programming. You need a management that is okay lengthening schedules to make room for testing. You need a CEO who is okay with saying no to customer demands for features that the competition has. You need programmers who know when to stop programming and when to avoid rationalizing their ‘general purpose’ solution that solves problems that don’t actually exist.

Good luck in your search for high quality software, it’s very very difficult to find a team who can commit to it, and there are good reasons why: it’s extremely expensive.

Post reply on HN