Can I become a good programmer without math and algorithms knowledge?

本文通过类比,解释了编程基础知识的重要性。从搭建简易玩具房屋类比为使用乐高积木搭建的小型项目,强调了算法和数学背景对于构建更复杂、更安全、更大规模系统的必要性。随着项目的复杂性增加,没有这些基础知识就相当于用乐高搭建一座高楼,可能只是暂时的解决方案。通过学习算法和数学,程序员能够更高效地解决问题,理解代码的行为和性能,并能将这些技能应用到大型项目中,如亚马逊和谷歌。

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

To explain why, I'm gonna assume you have little to no programming background and try to use an analogy. I apologise in advance if this answer becomes  long.


Say you wanted to build a small toy house with a kid. You buy some lego bricks and you two work piling bricks in such a way that the end result looks
 like a house. You are happy and the kid is happy. The toy house stands on
its own for a while, since lego bricks are lightweight and basically indestructible. 


Now say you want a real house. One in which you can live with your family. Would you rely on a house which was build the same way, using no
engineering knowledge whatsoever to guarantee its safety? I'd argue most sane people on earth would not.


Programming without a good background in algorithms and math is akin to building the toy house out of lego. You may get pretty good at it with practice. You may even start noticing patterns with time, such as the fact that some arrangements of lego pieces lead to better results. Still, it will be next to impossible to make statements regarding it such as: "this can handle up to X kg" or "this house is safe to live in" or "we could build one of these out of cement and it would stand on its own". 


Worse, the gap in reliability between the two approaches to house building grows larger the more complex the project. Building a small cabin like kids build toy houses out of lego might work, but its very unlikely that a huge bridge made following that same approach would stand. Similarly, simpler tasks such as writing a small website will be feasible for a team or programmers without a background in math and algorithms, whereas keeping something as big as amazon or google working will be next to impossible.


The idea that math and algorithms are not important is not uncommon among undergrads or even among experienced programmers. I used to think like that years ago myself. Then I got into college and started learning algorithms and mathematics and probability and so on. I even trained for ICPC, which is a competition amongst undegraduate programers that requires quite a bit of knowledge in these fields. 


The end result of that process is that now I can write better code in less time. I am also capable of writing code for tasks I had no clue how a computer could perform years ago. And I know how to analyse code so that I have a good idea on how it will perform when executed.  In summary, I am orders of magnitude better than I used to be in many different ways.


Finally, I'd like to add something regarding the idea that you learn basic algorithms to be able to do pattern matching. By that, I mean being able to recognize when these algorithms are needed and then use them unchanged. That idea is plain wrong. While knowing which algorithm to employ is a valuable skill, the main reason why one should study these things is to learn how to think and solve new problems. 
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值