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

推荐订阅源

N
Netflix TechBlog - Medium
V
Vulnerabilities – Threatpost
Google Online Security Blog
Google Online Security Blog
Hugging Face - Blog
Hugging Face - Blog
L
LINUX DO - 热门话题
云风的 BLOG
云风的 BLOG
P
Proofpoint News Feed
D
Docker
C
Cyber Attacks, Cyber Crime and Cyber Security
MyScale Blog
MyScale Blog
P
Palo Alto Networks Blog
T
Tenable Blog
P
Privacy International News Feed
Google DeepMind News
Google DeepMind News
小众软件
小众软件
Cisco Talos Blog
Cisco Talos Blog
aimingoo的专栏
aimingoo的专栏
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
A
Arctic Wolf
C
Cybersecurity and Infrastructure Security Agency CISA
C
Cisco Blogs
T
Threat Research - Cisco Blogs
NISL@THU
NISL@THU
The Hacker News
The Hacker News
Project Zero
Project Zero
AWS News Blog
AWS News Blog
Simon Willison's Weblog
Simon Willison's Weblog
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
T
Threatpost
V
Visual Studio Blog
The GitHub Blog
The GitHub Blog
The Cloudflare Blog
Last Week in AI
Last Week in AI
Jina AI
Jina AI
Cyberwarzone
Cyberwarzone
The Register - Security
The Register - Security
C
CXSECURITY Database RSS Feed - CXSecurity.com
Vercel News
Vercel News
D
Darknet – Hacking Tools, Hacker News & Cyber Security
MongoDB | Blog
MongoDB | Blog
U
Unit 42
Scott Helme
Scott Helme
A
About on SuperTechFans
WordPress大学
WordPress大学
F
Fortinet All Blogs
大猫的无限游戏
大猫的无限游戏
G
GRAHAM CLULEY
Latest news
Latest news
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
S
Schneier on Security

博客园 - Eric Lee

20230328-Epic Game更改修改更换安装目录 20230204 - 解决 Delphi 10.4 IDE 提示 socket error 10038 Access violation coreide270.bpl rtl270.bpl 20230126 - TurboGears 提示 builtins.NameError Session is not defined 20221112 - Find Device closed unexpectedly 问题解决 20220328 - BUG的出处 20220317 - 获取 .Net 版本的方法 20211015 - 解决华为 Matebook CPU 频率被锁在 0.39 GHz 的卡顿问题 20201118 - 解决CentOS7的RPMDB错误 rpmdb: BDB0113 Thread/process failed Thread died in Berkeley DB library 20201107 - 拯救 Discuz6 20201024 - 如何删除FF新鲜事 20201020 - 现代浏览器中表单自动完成功能带来的麻烦 20200331 - Zsh 下 使用 you-get 或 youtube-dl 时提示 no matches found 20200330 - Jetbrains IDE 提示 Unknown Module Type 的解决办法 20200320 - 解决 you-get 提示 urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108)> 20200319 - 解决 macOS 上 zsh 提示 command not found 的问题 20200310 - 在macOS上删除LaunchPad中的顽固的带问号图标 20200221 - 记录云服务器中 cna12.dll 木马的解决 20190926 - macOS 下查看进程路径 20190925 - 使 macOS 的 rm 命令删除到回收站的不完美办法
20230707-编程语言的变量覆盖
Eric Lee · 2023-07-07 · via 博客园 - Eric Lee

实现一个特性时,发现自定义的变量 position 覆盖了类的属性 Position,近期发现始终存在的一个难以复现的窗口还原 BUG 可能被因此修复了。

也曾 Debug 过,但没能复现。问题的解决就是这样,只要你还惦记着,问题总会被解决。

对于大小写不敏感度编程语言,尤其要注意大小写,所以我和我的朋友都在自己的代码范围内,对所有变量用小写及下划线来命名以规避这种难以发现的BUG。

不过 Rust 中赋值非 mut 变量会有提示,这点确实减少了 BUG,但 Rust 居然允许再次申明同名变量。

这点上来说,以前把定义写在开头的语言,比如 C、Delphi,其实也挺好的,除了有点不灵活之外。

变量初始化后,默认不允许再修改该变量。注意,修改变量是直接给变量赋值,而不是再次let声明该变量,再次声明变量是允许的,它会遮盖原变量