Don’t Just Learn the Language, Understand Its Culture

本文作者通过自身经历强调了学习不同编程语言的重要性,不仅在于语法层面的理解,更在于深入掌握每种语言背后的文化与思维方式。作者分享了如何通过跨语言学习提升编程技能,包括更好地运用设计模式、理解和使用不同语言特性等。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Don’t Just Learn the Language, Understand Its Culture

Anders Norås

iN HiGH SCHOOL, i HAD TO LEARN A FOREiGN LANGUAGE. At the time, I thought that I’d get by nicely being good at English, so I chose to sleep through three years of French class. A few years later, I went to Tunisia on vacation. Arabic is the official language there and, being a former French colony, French is also commonly used. English is only spoken in the touristy areas. Because of my linguistic ignorance, I found myself confined at the poolside reading Finnegans Wake, James Joyce’s tour de force in form and language. Joyce’s playful blend of more than 40 languages was a surprising, albeit exhausting, experience. Realizing how interwoven foreign words and phrases gave the author new ways of expressing himself is something I’ve kept with me in my programming career.
In their seminal book, The Pragmatic Programmer (Addison-Wesley Profes- sional), Andy Hunt and Dave Thomas encourage us to learn a new program- ming language every year. I’ve tried to live by their advice, and throughout the years, I’ve had the experience of programming in many languages. My most important lesson from my polyglot adventures is that it takes more than just learning the syntax to learn a language: you need to understand its culture.
You can write Fortran in any language, but to truly learn a language you have to embrace it.
Don’t make excuses if your C# code is a long Main method with mostly static helper methods, but learn why classes make sense. Don’t shy away if you have a hard time understanding the lambda expressions used in functional languages— force yourself to use them.
54 97 Things Every Programmer Should Know

Once you’ve learned the ropes of a new language, you’ll be surprised how you’ll start using languages you already know in new ways.
I learned how to use delegates effectively in C# from programming Ruby; releasing the full potential of .NET’s generics gave me ideas on how I could make Java generics more useful; and LINQ made it a breeze to teach myself Scala.
You’ll also get a better understanding of design patterns by moving between different languages. C programmers find that C# and Java have commoditized the iterator pattern. In Ruby and other dynamic languages, you might still use a visitor, but your implementation won’t look like the example from the Gang of Four book.
Some might argue that Finnegans Wake is unreadable, while others applaud it for its stylistic beauty. To make the book a less daunting read, single language translations are available. Ironically, the first of these was in French.
Code is in many ways similar. If you write Wakese code with a little Python, some Java, and a hint of Erlang, your projects will be a mess. If you instead explore new languages to expand your mind and get fresh ideas on how you can solve things in different ways, you will find that the code you write in your trusty old language gets more beautiful for every new language you’ve learned.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值