在 JavaScript 中为 Node.js 创建模块/库需要多长时间?
我还没有学习编程语言,我必须为我的项目在 Python 和 JaveScript 之间进行选择。
我知道,对于 Python,大多数库已经为我准备好了,可以随时使用。但我绝对喜欢这样一个事实:如果我学习 JavaScript,我就可以用一种语言编写服务器端 (Node.js) 和客户端 (jQuery) 脚本;另外,据我所知,Node.js 比 Python 快得多 阅读。我对此很着迷。
但这也意味着,由于 JS 中缺乏许多标准库(至少我是这么听说的),我可能必须从头开始为我的项目创建自己的模块/库。那么,对 JavaScript/Node.js/jQuery 感兴趣的人可以告诉我 - 用 JavaScript 完成编写自定义库通常需要多长时间?
时间范围=从“编写一个基本库所花费的时间”到“编写一个非常复杂的库所花费的时间”。例如,“大约 10 天到一个月”。
这将真正帮助我决定作为初学者是否可以从一开始就依赖 JavaScript/Node.js 组合来完成我的项目。谢谢。
I have yet to learn a programming language, and I have to choose between Python and JaveScript for my project.
With Python, I know, most of the libraries are already there for me, quite ready to use. But I absolutely love the fact that if I learn JavaScript, I can do both server-side (Node.js) and client-side (jQuery) scripting in one language; plus Node.js is considerably faster than Python from what I read. And I am obessed with that.
But that also means, I might have to create my own modules/libraries from scratch for my project, due to the lack of many standard libraries in JS (at least that's what I heard). So, can someone who's been into JavaScript/Node.js/jQuery stuff please tell me this - - what's the timeframe it normally takes to complete writing a custom library in JavaScript?
Timeframe = from "time taken to write a basic library" to "time taken to write a very complex library". For example, "like 10 days to a month."
That will really help me decide whether as a beginner I can depend on JavaScript/Node.js combo for my project right from the start. Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
好吧,确实没有任何答案对你有任何意义。如果没有编程经验,您可能需要一周的时间才能完成一个简单的库,而需要数年的时间才能完成一个复杂的库。对于经验丰富的程序员来说,制作一个简单的库可能需要一个小时或更短的时间,而制作一个复杂的库可能需要几年的时间。考虑到这一点:
从头开始创建一个库需要 1 小时到 10 年的时间。
Well, there really is no answer that will mean anything to you. With no programming experience it may well take you a week to do a simple library and years to do a complex library. For an experienced programmer is may take an hour or less to make a simple library and years to make a complex one. With that in mind:
1 hour to 10 years to create a library from scratch.
我很高兴先学习 Python,然后学习 Node.js,使用 Node.js 编写生产级别的东西显然更难、更慢。
至少对我来说,用 Node.js 编写类似的库比用 Python 多花费大约 50% 的时间。
I've had pleasure of learning first Python and then Node.js and it's clearly harder and slower to write production level stuff with Node.js.
At least for me writing similar library in Node.js than with Python takes roughly 50% more time.
我为 i.tv 的工作编写了大量的 Node.js 库。事实上,如果你了解 Javascript,这并不难,而且已经有大量的库了。对于我想象你想要的东西,答案是其他人可能已经知道如何去做。如果不是这样的话,JavaScript 非常容易学习并且拥有一个很棒的社区。就像其他发帖者所说的那样,它并不严格执行约定或最佳方法,而是从示例中学习,看看其他人在做什么,并在 StackOverflow 或 IRC 上寻求帮助!
现有的一些库包括数据库连接(mongoose)、网络框架(express),发出 http 请求 (请求) ,用日期做一些奇特的事情(moment.js)。
寻找节点模块的两个好地方是:
对于一般节点说明和帮助,有该网站上有一些很棒的(尽管有时有些过时)文章 http://howtonode.org/。如果您想了解具体细节,node.js 邮件列表是了解最新和最好的模块的好地方。最后的建议是关注JSMentor 的邮件列表。那里的人们整天都在争论 JavaScript 的最佳实践。
祝您开始使用 Node.js 好运。这很有趣。
I've written a ton of node.js libraries for my work at i.tv. The fact is that if you know Javascript it's not that hard and there are already a ton of libraries out there. For the stuff I imagine that you want, the answer is that someone else probably already figured out how to do it. If that's not the case JavaScript is incredibly easy to learn and has a great community. Like other posters said it doesn't strictly enforce conventions or a best way, but learn from examples, see what other people are doing and ask for help on StackOverflow or IRC!
Some of the libraries that exist include database connectivity (mongoose), web-framework (express), making http requests (request), doing fancy stuff with dates (moment.js).
Two great places to look for node modules are:
For general node instructions and help, there are some great (though occasionally dated) articles on the site http://howtonode.org/. If you want to get into the knitty gritty the node.js mailing list is a great place to learn about the latest and greatest modules. A final suggestion is to following the JSMentor's mailing list. People there debate JavaScript best practices all day long.
Best of luck to getting started with node.js. It's a lot of fun.
好吧,如果一个非常简单的库所做的只是从提供的字符串创建颜色哈希,那么它可能只需要半个小时左右。与四个或八个方法的 C++ 代码的小型绑定也可以在几个小时内完成。然而,其他项目,例如socket.io,需要多个贡献者不断致力于它。确实很难回答。
Well, a very simple library might just take half an hour or so if all it does is creating color hashes from supplied strings. Small bindings to C++ code with four or eight methods are also doable in a few hours. However, other projects, like socket.io, need multiple contributors that constantly work on it. It's really hard to answer.
执行 eenie minie mo 并首先选择要学习的语言。
你的问题类似于:
“我不知道如何用日语或中文写/读。用两种语言写一篇文章需要多长时间”
无论你怎么看,你都需要学习如何“写/交流”第一的。 Python 与 Js 现在不应该成为问题。
Do eenie minie mo and pick a language to learn first.
Your question is similar to:
"I don't know how to write/read in Japanese or Chinese. How long will it take for me to write an article in either language"
Regardless of how you look at it, you need to learn how to "write/communicate" first. Python vs. Js shouldn't be a concern right now.