We Feel Overwhelmed. It Isn't Going to Get Any Better

本文探讨了在处理遗留代码时如何保持积极态度并从中找到乐趣。作者指出,虽然遗留系统的维护充满挑战,但通过建立良好的工作环境、连接外部社区以及采用测试驱动开发等实践,程序员依然能够享受编程过程。

为自己打打气,转帖一篇好文章,来自于Michael Feathers的《Working effectively with legacy code》。

当你面对一堆大粪构成的大山的时候,还是有点事情可以做的——


Working in legacy code is difficult. There is no denying it. Although every situation is different, one thing is going to make the job worth it to you as a programmer or not: figuring out what is in it for you. For some people, it is a paycheck, and there isn't anything wrong with that—we all have to make a living. But there really ought to be some other reason why you are programming.

If you were lucky, you started out in this business writing code because you thought it was fun. You sat down with your first computer ecstatic with all of the possibilities, all of the cool things you could do by programming a computer. It was something to learn and something to master, and you thought, "Wow, this is fun. I can make a great career if I get very good at this."

Not everyone comes to programming this way, but even for people who didn't, it is still possible to connect with what is fun about programming. If you can—and some of your coworkers can, too—it really doesn't matter what kind of system you are working on. You can do neat things with it. The alternative is just dejection. It isn't any fun, and frankly, we all deserve better than that.

Often people who spend time working on legacy systems wish they could work on green-field systems. It's fun to build systems from scratch, but frankly, green-field systems have their own set of problems. Over and over again, I've seen the following scenario play out: An existing system becomes murky and hard to change over time. People in the organization get frustrated with how long it takes to make changes in it. They move their best people (and sometimes their trouble-makers!) onto a new team that is charged with the task of "creating the replacement system with a better architecture." In the beginning, everything is fine. They know what the problems were with the old architecture, and they spend some time coming up with a new design. In the meantime, the rest of the developers are working on the old system. The system is in service, so they receive requests for bug fixes and occasionally new features. The business looks soberly at each new feature and decides whether it needs to be in the old system or whether the client can wait for the new system. In many cases, the client can't wait, so the change goes in both. The green-field team has to do double-duty, trying to replace a system that is constantly changing. As the months go by it becomes clearer that they are not going to be able to replace the old system, the system you're maintaining. The pressure increases. They work days, nights, and weekends. In many cases, the rest of the organization discovers that the work that you are doing is critical and that you are tending the investment that everyone will have to rely on in the future.

The grass isn't really much greener in green-field development.

The key to thriving in legacy code is finding what motivates you. Although many of us programmers are solitary creatures, there really isn't much that can replace working in a good environment with people you respect who know how to have fun at work. I've made some of my best friends at work and, to this day, they are the people I talk to when I've learned something new or fun while programming.

Another thing that helps is to connect with the larger community. These days, getting in touch with other programmers to learn and share more about the craft is easier than it ever was. You can subscribe to mailing lists on the Internet, attend conferences, and take advantage of all the resources that you can use to network, share strategies and techniques, and generally stay on top of software development.

Even when you have a bunch of people on a project who care about the work and care about making things better, another form of dejection can set in. Sometimes people are dejected because their code base is so large that they and their team mates could work on it for 10 years but still not have made it more than 10 percent better. Isn't that a good reason to be dejected? Well, I've visited teams with millions of lines of legacy code who looked at each day as a challenge and as a chance to make things better and have fun. I've also seen teams with far better code bases who are dejected. The attitude we bring to the work is important.

TDD some code outside of work. Program for fun a little bit. Start to feel the difference between the little projects you make and the big project at work. Chances are, your project at work can have the same feel if you can get the pieces you work with to run into a fast test harness.

If morale is low on your team, and it's low because of code quality, here's something that you can try: Pick the ugliest most obnoxious set of classes in the project, and get them under test. When you've tackled the worst problem as a team, you'll feel in control of your situation. I've seen it again and again.

As you start to take control of your code base, you'll start to develop oases of good code. Work can really be enjoyable in them.

源码来自:https://pan.quark.cn/s/a3a3fbe70177 AppBrowser(Application属性查看器,不需要越狱! ! ! ) 不需要越狱,调用私有方法 --- 获取完整的已安装应用列表、打开和删除应用操作、应用运行时相关信息的查看。 支持iOS10.X 注意 目前AppBrowser不支持iOS11应用查看, 由于iOS11目前还处在Beta版, 系统API还没有稳定下来。 等到Private Header更新了iOS11版本,我也会进行更新。 功能 [x] 已安装的应用列表 [x] 应用的详情界面 (打开应用,删除应用,应用的相关信息展示) [x] 应用运行时信息展示(LSApplicationProxy) [ ] 定制喜欢的字段,展示在应用详情界面 介绍 所有已安装应用列表(应用icon+应用名) 为了提供思路,这里只用伪代码,具体的私有代码调用请查看: 获取应用实例: 获取应用名和应用的icon: 应用列表界面展示: 应用列表 应用运行时详情 打开应用: 卸载应用: 获取info.plist文件: 应用运行时详情界面展示: 应用运行时详情 右上角,从左往右第一个按钮用来打开应用;第二个按钮用来卸载这个应用 INFO按钮用来解析并显示出对应的LSApplicationProxy类 树形展示LSApplicationProxy类 通过算法,将LSApplicationProxy类,转换成了字典。 转换规则是:属性名为key,属性值为value,如果value是一个可解析的类(除了NSString,NSNumber...等等)或者是个数组或字典,则继续递归解析。 并且会找到superClass的属性并解析,superClass如...
基于遗传算法辅助异构改进的动态多群粒子群优化算法(GA-HIDMSPSO)的LSTM分类预测研究(Matlab代码实现)内容概要:本文研究了一种基于遗传算法辅助异构改进的动态多群粒子群优化算法(GA-HIDMSPSO),并将其应用于LSTM神经网络的分类预测中,通过Matlab代码实现。该方法结合遗传算法的全局搜索能力与改进的多群粒子群算法的局部优化特性,提升LSTM模型在分类任务中的性能表现,尤其适用于复杂非线性系统的预测问题。文中详细阐述了算法的设计思路、优化机制及在LSTM参数优化中的具体应用,并提供了可复现的Matlab代码,属于SCI级别研究成果的复现与拓展。; 适合人群:具备一定机器学习和优化算法基础,熟悉Matlab编程,从事智能算法、时间序列预测或分类模型研究的研究生、科研人员及工程技术人员。; 使用场景及目标:①提升LSTM在分类任务中的准确性与收敛速度;②研究混合智能优化算法(如GA与PSO结合)在神经网络超参数优化中的应用;③实现高精度分类预测模型,适用于电力系统故障诊断、电池健康状态识别等领域; 阅读建议:建议读者结合Matlab代码逐步调试运行,理解GA-HIDMSPSO算法的实现细节,重点关注种群划分、异构策略设计及与LSTM的集成方式,同时可扩展至其他深度学习模型的参数优化任务中进行对比实验。
<think>好的,用户询问的是Zotero的Better Notes插件中Markdown语法失效的原因和解决方案。首先,我需要回忆一下Zotero和Better Notes插件的相关信息。Zotero是一个文献管理工具,而Better Notes是一个增强笔记功能的插件,支持Markdown语法,方便用户整理笔记。 用户提到Markdown语法失效,可能的原因有很多。首先,我应该考虑插件版本是否兼容。Zotero本身会更新,如果Better Notes插件没有及时更新,可能会导致兼容性问题。另外,用户可能没有正确启用Markdown渲染功能,或者设置中的某些选项被意外关闭了。 接下来,插件的冲突也是一个可能因素。如果用户安装了其他插件,特别是与笔记或编辑相关的,可能会与Better Notes产生冲突,导致Markdown无法正常渲染。此外,缓存问题有时候也会影响插件的表现,清除缓存可能有助于解决问题。 还有可能是语法错误,虽然用户可能认为自己的Markdown是正确的,但某些特殊字符或格式可能被误用,导致渲染失败。例如,未正确闭合的代码块或错误的标题符号。 此外,Zotero的配置问题也可能导致此情况,比如用户可能禁用了某些JavaScript功能,或者安全设置阻止了插件的正常运作。再者,操作系统或浏览器的更新有时会影响插件的性能,尤其是如果Better Notes依赖某些特定的API或库。 在解决方案方面,首先建议用户检查并更新插件到最新版本,确保与当前Zotero版本兼容。然后,确认Markdown渲染功能是否已启用,并检查设置中的相关选项。如果问题依旧,尝试禁用其他插件,排除冲突可能。清除缓存和重启Zotero也是一个基本步骤。用户还可以尝试重新创建笔记,或者检查Markdown语法是否正确。如果这些都不奏效,可能需要查阅官方文档或联系开发者寻求支持。 另外,用户可能没有提到的更深层次问题,比如数据库损坏或文件权限问题,但这种情况较为少见。需要一步步引导用户排查,从简单到复杂,避免让用户感到 overwhelmed。</think>关于 Zotero Better Notes 插件中 Markdown 语法失效的问题,以下是可能原因及解决方案的逐步分析: ### 一、常见失效原因 1. **插件版本不兼容** Zotero 客户端更新后可能导致旧版 Better Notes 插件失效(如 Zotero 7 与为 Zotero 6 设计的插件不兼容)[^1] 2. **未启用 Markdown 渲染** Better Notes 需要手动开启 Markdown 支持: `Preferences → Better Notes → General → Enable Markdown` 3. **插件冲突** 同时安装的 ZotCard / Markdown Here 等插件可能产生功能冲突 4. **缓存未更新** 旧版本笔记缓存可能导致新语法无法正确解析 ### 二、解决方案流程 1. **版本检查** - Zotero 版本:`Help → About` - Better Notes 版本:`Tools → Add-ons → Extensions` - 兼容对照表: ``` Zotero 6.x → Better Notes v3.x Zotero 7.x → Better Notes v4.x+ ``` 2. **基础修复步骤 ```javascript // 重置渲染设置(通过Zotero调试器) await Zotero.Prefs.setAsync('better-bibtex.autoPin', false); await Zotero.Prefs.setAsync('better-bibtex.autoExport', ''); ``` 3. **冲突检测** - 临时禁用其他插件 - 重启 Zotero 后测试 Markdown 功能 4. **语法验证示例** 有效代码: ```markdown ## 标题 **加粗** 与 _斜体_ ``` 失效代码: ```markdown #错误示例# 未闭合的`代码块 ``` ### 三、进阶处理 若基础方案无效,可尝试: 1. 删除并重新安装插件 2. 重置 Zotero 配置: ```bash # Linux/macOS rm -rf ~/.zotero # Windows del %APPDATA%\Zotero ``` 3. 检查系统字体缺失问题(影响数学公式渲染)
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值