热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

正确的初学者工作流程-使用包或不使用包-Correctworkflowforabeginner-Tousepackagesordon't

Justastupidquestion.Ivebeenstrugglingintheselastdays,asaDjangobeginner,withtheemai

Just a stupid question. I've been struggling in these last days, as a Django beginner, with the email registration (instead of the default User registration), and I've been thinking: is it better (in a process of learning) to keep on with the struggle and succeed, in the end, in the realization of the "project", or is it good too to use Django packages (like django-registration-redux)?

只是一个愚蠢的问题。作为一名Django初学者,我一直在努力进行电子邮件注册(而不是默认的用户注册),并且我一直在思考:继续使用它是否更好(在学习过程中)最终,在“项目”的实现中奋斗和成功,还是使用Django包(如django-registration-redux)也是好事?

I mean, is it going to help me all the struggle of doing things without packages (i.e. Suppose I want to work as a Django developer), or is it useless effort?

我的意思是,它是否会帮助我在没有包装的情况下做所有的事情(即假设我想作为Django开发人员工作),还是无用的努力?

Thank you.

谢谢。

2 个解决方案

#1


1  

Although I agree with The Laughing Man that this is opinion based, I will give my opinion hoping it will help. I have worked with Django for quite a while now, and I have learned that the answer to your question is based on a few things; Does the package have all of the functionalities you need, and a little more in case you need it? Can you and will you want to extend the functionality of the package yourself eventually? And most importantly - is the package well maintained? I found that answering yes to those three questions usually meant it was a good bet to go with the package.

虽然我同意The Laughing Man这是基于意见的,但我会发表意见,希望它会有所帮助。我已经和Django合作了很长一段时间了,我已经知道你的问题的答案是基于一些事情;包装是否具备您需要的所有功能,如果您需要它,还需要更多功能吗?你能和你最终想要自己扩展包的功能吗?最重要的是 - 包装是否得到很好的维护?我发现对这三个问题回答“是”通常意味着与包装一起使用是一个不错的选择。

In your case - it looks like the package is very well maintained - so I would go with that assuming it meets the other 2 criteria (or django-allauth, which is also excellent). No point in reinventing the wheel, especially if someone has done it better.

在你的情况下 - 看起来包装得到很好的维护 - 所以我会假设它符合其他2个标准(或django-allauth,这也很优秀)。没有必要重新发明轮子,特别是如果有人做得更好。

#2


0  

I agree with The Laughing Man and Hybrid for their respective view points. I have not worked with Django, but have worked with a large number of other frameworks. I would like to add to what Hybrid has said - remember that Django is a framework and a framework usually consists of a set of packages most of which work in tandem with each other(for example a method in one package P1 may expect an argument that is actually obtained using facilities from another package P2). Hence, if your code uses the packages available within Django then it will seamlessly work with other packages within the Django framework. If you are to (re)invent the wheel, then you may end up with some highly sophisticated and specialized functionality which would have the following characteristics:

我同意The Laughing Man and Hybrid的各自观点。我没有使用Django,但已经使用了大量其他框架。我想补充一下Hybrid所说的内容 - 记住Django是一个框架,框架通常由一组包组成,其中大多数包相互协同工作(例如,一个包P1中的方法可能期望一个参数,实际上是使用来自另一个包P2)的设备获得的。因此,如果您的代码使用Django中可用的包,那么它将与Django框架内的其他包无缝协作。如果你要(重新)发明轮子,那么你最终可能会得到一些具有以下特征的高度复杂和专业的功能:

  • Buggy - because you may not have handled all the use-cases and flows needed within that package.
  • Buggy - 因为您可能没有处理该包中所需的所有用例和流程。
  • Does not promote seamless integration with other core framework libraries. In which case you would need to write more code so that your specialized class works with the framework classes.
  • 不促进与其他核心框架库的无缝集成。在这种情况下,您需要编写更多代码,以便您的专业类可以使用框架类。

Re-inventing the wheel most often is a waste of time unless you are truly sure that you can solve the same problem in a real mind-blowing new way.

重新发明轮子往往是浪费时间,除非你真的确信你能以一种真正令人兴奋的新方式解决同样的问题。


推荐阅读
author-avatar
陈炘宇_573
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有