Aaron Swartz Rewriting Reddit中关于web.py的创建思路

本文探讨了一位天才少年的悲剧,强调了心理健康的重要性。文章指出,清晰简洁的代码原则、符合代码需求的框架使用以及遵循Web最佳实践是开发过程中关键的三个原则。它提醒开发者关注自己的心理健康,同时分享了如何合理运用web.py框架进行高效编程的方法。

这天才少年居然自杀了,哎

原文点这

 

So how should things work? The first principle is that code should be clear and simple. If you want to output some text, you call web.output. If you want to get form input, you call web.input. There’s nothing particularly hard to remember.

The second principle is that web.py should fit your code, not the other way around. Every function in web.py is completely independent, you can use whichever ones you want. You can put your files wherever you like, and web.py will happily follow along. If you want a piece of code to be run as a web app, you call web.run, you don’t put your code in the magical place so that web.py can run you.

The third principle is that web.py should, by default, do the right thing by the Web. This means distinguishing between GET and POST properly. It means simple, canonical URLs which synonyms redirect to. It means readable HTML with the proper HTTP headers.

转载于:https://www.cnblogs.com/TLightSky/p/4079337.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值