전문 인터넷 중독자 • 게임 애호가 • 기술 창작자
전문 인터넷 중독자 • 게임 애호가 • 기술 창작자

아니요, 우리는 코딩하는 방법을 잊지 않았습니다. JavaScript가 더 좋아져야 합니다.

NPM 패키지 "left-pad"가 제거되자 전 세계 수백만 개의 애플리케이션이 다운되었습니다. 그런데 이 패키지는 왜 존재하는 걸까요?
이 페이지는 여러분의 편의를 위해 열정적인 AI 인턴들이 영어에서 번역한 것입니다. 아직 학습 중이므로 몇 가지 오류가 있을 수 있습니다. 가장 정확한 정보는 영어 버전을 참조하세요.
블로그 아니요, 우리는 코딩하는 방법을 잊지 않았습니다. JavaScript가 더 좋아져야 합니다.

이 블로그 게시물은 2016년 3월에 게시되었으므로, 읽는 시점에 따라 일부 내용이 최신이 아닐 수 있습니다. 안타깝게도 정보의 정확성을 보장하기 위해 게시물을 항상 최신 상태로 유지하는 것은 어렵습니다.

    I don't usually write opinionated blog articles. So if don't agree with me, please remember these are my personal opinions and I would love to hear your own opinion.

    A quick summary of the npm chaos

    There has been a lot of drama the last couple of days in the npm community, triggered by Azer Koçulu who had a dispute with the company Kik Interactive over who should have access to the npm package named "Kik" - the developer who first published the package with his open source project, or the world wide company who has an 240 million user application called "Kik Messenger".
    Without any lawyers being involved, it ended with npm seized controlled and transferred over the package name to "Kik" to Kik Interactive. In retaliation of the decision, Azer unpublished all of his 273 modules from npm. Among them was package called left-pad. A package with millions of downloads per month and thousands of projects relies on, breaking every single of them and creating chaos. In order to try and save the situation, npm took control over the left-pad package and un-unpublished it.

    The aftermath of opinions and the insults to us JavaScript developers

    The left-pad package is actually, what is refereed to, a "micro-package" since it is only 11 rows of source code that offers only one functionality; pads the left side of a String with any given character, until a given length is reached.
    However, after this incident there has been a lot of drama, blogs, opinions and statements thrown around such as if we JavaScript developers have forgotten how to code since micro-packages such as left-pad exists.
    The truth is; No, we haven't forgotten how to code.
    On the contrary actually, I would say that we JavaScript developers are probably more experienced with crazy, unexpected, non-consistent results which we constantly have to overcome, since our single written source code is often executed on different environments and browsers.
    Our code is not compiled specifically for a deterministic platform, nor is it always executed on deterministic run-time systems as other languages are. I see us JavaScript developers as hurdle-runners where every 30 seconds we need to jump over a new obstacle.

    A quick summary of the npm chaos

    I will be very straightforward and honest here.
    Micro-packages such as left-pad (but you can also include famous libraries such as Underscore, Lodash and Rambda, and even frameworks such as jQuery, and other types of polyfills) are necessary evils in a JavaScript developer's work. We don't like to use them, but we have to. And it's silly that we web developers should spend time to recreating basic wheels instead of focusing on creating high level solutions.
    The only reason why the package left-pad exists, is because the JavaScript language itself is fundamentally flawed and the core APIs is a mess compared to other programming languages.
    So without these micro-packages other polyfills in our toolbox, our work becomes really painful.
    A JavaScript developer without their toolbox
    Another example is that if you are one of those lucky web developers that still needs to support Internet Explorer 9, it means that you you are confined within the rules of EcmaScript 5. This means that if you want to figure out if String contains another String, you need to write:
    if( haystack.indexOf(needle) !== -1 ) { ... }
    Compared to:
    if( haystack.indexOf(needle) !== -1 ) { ... }
    A core API such as String.includes (or String.contains) existed in almost all major programing languages since day 1, but not for JavaScript. That specific API literally was added 18 years after the language was first released, as part of the EcmaScript 6 specification. And this is just one of many examples of basic code APIs that doesn't exist in JavaScript compared to other languages.

    JavaScript is a necessary evil that requires time to improve

    I have never met anyone who has ever said they actually like the JavasScript language and its core APIs. They might like functional programming, the idea of functions are first class citizens and its loosely typed, but never the language itself. JavaScript is actually a language that we are forced to deal whether we like it or not.
    However the process of improving and progressing EcmaScript is not easy though. It is almost like, I assume, building the International Space Station. It's a project where multiple countries needs to sign off and where each country has its own prioritization and budgets to achieve the greater goal. A process like this takes time and the chain will never be as strong as its weakest link.
    International Space Station
    So no, we haven't forgotten how to code. The JavaScript language just needs to become a better language.

    Special Agent Squeaky님이 작성했습니다. 최초 게시일 2016년 3월 25일. 최종 업데이트일 2016년 3월 25일.

    📺 스퀴키의 최신 영상을 시청하세요!

    라이브 스트림에 간단한 실시간 자막을 추가하는 방법