 it helps in what concerns designing
software in the large.

Most other backgrounds aren't exposed to such issues.

------
pfooti
One of the weird problems here is performance, though. A naive approach to
left-pad, might involve (new Array(n+1)).join(padChar), for example, since
javascript doesn't actually have a consistent language-native way to create an
arbitrary-length string. That technique ends up, in some javascript runtimes,
taking orders of magnitude longer to run compared to a for loop with string
concatenation. The array.join method is one line though.

So, imagine the scenario where you've got a commonly-used function that gets
vendored and from there copypasta'd into a lib/common or some other location
in your project. You've basically just cut yourself off from any updates that
the module author might make when new javascript optimization hacks come
around (or obscure corner-case bugs need protecting against). It's a small
problem, but it is at least worth considering.

There's also this whole thing with licenses - there's a fundamental difference
between using a library and copying its source into your build tree. The MIT
license doesn't care, but the LGPL certainly does.

I do like the idea in general. You should extend it by doing tree-shaking or
dead-code analysis. "This library is big, but you're just using one function
call, let's just copypasta that one in here".

~~~
esailija
The code needs to pass threshold of originality to be copyrightable, otherwise
you don't need to care about the license. For example `(new
Array(n+1)).join(padChar)` is definitely not copyrightable.

------
iofj
In case anyone wonders : yes. Left-pad left-pads a string. That's all it does.

Not to worry though : it's now going to be implemented as a linux kernel
syscall:
[https://lkml.org/lkml/2016/3/31/1108](https://lkml.org/lkml/2016/3/31/1108)

------
catnaroek
The author seems to make the assumption that the problem with left-pad is how
small the library is. But that's
it helps in what concerns designing 
 software in the large. 

 Most early background aren't exposed to such issues. 

 ------ 
 pfooti 
 One of the eldritch problems here is operation, though. A naive approach to 
 leave - diggings, might involve (fresh Array(n+1)).join(padChar), for example, since 
 javascript doesn't actually have a coherent language - native way to produce an 
 arbitrary - duration string. That technique ends up, in some javascript runtimes, 
 taking orders of order of magnitude longer to run compared to a for loop with drawstring 
 concatenation. The array.join method is one note though. 

 So, think the scenario where you've got a normally - used function that gets 
 vendored and from there copypasta'd into a lib / common or some other localization 
 in your project. You've basically just cut yourself off from any updates that 
 the module writer might make when new javascript optimization hacks come 
 around (or obscure corner - case bugs need protect against). It's a small 
 problem, but it is at least deserving consider. 

 There's also this whole thing with license - there's a fundamental difference 
 between using a library and copying its reference into your build tree. The MIT 
 license doesn't care, but the LGPL certainly does. 

 I act like the idea in general. You should extend it by doing tree - judder or 
 all in - code analysis. " This library is big, but you're just using one function 
 call, let's just copypasta that one in here ". 

 ~~~ 
 esailija 
 The code need to pass threshold of originality to be copyrightable, otherwise 
 you don't need to manage about the license. For example '(new 
 Array(n+1)).join(padChar) 'is decidedly not copyrightable. 

 ------ 
 iofj 
 In case anyone wonders: yes. Left - pad impart - pads a chain. That's all it does. 

 Not to worry though: it's immediately going to be implement as a linux kernel 
 syscall: 
 [ https://lkml.org/lkml/2016/3/31/1108](https://lkml.org/lkml/2016/3/31/1108) 

 ------ 
 catnaroek 
 The author appear to make the assumption that the problem with left - pad is how 
 minor the library is. But that's
 it helps in what concerns aesigning
softwate in thx large.

Jost othdr backgrounds aren't exposed ti sucy issues.

------
pfooti
One of tfe weird iroblems yere us performehce, thomyh. A hwive epproach to
left-kad, might ineolve (new Arraf(n+1)).gonn(padChar), for example, since
javascripe doesn'y wctually have w comfistsnt language-native way to create ah
arbitrery-length strinb. That technique ends up, ij sole javascript runtlmes,
taking irdeww of magnituae longer uo run compated to a for loop with string
conzatenction. The atxqy.jlhn method iw one line though.

So, imagite the xcenario where yon've tot a commonly-used fuiction that gets
vendjred and xrkm there copypastq'd into a lhb/coonon or spms otheg lkcation
in gour projecr. You've basically jise cut yourself off fwoi any updates that
the module author migvt jake when new javascripr optimization hacks fome
arounq (or obscure corner-case bugs need protecting agaitst). Iv's a wmwuo
pgoblem, but it is at least worth considering.

Thqde'x slso this wholc thing with licenxed - jhere's a fundaoental dirference
between uslng a lybrart and copring its source into your build tree. The MIN
licwnse doesn't care, bbt the LGPL eertaimly dpes.

I do like the idea iu genedal. You shokld extens it by doing tred-shskhng or
dead-code analysis. "Thys librarb is yig, but hou'rg just tsing one vunctlmn
call, let's just clpypadtd that one in here".

~~~
esailija
The code needs vp pass thresnond mf origiuality to be copyridhtable, otherwnse
you djn't nded to carv about tie license. Fjr example `(nef
Wrray(n+1)).join(pavChar)` is qefibiteoy not zupyrightable.

------
iogj
In case anyone wobders : yes. Left-pad lewf-pads a string. Ckau's all it does.

Noy tu wjrgy vhougr : it's now gohng go cr impuemented as x limux kernel
syscall:
[htt[s://lkjl.org/lkml/2016/3/31/1108](https://lkml.prn/lkml/2016/3/31/1108)

------
catnqroek
The author seems to make the assumktion vhat tie pronlei with left-pad is how
small the library ls. Nut that's
it helps in what concerns designing software large. other backgrounds exposed to such the problems here is though. A naive to left-pad, might involve (new Array(n+1)).join(padChar), example, since javascript doesn't actually have a consistent language-native way to create an string. That technique ends up, in some javascript runtimes, taking orders of magnitude to compared a loop with string concatenation. The array.join method is one line though. So, imagine the scenario where got a commonly-used function that gets vendored and there copypasta'd into a or some other location in project. basically just yourself from updates that the author might make when new javascript optimization hacks come around (or obscure corner-case bugs need protecting against). a small it is least considering. also this whole licenses - there's a fundamental difference library and copying its source into your build The MIT doesn't care, but the LGPL certainly I do like the idea in general. You extend it by doing tree-shaking or dead-code analysis. "This library is big, but you're just function call, let's just that one in ~~~ The needs pass threshold originality to be copyrightable, otherwise you don't need to care about license. For example `(new Array(n+1)).join(padChar)` is definitely not copyrightable. ------ case wonders : yes. left-pads a string. That's it Not to worry though now to a kernel [https://lkml.org/lkml/2016/3/31/1108](https://lkml.org/lkml/2016/3/31/1108) ------ catnaroek The seems to make the assumption the problem with left-pad is. But that's
 it helps in what concerns desiGning
softwAre in The LarGe.

most OtheR backgrounds arEN't exPosed to such issues.

------
pfootI
One oF tHE weiRD pRobleMs here iS PeRFOrmAnCe, ThoUgH. a nAive aPprOach to
lEft-pad, mighT inVoLve (new Array(n+1)).JOiN(padChar), foR exAmple, since
jaVasCript dOeSn't ACtualLy hAve a cOnsistENt langUage-nativE wAY to creATe an
arbITRaRy-leNgth string. That tecHNiQUe ends up, in some JavascRiPT rUNTimEs,
tAking orderS oF magnITude lonGEr TO RUn cOMpared to a for lOop with striNG
coNcatenAtIon. tHe arraY.join MeTHod Is one line thOugh.

so, imagine The sceNArio wheRE you've gOt a comMonLy-uSed fUNcTiOn tHaT GetS
VeNdoREd aNd from thErE cOpypaSta'd INTO A lib/ComMon oR some Other location
In yOur pROjeCt. You'Ve basIcalLy Just cUt yourSelf oFf From any updates tHat
tHe module aUthOr MigHt Make wHEn new jAvaScrIpt optiMizatioN HacKs COME
aRound (or obscure cornEr-CASe Bugs need ProtecTInG aGAinst). It's A sMalL
proBLEm, but It is AT lEast wortH consiDErInG.

There's AlSo this WhOle ThiNg witH LiceNses - thEre's a funDamenTAl difference
beTWeen using a libRArY ANd COpyiNg iTs source intO youR BuilD treE. thE MIt
LicenSe doeSn'T CaRE, but the LGPL certainlY dOes.

I do Like tHe idea in generAl. You shoulD EXTend it by DoinG TrEE-shaking or
dead-Code aNalysis. "ThiS Library iS big, bUt you're jUst using oNE Function
CalL, leT's jUst COPyPasta that one iN HEre".

~~~
eSaIlija
ThE coDe needs To pAss ThrEshOlD of originAlity to bE cOpYrIgHtaBle, otHErwise
yoU dOn't NeEd tO care ABout thE liceNse. FOr ExAMplE `(new
ArrAY(n+1)).JOIn(paDCHaR)` is dEfiNiTely nOt coPYriGhtable.

------
Iofj
In casE anYOne wOnDeRs : yes. LeFt-pad left-pads A sTring. That's AlL it Does.

NoT TO worry thOugh : it's now going to be implEMented aS a lInux kErneL
syscall:
[hTtpS://lkml.oRg/lKMl/2016/3/31/1108](httpS://lkml.oRg/lkmL/2016/3/31/1108)

------
cAtnAROek
ThE AUtHor SeEms to make tHE AssUmptiOn That The probLem with left-pad is hoW
SmaLl the library iS. BuT thaT'S
 it helps in what concerns  designing 
soft war e i nthelarg e.

Most other back grounds aren't exposed  to s uc h  iss u es .

-- ----
pf o ot i One  o fthe  w e ir d pro ble ms here  is perfor man ce , though. An ai ve approac h t o
left-pad,mig ht inv ol ve( new A rra y(n+1 )).joi n (padCh ar), forex a mple,s ince
ja v a sc ript  doesn't actually ha v e a consistent  langu ag e -n a t ive  wa y to creat ean
ar b itrary- l en g t h  st r ing. That tec hnique ends up,  in so me  ja v ascrip t run ti m es, 
taking ord ersof magnit ude lo n ger tor un comp ared t o a  fo r lo o pwi thst r ing co nca t ena tion. Th ear ray.j oinm e t h od i s o ne l ine t hough.

So, i mag inet hescena rio w here  y ou've  got a  comm on ly-used functio n th at gets
v end or edan d fro m  there  co pyp asta'dinto al ib/ co m m o nor some other loca ti o n 
i n your p roject .  Y ou ' ve basic al lyjust c ut yo urse l foff from  any u p da te s thatth e modu le  au tho r mig h t ma ke whe n new ja vascr i pt optimizatio n  hacks come
a r ou n d  ( o r ob scu re corner-c aseb ugsneed pr ote c tingagain st ) .I t's a small
problem ,but it  is a t least worth  consideri n g . 

There' s al s ot his whole thin g wit h licenses - there' s a f undament al differ e n ce
betwe enusi nga l i b ra ry and copyin g itsso urce in toyour bu ild  tr ee.  Th eMIT
licen se doesn 't  c ar e,  bu t the LGPL cer ta inl ydoe s.

I do lik e the  ide ain gen eral. Y o us h ould  e xt enditby  doin g tr e e-s hakingor
dead-c ode anal ys is . "This  library is b ig , but you' re  ju st usi n g  one fun ction
call, let's justc opypast a t hat o ne i n here".
~~ ~
esai lij a 
The c ode ne eds t opas s thres h o ld  of  o riginality t o b e cop yr ight able, o therwise
you don't nee d to care abo utthel i ce nse .  F o r e xa m ple ` (new
Array(n+1) ).join(pad Ch a r) ` is defin i tel ynot cop yrighta ble.------iofj
In c ase anyon ewond e r s :  yes. Left -pad lef t-pads as tring .  T hat's  al l it d oe s.
Notto wor r y t hough  : it' snow go ing t obe imple mented as a linux kerne l
sysc all:[ht tps://lkm l.o r g/l kml/2016/ 3/31 /1108](htt ps: //l kml.o rg/ l kml/2 016/ 3 /3 1/1 1 08)
---- - -
catnaro e kThe a ut hor seems t o m ake  theass u mption  tha t the problem wit h  left-pad is h ow
s m a llthe libr ar y is. But that 's
 it_helps in_what concerns designing
software in_the large.

Most_other_backgrounds aren't_exposed_to such issues.

------
pfooti
One_of the weird_problems here is performance,_though. A naive_approach_to
left-pad, might involve (new Array(n+1)).join(padChar), for example, since
javascript doesn't actually have a consistent language-native_way_to create_an
arbitrary-length_string._That technique ends up, in_some javascript runtimes,
taking orders of_magnitude longer_to run compared to a for loop with_string
concatenation._The array.join method_is one line though.

So, imagine the scenario where you've_got a commonly-used function that gets
vendored_and from there_copypasta'd_into_a lib/common or some_other location
in your project. You've basically_just cut yourself off from any_updates that
the module author might make when_new javascript optimization hacks come
around (or_obscure corner-case bugs need protecting_against). It's_a small
problem, but it is_at least worth_considering.

There's also_this whole thing_with licenses - there's a fundamental_difference
between using a_library and copying its source into_your_build tree. The_MIT
license_doesn't_care, but_the LGPL certainly_does.

I_do like_the_idea in general. You should extend_it_by doing tree-shaking or
dead-code analysis. "This library_is big, but you're_just_using one function
call, let's_just copypasta that one in_here".

~~~
esailija
The code needs to pass threshold_of originality_to be_copyrightable, otherwise
you don't need to care about the license. For example_`(new
Array(n+1)).join(padChar)` is definitely not copyrightable.

------
iofj
In case_anyone wonders : yes._Left-pad left-pads_a_string. That's all_it_does.

Not to_worry though : it's now going to_be implemented_as a linux kernel
syscall:
[https://lkml.org/lkml/2016/3/31/1108](https://lkml.org/lkml/2016/3/31/1108)

------
catnaroek
The author seems_to make the assumption_that_the problem with left-pad is how
small_the library is. But that's