如何有效使用每一点脑力总结

如果您知道这些工具的存在,那么您现在可能会使用它们。 (If you knew these tools existed, you'd probably be using them by now.)

This article isn’t going to tell you about saving your neck with a Roost stand, or your wrists with a split keyboard - I’ve already done that. This article is about saving your brain – let's call it technical ergonomics.

本文不会告诉您有关使用Roost支架节省脖子或使用拆分式键盘节省手腕的知识- 我已经做到了 。 本文旨在节省您的大脑–我们称之为技术人体工程学。

When I first began to program full time, I found myself constantly tired from the mental exertion. Programming is hard! Thankfully, you can take some solace in knowing it gets easier with practice, and with a great supporting cast.

当我第一次开始全职编程时,我发现自己经常因精神消耗而感到疲倦。 编程很难! 值得庆幸的是,您可以放心,因为它知道实践变得更容易,并且有很好的辅助演员。

Some very nice folks who preceded us came up with tools to make the difficult bits of communicating with computers much easier on our poor human meat-brains.

在我们之前的一些非常出色的人想出了一些工具,可以使我们在人类可怜的肉类大脑上与计算机进行通信的困难变得更加容易。

I invite you to explore these super helpful technical tools. They’ll improve your development set up and alleviate much of the mental stress of programming. You soon won’t believe you could have done without them.

我邀请您探索这些超级有用的技术工具。 它们将改善您的开发设置,并减轻编程的大部分精神压力。 您很快将不相信没有它们,您将无法完成。

不是您的平均语法突出显示 (Not your average syntax highlighting)

If you’re still working with syntax highlighting that just picks out variable and class names for you, that’s cute. Time to turn it up a notch.

如果您仍在使用语法突出显示功能,只是为您挑选变量和类名,那就太好了。 是时候提高它了。

In all seriousness, syntax highlighting can make it much easier to find what you’re looking for on your screen: the current line, where your current code block starts and ends, or the absolute game-changing which-bracket-set-am-I-in highlight.

严格来说,语法高亮显示可以使您在屏幕上查找所需内容变得更加容易:当前行,当前代码块的开始和结束位置,或者改变游戏规则的绝对方法,我在突出显示。

I primarily use Visual Studio Code, but similar extensions can be found for the major text editors.

我主要使用Visual Studio Code,但是可以在主要的文本编辑器中找到类似的扩展名。

Here are my favorites:

这是我的最爱:

  • Bracket Pair Colorizer highlights sequential bracket pairs in different matching colors, making the pain of picking through nested brackets and parentheses a  thing of the past.

    括号对着色器以不同的匹配颜色突出显示顺序的括号对,从而消除了通过嵌套括号和括号进行选择的痛苦。

  • TODO Highlight effectively removes any excuse you may have had for unintentionally committing TODO and FIXME comments by making them really easy to see. You can even add your own custom keywords to be highlighted (I suggest wtf, but you didn’t hear it from me.)

    TODO Highlight通过使它们真正易于查看,有效地消除了您可能无意间提交TODOFIXME注释的任何借口。 您甚至可以添加自己的自定义关键字以突出显示(我建议使用wtf ,但您没有收到我的wtf 。)

  • Indented Block Highlighting puts an easy-to-distinguish but unobtrusive highlight behind your current indented code block, so you can see just where that if ends and why that last else isn’t doing anything at all.

    缩进块突出显示在当前缩进代码块的后面放置了易于区分但不引人注意的突出显示,因此您可以看到if结束的地方以及为什么最后else根本没有做任何事情。

  • Highlight Line puts a (slightly too) bright line where you last left your cursor. You can customize the line’s appearance - I set the borderWidth of mine to 1px.

    高亮线在您最后一次离开光标的位置放置了一条(也略微)亮线。 您可以自定义线条的外观-我将我的borderWidth设置为1px

The theme pictured in Visual Studio Code above is Kabukichō. I made it.

上面的Visual Studio Code中描绘的主题是Kabukichō 。 我做到了。

使用Git挂钩 (Use Git hooks)

I previously brought you an interactive pre-commit checklist in the style of infomercials that’s both fun and useful for reinforcing the quality of your commits. But that’s not all!

之前,我以信息商业的方式为您带来了一个交互式的提交前检查清单,该清单既有趣又对增强提交质量很有帮助。 但这还不是全部!

Git hooks are scripts that run automatically at pre-determined points in your workflow. Use them well, and you can save a ton of brainpower.

Git挂钩是在工作流中的预定位置自动运行的脚本。 很好地使用它们,您可以节省大量的脑力。

A  pre-commit hook remembers to do things like lint and format code, and even runs local tests for you before you indelibly push something embarrassing.

pre-commit钩子会记住执行诸如lint和format代码之类的操作,甚至会在您无情地推送令人尴尬的内容之前为您运行本地测试。

Hooks can be a little annoying to share (the .git/hooks directory isn’t tracked and thus omitted when you clone or fork a  repository) but there’s a framework for that: the confusingly-named pre-commit framework, which allows you to create a shareable configuration file of Git hook plugins, not just for pre-commit.

钩子共享可能会有些烦人(不会跟踪.git/hooks目录,因此在克隆或分叉存储库时会省略.git/hooks ),但是有一个框架:易混淆的预提交框架 ,允许您创建一个可共享的Git钩子插件配置文件,而不仅仅是用于pre-commit

I spend a majority of my time these days coding in Python, so here is my current favorite .pre-commit-config.yaml:

这些天,我大部分时间都用Python编码,所以这是我目前最喜欢的.pre-commit-config.yaml

fail_fast: true
repos:- repo: https://github.com/pre-commit/pre-commit-hooksrev: v3.1.0 # Use the ref you want to point athooks:- id: detect-aws-credentials- id: end-of-file-fixer- id: trailing-whitespace- repo: https://github.com/psf/blackrev: 19.3b0hooks:- id: black- repo: https://github.com/asottile/blacken-docsrev: v1.7.0hooks:- id: blacken-docsadditional_dependencies: [black==19.3b0]- repo: https://github.com/pre-commit/mirrors-mypyrev: v0.780hooks:- id: mypy- repo: localhooks:- id: isortname: isortstages: [commit]language: systementry: isorttypes: [python]- id: blackname: blackstages: [commit]language: systementry: blacktypes: [python]

There are tons of supported hooks to explore.

有大量受支持的钩子可供探索。

使用文字系统 (Use a type system)

If you write in languages like Python and JavaScript, get yourself an early birthday present and start using a static type system. Not only will this help improve the way you think about code, it can help make type errors clear before running a single line.

如果您使用Python和JavaScript之类的语言编写代码,请给自己一个生日礼物,并开始使用静态类型系统。 这不仅有助于改善您对代码的思考方式,而且还可以帮助在运行单行之前清除类型错误。

For Python, I like using mypy for static type checking. You can set it up as a pre-commit hook (see above) and it’s supported in Visual Studio Code too.

对于Python,我喜欢使用mypy进行静态类型检查。 您可以将其设置为pre-commit挂钩(参见上文),并且在Visual Studio Code中也受支持 。

TypeScript is my preferred way to write JavaScript. You can run the compiler on the command line using Node.js (see instructions in the repo), it works pretty well with Visual Studio Code out of the box, and of course there are multiple options for extension integrations.

TypeScript是我编写JavaScript的首选方式。 您可以使用Node.js在命令行上运行编译器(请参见repo中的说明 ),它与开箱即用的Visual Studio Code一起使用时效果很好,当然, 扩展集成有多个选项。

退出不必要地殴打你的肉脑 (Quit unnecessarily beating up your meat-brain)

I mean, you wouldn’t stand on your head all day to do your work. It would be rather inconvenient to read things upside down all the time (at least until your brain adjusted), and in any case you’d likely get uncomfortably congested in short order.

我的意思是,您不会整日站着工作。 一直在颠倒阅读东西(至少直到您的大脑调整了 )会很不方便,而且在任何情况下,您短期内都可能会感到不适。

Working without taking advantage of the technical ergonomic tools I’ve given you today is a little like unnecessary inversion - why would you, if you don’t have to?

在不利用我今天提供给您的技术人体工程学工具的情况下工作有点像不必要的倒置-如果不需要,为什么要这么做?

翻译自: https://www.freecodecamp.org/news/how-to-save-your-brainpower-and-code-more-efficiently/

如何有效使用每一点脑力总结

如何有效使用每一点脑力总结_如何更有效地节省脑力和编码相关推荐

  1. 微信游戏脑力大乱斗92一个计算机,微信脑力大乱斗x游戏_脑力大乱斗x游戏答案完整版预约_第一手游网...

    微信脑力大乱斗x这款火爆微信小程序的趣味答题类闯关游戏,游戏以各种脑经急转弯方式的题目让很多玩家沉迷其中,各种搞笑有趣的题目你可以玩到笑喷,不知道微信脑力大乱斗x题目答案的小伙伴们可以在下方了解一下哦 ...

  2. 手动创建线程池 效果会更好_创建更好的,可访问的焦点效果

    手动创建线程池 效果会更好 Most browsers has their own default, outline style for the :focus psuedo-class. 大多数浏览器 ...

  3. 程序阅读_全面详解LTE:MATLAB建模仿真与实现_自学笔记(1)调制与编码_程序阅读

    程序阅读_全面详解LTE:MATLAB建模仿真与实现_自学笔记(1)调制与编码_程序阅读 在粗浅地掌握了LTE知识后,从今天开始对<全面详解LTE:MATLAB建模仿真与实现>一书的学习. ...

  4. java unicode是什么意思_(转)谈谈对Java中Unicode、编码的理解

    我们经常会遇到编码问题.Java号称国际化的语言,是因为它的class文件采用UTF-8,而JVM运行时使用UTF-16(至于为什么JVM中要采用UTF-16,我没看过 相关的资料,但我猜可能是因为J ...

  5. 已知长短轴求椭圆上任意一点的坐标_高中数学必修2:平面解析几何——椭圆(经典习题)...

    今天接着给大家分享关于高中数学必修2平面解析几何中椭圆知识点讲解,从三个方面进行讲解:基础梳理.要点整理.经典高考习题解题过程及答案. 一.基础梳理 1.椭圆的定义 2.椭圆的标准方程和几何性质 要点 ...

  6. 8 一点就消失_微信富二代男友转账20w后,却在见面前一秒消失??...

    网恋 是一场刺激的冒险 最近在网上看到一个投稿 一个8分女神网恋上富二代 原本看起来好像没有什么问题 但...富二代男友却在奔现当天神秘消失了 女主的投稿 ▼ 女主和男主的聊天 ▼ 男主作为富二代 转 ...

  7. 微信游戏脑力大乱斗92一个计算机,微信脑力大乱斗答案大全_全关卡图文攻略_软吧...

    脑力大乱斗是一款非常益智的小程序游戏,大家通过微信就可以直接打开无需下载.这里小编为大家提供的是所有关卡的过关技巧帮助小伙伴们了解这个游戏的脑洞,在碰上难题的时候协助大家顺利过关! [游戏入口] 在微 ...

  8. 8 一点就消失_消失的莉莉安(25)

    文|明鸢 Hi,中午好,我是暖叔 今天是免费连载<消失的莉莉安>第25章 消失的莉莉安▶▶ 往期链接: ▼ 向下滑动阅读 1:"消失的莉莉安(1)" 2:   消失的莉 ...

  9. 8 一点就消失_农村即将消失的15个“老物件”,件件充满回忆,全认识说明你老了...

    农村城镇化的发展可谓是突飞猛进,越来越多的农村步入了城市的行列.其实步入城市发展之后,农村的进步那真不是一星半点,可谓是全方位的变化.最显而易见的是居住条件和基础设施,都得到了显著的提升,其次就是社会 ...

最新文章

  1. 硬盘为何会丢失数据?
  2. python set 排序_python set 排序_如何在Python中使用sorted()和sort()
  3. php读取word中的内容
  4. Spring学习(七)bean装配详解之 【通过注解装配 Bean】【自动装配的歧义解决】...
  5. 全国首个!北京手机一卡通开卡费今起取消
  6. instant java,Instant
  7. Java——Map 集合
  8. 4.2 优化数据访问
  9. codeforces 584E Anton and Ira [想法题]
  10. 电商项目——商品分类/品牌查询
  11. android多媒体框架学习
  12. 软考备考-系统构架师-21-系统架构师考纲整理
  13. 电压负反馈放大电路(基于三极管)
  14. 关于小米笔记本Pro内部风扇异响问题解决方法
  15. python 爬取图片、没有后缀名_python爬虫,图片是无格式的
  16. 腾讯开放平台实现QQ登录
  17. 深度学习入门知识整理-训练技巧以及模型调优
  18. 二极管、三极管、MOSFET管知识点总结
  19. Windows 在目录中搜索哪个文件中有指定字符串
  20. 【Lesson 13】万能和弦和弦走向

热门文章

  1. JDBC操作数据库实例
  2. 做图形处理Linux小型主机,8个优秀的linux图形图像工具
  3. python多变量非线性拟合_python实现多变量线性回归(Linear Regression with Multiple Variables)...
  4. 终极方案!解决正确设置LaunchImage后仍然不显示的问题
  5. 原生ajax+php上传图片的简单实现
  6. Bag标签之中的一个行代码实行中文分词实例2
  7. C#图片灰度处理(位深度24→位深度8),用灰度数组byte[]新建一个8位灰度图像Bitmap 。...
  8. nginx 启动脚本
  9. 新浪微博应用 IE下面框架嵌套框架的问题解决
  10. ucontext实现的用户级多线程框架3(实现echo服务器)