惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

T
The Blog of Author Tim Ferriss
S
Securelist
D
Docker
The Register - Security
The Register - Security
GbyAI
GbyAI
Recorded Future
Recorded Future
Engineering at Meta
Engineering at Meta
Stack Overflow Blog
Stack Overflow Blog
云风的 BLOG
云风的 BLOG
P
Proofpoint News Feed
罗磊的独立博客
博客园 - 【当耐特】
F
Full Disclosure
WordPress大学
WordPress大学
腾讯CDC
小众软件
小众软件
大猫的无限游戏
大猫的无限游戏
D
DataBreaches.Net
SecWiki News
SecWiki News
L
Lohrmann on Cybersecurity
I
InfoQ
MyScale Blog
MyScale Blog
量子位
Cyberwarzone
Cyberwarzone
博客园 - 三生石上(FineUI控件)
The Hacker News
The Hacker News
F
Fortinet All Blogs
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Jina AI
Jina AI
博客园_首页
H
Help Net Security
K
Kaspersky official blog
酷 壳 – CoolShell
酷 壳 – CoolShell
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
www.infosecurity-magazine.com
www.infosecurity-magazine.com
Webroot Blog
Webroot Blog
Blog — PlanetScale
Blog — PlanetScale
V
Vulnerabilities – Threatpost
Y
Y Combinator Blog
The Cloudflare Blog
P
Proofpoint News Feed
V
Visual Studio Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
T
Tailwind CSS Blog
爱范儿
爱范儿
P
Privacy International News Feed
Security Archives - TechRepublic
Security Archives - TechRepublic
The GitHub Blog
The GitHub Blog
C
Cybersecurity and Infrastructure Security Agency CISA
B
Blog RSS Feed

博客园 - cutepig

換博客了,新地址https://cutepig123.github.io/ 光盘是个好东西 俺买过的电子产品 垂直方向的努力更有意义 python GUI test tool AirtestIDE_2019-04-16_py3_win64 google translate automation using selenium 冯唐论加班 Prometheus 文件系统api为何可以这么简洁以及我們這個抓圖模塊的設計難點 好繫統是一次性設計出來的嗎 jaeger tracing CS lessons c++ 书籍 my codes 我写的代码 写了一个自动用google翻译文档的工具 用几种语言实现socks server 一個不錯的Modern CMake的入門教程 Modern CMake remote ssh for vscode test
抽象的好与坏
cutepig · 2021-02-20 · via 博客园 - cutepig

https://www.v2ex.com/t/754480#reply29
这个讨论来自以上的链接
继续来说,你是说有个人觉得公司的代码都是复制粘贴,然后改两下就直接用
他觉得可以抽象一下,应该可以弄得更好

后面也我倒觉得有个人说的挺有道理的,就是抽象未必是好的
因为从小总会引入一些约束,如果后面有些变化,在你的约束以外,那你就麻烦了
这是系统架构设计难的一方面,因为系统架构这种抽象,你一旦定好了,比较难改变

你给抽象一下, 万一后面改功能, 你这个抽象不支持怎么办? 别总以为代码简洁就是美, 美则美矣, 却丧失了各种可能, 又有什么用?

另一个人是从成本的角度考虑
制粘贴再修改,付出的是人力成本,请几个应届生搞定。
抽象封装搞优化,付出的是脑力成本,找个高手费钱费力

还有从风险的角度考虑
然轮子哥 @GeniusVczh 非常推崇 DRY 原则,但是,在某些人那里,DRY 就是个灾难,因为他没有足够的抽象能力,DRY 出来的东西就是一堆狗屎,然后每次要加新功能,就彻底重写一次;或者是每次加新功能,都要打一堆补丁,然后你发现,补丁摞补丁,终于又成了一堆屎山