大佬,我代码哪错了?

时间:2022-05-07
本文章向大家介绍大佬,我代码哪错了?,主要内容包括问题无处不在、如何解决问题、如何向别人提问、如何才能 永无bug、2、佛系编程 永无bug、基本概念、基础应用、原理机制和需要注意的事项等,并结合实例形式分析了其使用技巧,希望通过本文能帮助到大家理解应用这部分内容。

问题无处不在

我: “大佬,帮我看看这个问题错在哪了?”

大佬: “你的代码呢、你的错误提示呢?”

我: “好的,我发给你”

大佬: “。。。 再见”

留下一脸懵逼的我

如何解决问题

最简单的方法是根据错误提示,查看对应位置的代码,Pycharm会提示具体是哪一行代码有问题,并抛出错误。

找到错误首先应自己想办法解决,自己解决又分为几种:有经验的大佬看到Error就知道是哪里有问题了,没经验怎么办,那就自己去搜索了。

下个结论,你遇到的问题,前人一定遇到过。

所以你只需要把你的错误提示搜索就好了。

注意下面,你懂的。(给自己一个好点的环境)

Google > 百度 stackoverflow > 知乎 github > CSDN

Github上有一个很有用的 trending ,可以显示今天或本周或本月最火的项目,例如:

techGay/91porn

Github 作为全球最大的同性交友网站,上面有很多值得我们好好学习的东西。

如何向别人提问

如果你真的像上面哪样,发一张照片,估计大佬都要吐血了。

在这里推荐大家使用Github上的 gist ,很适合分享代码片段。

Instantly share code, notes, and snippets.

例如这样

Issue in FromRequest #3144

这样看起来是不是舒服多了

如何才能 永无bug

1、佛祖保佑 永无bug

//                            _ooOoo_
//                           o8888888o
//                           88" . "88
//                           (| -_- |)
//                            O = /O
//                        ____/`---'____
//                      .   ' \| |// `.
//                       / \||| : |||// 
//                     / _||||| -:- |||||- 
//                       | | \ - /// | |
//                     | _| ''---/'' | |
//                       .-__ `-` ___/-. /
//                   ___`. .' /--.-- `. . __
//                ."" '< `.____<|>_/___.' >'"".
//               | | : `- `.;` _ /`;.`/ - ` : | |
//                   `-. _ __ /__ _/ .-` / /
//         ======`-.____`-.________/___.-`____.-'======
//                            `=---='
//
//         .............................................
//                  佛祖镇楼                  BUG辟易
//             佛曰:
//                  写字楼里写字间,写字间里程序员;
//                  程序人员写程序,又拿程序换酒钱。
//                  酒醒只在网上坐,酒醉还来网下眠;
//                  酒醉酒醒日复日,网上网下年复年。
//                  但愿老死电脑间,不愿鞠躬老板前;
//                  奔驰宝马贵者趣,公交自行程序员。
//                  别人笑我忒疯癫,我笑自己命太贱;
//                  不见满街漂亮妹,哪个归得程序员?

2、佛系编程 永无bug

No Code

No code is the best way to write secure and reliable applications. Write nothing; deploy nowhere.

Getting Started

Start by not writing any code.

This is just an example application, but imagine it doing anything you want. Adding new features is easy too:

The possibilities are endless.

Building the Application

Now that you have not done anything it's time to build your application:

Yep. That's it. You should see the following output:

Deploying

While you still have not done anything it's time to deploy your application. By running the following command you can deploy your application absolutely nowhere.

It's that simple. And when it comes time to scale the application, all you have to do is:

I know right?

Contributing

You don't.