由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Programming版 - One angry npm module took down the whole npm
相关主题
dotnet可以用NPM,Bower吗?学angular js有哪些有用的书?
什么库能做这个功能?php和node谁快
angular是否淘汰jquery了贡献一个很好的模板网站
replace document body,but js does not run前端最重要的还是 JQuery + BootStrap + RequireJS
Gliffy真是个好东西现在学front end framework的话哪个最好?
想自学JS based web development, 如何入手?快糙猛还是名不虚传的
AngularJS 和 BootStrapangular实际项目有啥可操性?
AngularJS vs Dojodjango做网站请推荐前端框架
相关话题的讨论汇总
话题: str话题: npm话题: ch话题: len话题: leftpad
进入Programming版参与讨论
1 (共1页)
l**********n
发帖数: 8443
1
http://www.haneycodes.net/npm-left-pad-have-we-forgotten-how-to
module.exports = leftpad;
function leftpad (str, len, ch) {
str = String(str);
var i = -1;
if (!ch && ch !== 0) ch = ' ';
len = len - str.length;
while (++i < len) {
str = ch + str;
}
return str;
}
s***o
发帖数: 2191
2
best comment on reddit:
"well, they are javascript developers"
l**********n
发帖数: 8443
3
I think open source projects are all like that

【在 s***o 的大作中提到】
: best comment on reddit:
: "well, they are javascript developers"

l**********n
发帖数: 8443
4
a good module developer would use as few external modules as possible. also
to make the library as small as possible
n*****t
发帖数: 22014
5
这其实是个经典案例,现在轮子越来越多,人越来越懒。很多所谓马工上班就是 cc-cv
,根本不动脑子,更不考虑什么效率啊稳定性啊之类的。



【在 l**********n 的大作中提到】
: http://www.haneycodes.net/npm-left-pad-have-we-forgotten-how-to
: module.exports = leftpad;
: function leftpad (str, len, ch) {
: str = String(str);
: var i = -1;
: if (!ch && ch !== 0) ch = ' ';
: len = len - str.length;
: while (++i < len) {
: str = ch + str;
: }

n******7
发帖数: 12463
6
这个更发指吧
There’s a package called isArray that has 880,000 downloads a day, and 18
million downloads in February of 2016. It has 72 dependent NPM packages.
Here’s it’s entire 1 line of code:
1 return toString.call(arr) == '[object Array]';
我最讨厌没意义的dependence,和过度设计的系统
就是一坨xx
T*******x
发帖数: 8565
7
哈哈。这个太幽默了。

【在 n******7 的大作中提到】
: 这个更发指吧
: There’s a package called isArray that has 880,000 downloads a day, and 18
: million downloads in February of 2016. It has 72 dependent NPM packages.
: Here’s it’s entire 1 line of code:
: 1 return toString.call(arr) == '[object Array]';
: 我最讨厌没意义的dependence,和过度设计的系统
: 就是一坨xx

a*f
发帖数: 1790
8
这是以前C编程的思想,我们试过把所有的库函数都实现,二进制文件比源代码还小
现在很多时候更追求convention over configuration。如果一个library只有少数人用
,一般不管,用的人多了就成了convention。比如Java的空字串,开始的项目都自己写
,后来人换多了就统一用StringUtils。jQuery的UI也是这样,很多控件其实很容易写
,特别是Bootstrap也出来后。

also

【在 l**********n 的大作中提到】
: a good module developer would use as few external modules as possible. also
: to make the library as small as possible

ET
发帖数: 10701
9
at least, that's how i develops iOS app.
I check carefully the 3rd library I will use.
but for node.js, I don't really care. i can't tell difference anyways.

also

【在 l**********n 的大作中提到】
: a good module developer would use as few external modules as possible. also
: to make the library as small as possible

c******n
发帖数: 16666
10
js这一点都挺吓人的
我现在bower update都是一个一个来

【在 ET 的大作中提到】
: at least, that's how i develops iOS app.
: I check carefully the 3rd library I will use.
: but for node.js, I don't really care. i can't tell difference anyways.
:
: also

d*******r
发帖数: 3299
11
Node.js 的模块是比较 fragile, 不如 Python 模块,但是 Ruby 的模块更 fragile.
这个主要跟社区的人有关.
1 (共1页)
进入Programming版参与讨论
相关主题
django做网站请推荐前端框架Gliffy真是个好东西
JS用户界面求建议想自学JS based web development, 如何入手?
bootstrap看起来不错AngularJS 和 BootStrap
remove a module from cvsAngularJS vs Dojo
dotnet可以用NPM,Bower吗?学angular js有哪些有用的书?
什么库能做这个功能?php和node谁快
angular是否淘汰jquery了贡献一个很好的模板网站
replace document body,but js does not run前端最重要的还是 JQuery + BootStrap + RequireJS
相关话题的讨论汇总
话题: str话题: npm话题: ch话题: len话题: leftpad