Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Pixelboy
Sep 13, 2005

Now, I know what you're thinking...

I'd start making plans to escort people out the door if they depended on this nonsense.

Adbot
ADBOT LOVES YOU

OddObserver
Apr 3, 2009

Heh. I think I can actually break that 1-line function, though it's surprisingly tough --- that requires messing up
Function.prototype.call, which will pretty much will make everything explode. But then, if you're not doing anything
that level of stupid, the function doesn't seem any better than "foo instanceof Array"
(Me, I am a fan of foo instanceof [].constructor, of course!)

Edit: I guess the "library" approach is better if one is doing cross-frame function calls. Yes, instanceof Array would return false
on arrays from a different Window. This the coding horrors thread, right?

OddObserver fucked around with this message at 03:02 on Mar 24, 2016

TheresaJayne
Jul 1, 2011

Internet Janitor posted:

If you use a CLI unpacker, archives that don't contain a top level folder can very easily explode their files into the current directory and make a mess when you blindly say "extract all". If you use a GUI unpacker you're less likely to make this mistake. Whether you care or not probably predicts which type of tools you use.

I hate the ones that have the root folder in there as I always right click and select unpack to ./archivename

Dylan16807
May 12, 2010
https://gist.github.com/rauchg/5b032c2c2166e4e36713

require-from-twitter posted:

Since Twitter doesn't have an edit button, it's a suitable host for JavaScript modules.

sunaurus
Feb 13, 2012

Oh great, another bookah.
http://left-pad.io/

qntm
Jun 17, 2009

code:
>curl -k "https://api.left-pad.io/?str=foo&len=4&ch=bar"
{"str":"barfoo"}

Hammerite
Mar 9, 2007

And you don't remember what I said here, either, but it was pompous and stupid.
Jade Ear Joe
That NPM stuff seems like someone heard "don't reinvent the wheel" and decided to run with it (and run with it, and run with it).

substitute
Aug 30, 2003

you for my mum
Working on a new project with the ERP team to get customer data out on website for them.

Example column names from a data dump:

code:
bill_to_customer_number
bill_cust_name
bill_cust_add1
bill_cust_add2
bill_cust_add3
bill_cust_add4
bill_city
bill_state
bill_country
bill_zip
bill_to_cust_note

ship_to_customer_number
ship_cust_name
ship_cust_add1
ship_cust_add2
ship_cust_add3
ship_cust_add4
ship_city
ship_state
ship_country
ship_zip
ship_to_notes
:thumbsup: for that consistency.

Space Kablooey
May 6, 2009


Hammerite posted:

That NPM stuff seems like someone heard "don't reinvent the wheel" and decided to run with it (and run with it, and run with it).

Which isn't a bad thing in on itself, but now you have modules that are one-liners and that's completely ridiculous.

Hughlander
May 11, 2005

necrotic posted:

This actually happened already because of this fiasco. Though this looks like someone simply botched the publishing mechanism instead of pushing something nefarious.

http://www.drinchev.com/blog/alert-npm-modules-hijacked/

The idea that released packages aren't immutable and irrevocable ("delisting" is fine) is absolutely insane for a package management provider.

Best part is the TempleOS guy chiming in.

dwazegek
Feb 11, 2005

WE CAN USE THIS :byodood:
I love how that is-positive-integer module imports a module in order to a logical AND between two boolean expressions. Which in turn imports a number of modules, one of which is a module to do a logical AND between two booleans.

Hammerite
Mar 9, 2007

And you don't remember what I said here, either, but it was pompous and stupid.
Jade Ear Joe

HardDisk posted:

Which isn't a bad thing in on itself, but now you have modules that are one-liners and that's completely ridiculous.

Well that's what I mean, not reinventing the wheel is a good principle but you have to balance it against other considerations, not just totally ignore everything else and take it to an absurd extreme.

Ika
Dec 30, 2004
Pure insanity

dwazegek posted:

I love how that is-positive-integer module imports a module in order to a logical AND between two boolean expressions. Which in turn imports a number of modules, one of which is a module to do a logical AND between two booleans.

Well, we wouldn't want to do any premature optimization would we? That is ridiculous.

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

dougdrums posted:

web developers who want to be "systems programmers" but not actually learn anything about how a computer works.

Every day I spend a few minutes worried that this is me.

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

Hammerite posted:

That NPM stuff seems like someone heard "don't reinvent the wheel" and decided to run with it (and run with it, and run with it).

It makes sense in browser dev world where everything you do could be broken in some weird version of opera/chrome/ie/ff and you want your left pad function to be written by someone who has taken the time to understand and test these things.

not that it's true in this case, but js world is definitely a place where simple things can break in weird ways.

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

Yeah, I sometimes find myself looking for a npm library to do a somewhat simple thing just because I'm not sure I can account for all of the browser quirks.

I mean, I wouldn't for a 1 line function...but maybe I would for a 20-30 line function that has lots of contributors in the hope that OSS will save me from having to figure out how 20 different browsers do...whatever.

brap
Aug 23, 2004

Grimey Drawer
Beyond just polyfills I think people worry too much about js quirks across browsers. What will really gently caress you over are CSS quirks.

tyrelhill
Jul 30, 2006

xzzy posted:

In summary, everyone involved was a dipshit, ignore NPM forever. End of lesson.

Seriously, I would never risk any real project on the chance that some external dipshit can gently caress it up just cause his feelings were hurt.

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

The thing about NPM and node is that the module is the basic unit of program composition. Where you might copy and paste a helper class (or bit-banging macro) from somewhere in another environment, in node/NPM you're expected to deal with it as a module, and then by induction basically you get this mess where the module package metadata outweighs the code by a factor of 30 and you have more 3rd-party points of failure than you can count.

Hammerite
Mar 9, 2007

And you don't remember what I said here, either, but it was pompous and stupid.
Jade Ear Joe

MALE SHOEGAZE posted:

It makes sense in browser dev world where everything you do could be broken in some weird version of opera/chrome/ie/ff and you want your left pad function to be written by someone who has taken the time to understand and test these things.

not that it's true in this case, but js world is definitely a place where simple things can break in weird ways.

That makes perfect sense, but not when you get to the point where you're implementing a "library" that just &&s two things. At that point it seems safe to say that people have lost sight of the original purpose of having small modules and it's just a thing that they are doing for the sake of it.

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

Hammerite posted:

That makes perfect sense, but not when you get to the point where you're implementing a "library" that just &&s two things. At that point it seems safe to say that people have lost sight of the original purpose of having small modules and it's just a thing that they are doing for the sake of it.

Yeah absolutely. The current state of npm is like if someone was trying to make a hyperbolic argument against using libraries except it's no longer hyperbole.

Kazinsal
Dec 13, 2011

Someone wrote an npm package that implements leftpad() by querying left-pad.io.

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

fleshweasel posted:

Beyond just polyfills I think people worry too much about js quirks across browsers. What will really gently caress you over are CSS quirks.

This is probably true, but just like it's too much effort to figure out how to make something work across all browsers, it's too much effort to make sure something does work across all browsers!

(I mean, too much effort for me and the type of projects I normally do.)

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
Input events are still a huge mess cross-browser, that will never get cleaned up, because too much code has old compatibility hacks.

TooMuchAbstraction
Oct 14, 2012

I spent four years making
Waves of Steel
Hell yes I'm going to turn my avatar into an ad for it.
Fun Shoe

Suspicious Dish posted:

Input events are still a huge mess cross-browser, that will never get cleaned up, because too much code has old compatibility hacks.

Clearly the solution here is to do away with Javascript as a content tool and switch to Flash.

(:v:)

Soricidus
Oct 21, 2010
freedom-hating statist shill
Let's face it, it's time to give Java applets a second chance.

MisterZimbu
Mar 13, 2006
Let's give Silverlight a first one.

Deep Dish Fuckfest
Sep 6, 2006

Advanced
Computer Touching


Toilet Rascal

Soricidus posted:

Let's face it, it's time to give Java applets a second chance.

Great, you've just made all of the security people reading this thread die of an aneurysm.

Polio Vax Scene
Apr 5, 2009



MisterZimbu posted:

Let's give Silverlight a first one.

I think I just felt my blood pressure spike.

xzzy
Mar 5, 2009

lua.. that's the current darling of embedded scripting languages, right?

Internet Janitor
May 17, 2008

"That isn't the appropriate trash receptacle."

MisterZimbu posted:

Let's give Silverlight a first one.

I would unironically rather build UIs in a cut-down version of WPF than in Swing, Qt or CSS/HTML.

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder
include a mirror of npm in all browsers

TooMuchAbstraction
Oct 14, 2012

I spent four years making
Waves of Steel
Hell yes I'm going to turn my avatar into an ad for it.
Fun Shoe

xzzy posted:

lua.. that's the current darling of embedded scripting languages, right?

Lua's been around for ages. Nearly fifteen years ago I was working on a C++ program with embedded Lua scripting.

It's popular because it has a small footprint and it's fairly easy to get the right hooks set up.

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed
Language-wise Lua is just JS minus the big WTFs and plus some small WTFs. The only reason to use it over JS is for implementation-quality reasons, so using it in browsers wouldn't really change anything.

Doc Hawkins
Jun 15, 2010

Dashing? But I'm not even moving!


MALE SHOEGAZE posted:

include a mirror of npm in all browsers

That may not be far off; the IPFS project has been trying to implement an npm mirror, and Joe Armstrong has been talking about content-addressed modules for a few years now.

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
IPFS is bitcoin but without any incentives for people to run nodes, right

Steve French
Sep 8, 2003

https://github.com/jezen/is-thirteen/issues

Hammerite
Mar 9, 2007

And you don't remember what I said here, either, but it was pompous and stupid.
Jade Ear Joe

Suspicious Dish posted:

IPFS is bitcoin but without any incentives for people to run nodes, right

I thought bitcoin was bitcoin but without any incentive for people to run nodes

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe

Hammerite posted:

I thought bitcoin was bitcoin but without any incentive for people to run nodes

nah, the incentive to run nodes is fake trading volume allowing people in china to exchange their crumbling yuan for silicon valley vc cash.

Adbot
ADBOT LOVES YOU

Pixelboy
Sep 13, 2005

Now, I know what you're thinking...

Plorkyeran posted:

Language-wise Lua is just JS minus the big WTFs and plus some small WTFs. The only reason to use it over JS is for implementation-quality reasons, so using it in browsers wouldn't really change anything.

Just so I know what column to put you in, do you consider 1-based arrays to be a small or big WTF?

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply