The mistakes not to make
-
NPM &# left-pad: Have We Forgotten How To Program? | Haney Codes .NET[^] Oh... I found a package that convert object to string, *must* depend on it!
All in one Menu-Ribbon Bar DirectX for WinRT/C# since 2013! Taking over the world since 1371!
-
NPM &# left-pad: Have We Forgotten How To Program? | Haney Codes .NET[^] Oh... I found a package that convert object to string, *must* depend on it!
All in one Menu-Ribbon Bar DirectX for WinRT/C# since 2013! Taking over the world since 1371!
Hear! Hear! Haven't I railed against that culture here on CP several times in the past? And of course had others scoff in response, something about reinventing the wheel I think. A developer's first thought upon meeting a challenge (something the standard library or framework doesn't have) should not be "where can I find something that does that?", but instead "can I do that myself?" If you can't do it yourself, fine, look for something ready-made*, but you have to remember that eventually you may find yourself in a situation where no one has gone before and you will have to do it yourself. Will you have allowed your development skills to atrophy? Or will your skills still be sharp from frequent use in many challenging situations? Be a developer! * And read the code! Learn from it! Don't just use it; can you take the technique and develop a better or more suitable solution?
-
Hear! Hear! Haven't I railed against that culture here on CP several times in the past? And of course had others scoff in response, something about reinventing the wheel I think. A developer's first thought upon meeting a challenge (something the standard library or framework doesn't have) should not be "where can I find something that does that?", but instead "can I do that myself?" If you can't do it yourself, fine, look for something ready-made*, but you have to remember that eventually you may find yourself in a situation where no one has gone before and you will have to do it yourself. Will you have allowed your development skills to atrophy? Or will your skills still be sharp from frequent use in many challenging situations? Be a developer! * And read the code! Learn from it! Don't just use it; can you take the technique and develop a better or more suitable solution?
Oh, they do that on CP too?! ;P Well, I personally suffer from what should I bother learn this 10 class API when I could write my own class to do it!! In fact everybody like my IoC / ServiceProvider / MEF clone here at work! ;P (under less than 739 lines of code)
All in one Menu-Ribbon Bar DirectX for WinRT/C# since 2013! Taking over the world since 1371!
-
Oh, they do that on CP too?! ;P Well, I personally suffer from what should I bother learn this 10 class API when I could write my own class to do it!! In fact everybody like my IoC / ServiceProvider / MEF clone here at work! ;P (under less than 739 lines of code)
All in one Menu-Ribbon Bar DirectX for WinRT/C# since 2013! Taking over the world since 1371!
You should write an article on CP about it!
Decrease the belief in God, and you increase the numbers of those who wish to play at being God by being “society’s supervisors,” who deny the existence of divine standards, but are very serious about imposing their own standards on society.-Neal A. Maxwell You must accept 1 of 2 basic premises: Either we are alone in the universe or we are not alone. Either way, the implications are staggering!-Wernher von Braun
-
Hear! Hear! Haven't I railed against that culture here on CP several times in the past? And of course had others scoff in response, something about reinventing the wheel I think. A developer's first thought upon meeting a challenge (something the standard library or framework doesn't have) should not be "where can I find something that does that?", but instead "can I do that myself?" If you can't do it yourself, fine, look for something ready-made*, but you have to remember that eventually you may find yourself in a situation where no one has gone before and you will have to do it yourself. Will you have allowed your development skills to atrophy? Or will your skills still be sharp from frequent use in many challenging situations? Be a developer! * And read the code! Learn from it! Don't just use it; can you take the technique and develop a better or more suitable solution?
PIEBALDconsult wrote:
A developer's first thought upon meeting a challenge (something the standard library or framework doesn't have) should not be "where can I find something that does that?", but instead "can I do that myself?"
Have to disagree here I'm afraid. If the problem is trivial then yes, that's a good attitude. If, however, it's going to take you six months to implement and you are writing this for a commercial product then you should probably look to the ready made version that ticks all the boxes as far as the functionality you need.
This space for rent
-
PIEBALDconsult wrote:
A developer's first thought upon meeting a challenge (something the standard library or framework doesn't have) should not be "where can I find something that does that?", but instead "can I do that myself?"
Have to disagree here I'm afraid. If the problem is trivial then yes, that's a good attitude. If, however, it's going to take you six months to implement and you are writing this for a commercial product then you should probably look to the ready made version that ticks all the boxes as far as the functionality you need.
This space for rent
Definitely with you on this one Pete. Hopefully there is happy middle ground between 10 line "packages" and 20000 line frameworks somewhere.
"If you don't fail at least 90 percent of the time, you're not aiming high enough." Alan Kay.
-
PIEBALDconsult wrote:
A developer's first thought upon meeting a challenge (something the standard library or framework doesn't have) should not be "where can I find something that does that?", but instead "can I do that myself?"
Have to disagree here I'm afraid. If the problem is trivial then yes, that's a good attitude. If, however, it's going to take you six months to implement and you are writing this for a commercial product then you should probably look to the ready made version that ticks all the boxes as far as the functionality you need.
This space for rent
Agreed, but I have to wonder why so many projects took this on as a dependency:
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;
}TTFN - Kent
-
Agreed, but I have to wonder why so many projects took this on as a dependency:
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;
}TTFN - Kent
Because... because... it's javascript. :)
-
Agreed, but I have to wonder why so many projects took this on as a dependency:
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;
}TTFN - Kent
They didn't. Most of those guys took a dependency on Babel-core, a rather large library. Babel-core took a dependency on a small package called line-numbers that, of all things, auto-numbers lines of text, keeping them aligned. line-numbers is the one who took a dependency on left-pad.
-
They didn't. Most of those guys took a dependency on Babel-core, a rather large library. Babel-core took a dependency on a small package called line-numbers that, of all things, auto-numbers lines of text, keeping them aligned. line-numbers is the one who took a dependency on left-pad.
But at the end, someone took a dependency on a glorified function call. I'm not blaming the people at the top (gulp, Babel-core, etc.), but the guy that decided, "I'm just not up for writing 10 lines of code today, I'll trust this guy to never break this."
TTFN - Kent
-
But at the end, someone took a dependency on a glorified function call. I'm not blaming the people at the top (gulp, Babel-core, etc.), but the guy that decided, "I'm just not up for writing 10 lines of code today, I'll trust this guy to never break this."
TTFN - Kent
True, but at the end of the day, it's only one guy who made that mistake. The guy who wrote line-numbers. But then, line-numbers itself is only 35 lines of code. Add in the aforementioned 17 and now he has a 52 line package. Is that small enough to inline, or not? And how many lines does it take? That's really where I was coming from. Yes you can point to this one guy in this one situation, but in reality, there is no good answer. Because if we decide that 52 line libraries are OK, then what happens when the maintainer for line-numbers decides to melt down and yank his library? Babel-core and gulp are still hosed. NPM needs to do the same thing that every other package manager does: You can only "un-publish" insofar as it hides your package from searches and new dependencies. Packages that had an existing dependency still keep that, and can still access your now-hidden package.
-
True, but at the end of the day, it's only one guy who made that mistake. The guy who wrote line-numbers. But then, line-numbers itself is only 35 lines of code. Add in the aforementioned 17 and now he has a 52 line package. Is that small enough to inline, or not? And how many lines does it take? That's really where I was coming from. Yes you can point to this one guy in this one situation, but in reality, there is no good answer. Because if we decide that 52 line libraries are OK, then what happens when the maintainer for line-numbers decides to melt down and yank his library? Babel-core and gulp are still hosed. NPM needs to do the same thing that every other package manager does: You can only "un-publish" insofar as it hides your package from searches and new dependencies. Packages that had an existing dependency still keep that, and can still access your now-hidden package.
Vark111 wrote:
NPM needs to do the same thing that every other package manager does: You can only "un-publish" insofar as it hides your package from searches and new dependencies. Packages that had an existing dependency still keep that, and can still access your now-hidden package.
Completely agree. It's the only way this house of cards Can be sustained. Just saw this: Your “just” considered harmful — Medium[^] come through my RSS this morning. IMO it's yet another example of a potential problem with the current "share everything/trust people not to be jerks" model.
TTFN - Kent
-
NPM &# left-pad: Have We Forgotten How To Program? | Haney Codes .NET[^] Oh... I found a package that convert object to string, *must* depend on it!
All in one Menu-Ribbon Bar DirectX for WinRT/C# since 2013! Taking over the world since 1371!
It also amazes me that there are 52 forks of this, um, "code." Really? People needed to fork this code to tweak it for their own use? I wouldn't even bother to search for a package that does leftpad. But then again, I use C#, which, oh look, already has a String.LeftPad()[^] method. Maybe people ought to start using real programming languages. The open source programming community really has gone to hell in a handbasket. [edit]Need proof? Just look at the various implementation suggestions on SO[^] [/edit] Marc
Imperative to Functional Programming Succinctly Contributors Wanted for Higher Order Programming Project!
-
NPM &# left-pad: Have We Forgotten How To Program? | Haney Codes .NET[^] Oh... I found a package that convert object to string, *must* depend on it!
All in one Menu-Ribbon Bar DirectX for WinRT/C# since 2013! Taking over the world since 1371!
-
It also amazes me that there are 52 forks of this, um, "code." Really? People needed to fork this code to tweak it for their own use? I wouldn't even bother to search for a package that does leftpad. But then again, I use C#, which, oh look, already has a String.LeftPad()[^] method. Maybe people ought to start using real programming languages. The open source programming community really has gone to hell in a handbasket. [edit]Need proof? Just look at the various implementation suggestions on SO[^] [/edit] Marc
Imperative to Functional Programming Succinctly Contributors Wanted for Higher Order Programming Project!
How many are real forks vs I-clicked-the-wrong-button-in-githubs?
Did you ever see history portrayed as an old man with a wise brow and pulseless heart, waging all things in the balance of reason? Is not rather the genius of history like an eternal, imploring maiden, full of fire, with a burning heart and flaming soul, humanly warm and humanly beautiful? --Zachris Topelius Training a telescope on one’s own belly button will only reveal lint. You like that? You go right on staring at it. I prefer looking at galaxies. -- Sarah Hoyt