我与某人因是否应该记住代码而发生挣执[The conflict between me and somebody over whether to remember codes]

2022-10-31 10:12:19 +08:00
 mascteen

Table of Contents

  1. 事情是这样的:
  2. English Version

事情是这样的:

许久之前,我更新了一条状态,建议刚入行的新人如何快速上手代码,其中有一条这样写到“多去看别人写的代码如果有必要可以把一些优秀的代码背下来”,然后冲突就发生了。我认为做为一个新人,如果他人把一个逻辑用一段非常优秀的代码实现了,那记住这段代码是一个正确的学习方法,就如同我们也会经常背诵优美的句子。而某人认为这是无稽之谈误人子弟,写代码主要是靠不断的练习和实践,哪有去背诵代码的。大家是怎么认为的呢?

English Version

There's the thing:

Some days ago, I push a tweet, suggesting how newbie coder get quickly start handy coding. One of mine advises was said, "Learn code from career programmer and memorize some excellent code if necessary", then somebody not agree with that. I think if someone implements a logic with a good design pattern, then remember this code is a good way to learning, just like we appreciate beautiful sentences. But somebody just think this is redicules and misleading the newbie. Mastering code is mainly continuous practice and experience, and remember code always not a good way to learn. What do you think?

2142 次点击
所在节点    程序员
23 条回复
iLoveSS
2022-10-31 10:26:36 +08:00
open stackoverflow, then ctrl+c, ctrl+v.
AS4694lAS4808
2022-10-31 10:32:58 +08:00
背完过了三天,框架更新函数 deprecated 怎么办?
xinshoushanglu
2022-10-31 10:44:32 +08:00
写代码记了没用,只有真正的理解流程 然后反复实操,这个东西只要当时弄明白了,即使背不出来你依然记得。
相反如果靠背下来的,那很可能是机械的记忆,稍微变换个形式就懵逼了,这是完全错误的方式
yaphets666
2022-10-31 11:05:53 +08:00
背是没有问题的。
刷算法题不也是背的过程吗?
只不过很多人不愿意承认罢了
misaka
2022-10-31 11:06:26 +08:00
在英文社区就写英文,在中文社区就写中文,看到第二个逗号过去式都不会用,都不知道弄个 English Version 是要干嘛
misaka
2022-10-31 11:06:55 +08:00
而且 push a tweet 是什么鬼
RainCats
2022-10-31 11:07:55 +08:00
背代码是事半功倍,我见过真的有人去背代码,甚至能在纸上默写出来,但是稍微换个形式的需求他就完全没法写,因为他真的是背的,不理解为什么这样写。
interim
2022-10-31 11:32:44 +08:00
中文社区你整个 english version? 黑人问号?
另外是 post a tweet 而不是 push a tweet
StevenRCE0
2022-10-31 11:40:01 +08:00
看疗效呗,默写代码也比写不出来好👌
learningman
2022-10-31 12:28:38 +08:00
算法竞赛要背板子,CRUD 你背啥,随时都可能变的东西
LnTrx
2022-10-31 14:20:00 +08:00
机械背诵是方法而不是目的。而且只是方法之一,是可选项,不是必选项。
seekmyduck
2022-10-31 15:40:32 +08:00
我觉得吧,理解加记忆是最好的方案,这也是上学时候老师强调的最多的。
要是理解不了,那就强行背,不至于一点进展都没有。
mascteen
2022-10-31 15:59:18 +08:00
@misaka 学习英文,可能有外国友人
@interim
weivi
2022-10-31 16:16:58 +08:00
不用非得背的话,可以写在笔记里,需要参考的时候打开笔记看一眼,减少大脑的负担。
mijazz
2022-10-31 16:57:26 +08:00
Remembering **the code** is not just remembering the code/text itself.

Remembering **the code** (which implements a logic with an elegant design pattern, according to your description) is always about remembering the elegant design pattern behind it.

After that, implement that exact logic, with the elegant design pattern in your head, but in your way, and in your code. That’s "remembering the code".
FrankHB
2022-10-31 21:18:08 +08:00
@yaphets666 比起 OP 的背景问题,你拿刷算法给“背是没有问题的”背书倒是更加让人细思极恐。

共通的问题是:
有想过谁是下达“背”的指令的甲方爸爸吗?
在自己都不清楚收益的情况下,这样的甲方会给你的“背”多少回报?
这样的甲方爸爸值得舔吗?
FrankHB
2022-10-31 21:20:56 +08:00
@misaka @interim 语感正常的话应该 tweet 直接做动词吧。
mascteen
2022-10-31 21:58:32 +08:00
@FrankHB 小弟不材见笑了
junwind
2022-11-01 09:18:10 +08:00
赞同 “理解+记忆”
yaphets666
2022-11-01 09:58:23 +08:00
@FrankHB 你搞不搞得清收益,进大厂还能不刷算法题?算法题是世界码农通行实力评价体系。

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/891338

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX