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
Zamujasa
Oct 27, 2010





Bread Liar

DaTroof posted:

i'd feel like an rear end in a top hat showing someone my npm package that imports a single ansi color. wtf

quote:

Related projects
ansi-reset
ansi-bold
ansi-dim
ansi-italic
ansi-underline
ansi-inverse
ansi-hidden
ansi-strikethrough
ansi-black
ansi-red
ansi-green
ansi-yellow
ansi-blue
ansi-magenta
ansi-cyan
ansi-white
ansi-gray
ansi-grey
ansi-bgblack
ansi-bgred
ansi-bggreen
ansi-bgyellow
ansi-bgblue
ansi-bgmagenta
ansi-bgcyan
ansi-bgwhite

why show one when you can show them all

Adbot
ADBOT LOVES YOU

Achmed Jones
Oct 16, 2004





rotor posted:

cobra farms but for lovely single-liner js packages

im gonna need to hear more about this analogy

DaTroof
Nov 16, 2000

CC LIMERICK CONTEST GRAND CHAMPION
There once was a poster named Troof
Who was getting quite long in the toof


rotor posted:

what I mean is that the 'ansi-red' package and left-pad and all the others are predictable outcomes of someone whose career is incentivized to have popular open source projects

cobra farms but for lovely single-liner js packages

i don't get the cobra farms reference but i don't think i disagree with you either

if "npm package with a zillion downloads" looks good on a resume to anyone at all, there are people who will optimize for it

rotor
Jun 11, 2001

Official Carrier
of the Neil Bush Torch

 
 
 
 
teh butts


its shorthand for "perverse incentives"

https://en.wikipedia.org/wiki/Perverse_incentive#The_original_cobra_effect

quote:

The term cobra effect was coined by economist Horst Siebert based on an anecdote of a (possibly ahistorical) occurrence in India during British rule.[2][3][4] The British government, concerned about the number of venomous cobras in Delhi, offered a bounty for every dead cobra. Initially, this was a successful strategy; large numbers of snakes were killed for the reward. Eventually, however, enterprising people began to breed cobras for the income. When the government became aware of this, the reward program was scrapped. When cobra breeders set their now-worthless snakes free, the wild cobra population further increased.[5]

DaTroof
Nov 16, 2000

CC LIMERICK CONTEST GRAND CHAMPION
There once was a poster named Troof
Who was getting quite long in the toof



ty, makes total sense now

Achmed Jones
Oct 16, 2004





thanks! i cottoned on to the meaning but really wanted the story behind it. did not disappoint

rotor
Jun 11, 2001

Official Carrier
of the Neil Bush Torch

 
 
 
 
teh butts


OH NO! FERAL HOGS

quote:

Experiencing an issue with feral pigs, the U.S. Army post of Fort Benning in Georgia offered hunters a $40-bounty for every pigtail turned in. Predictably, however, people began to buy pigtails from butchers and slaughterhouses at wholesale prices then resold the tails to the Army at the higher bounty price.[4][better source needed]

DaTroof
Nov 16, 2000

CC LIMERICK CONTEST GRAND CHAMPION
There once was a poster named Troof
Who was getting quite long in the toof


i think there was a similar issue with a few gun buyback programs, where people got paid for bringing guns made of wood and duct tape

SYSV Fanfic
Sep 9, 2003


DaTroof posted:

i think there was a similar issue with a few gun buyback programs, where people got paid for bringing guns made of wood and duct tape

It happens all the time. Home made shotguns/destructive devices will kill someone same as any other. In gun buybacks that don't mandate semi-automatic, the home made ones are usually more dangerous than the unmaintained, rusted, ancient junk.

Some people have done it as a prank or to make a point about how stupid gun buybacks are. There isn't an industry or a large number of people doing this - there are multiple ways you'd run afoul of the NFA (lack of serial, inadvertently making a destructive device, etc etc etc).

~Coxy
Dec 9, 2003

R.I.P. Inter-OS Sass - b.2000AD d.2003AD

Nomnom Cookie posted:

lib directories haven't been a best practice since 2004 at the latest

I hate it when I clone a repo and it builds straight away!

Nomnom Cookie
Aug 30, 2009





~Coxy posted:

I hate it when I clone a repo and it builds straight away!

same, what’s the point of having a DevOps team with practices like that

rotor
Jun 11, 2001

Official Carrier
of the Neil Bush Torch

 
 
 
 
teh butts



I didnt see this image before but yeah, exactly: cobra farms for single-line js libs to pump up his numbers right next to a "support me" button

Bonfire Lit
Jul 9, 2008

If you're one of the sinners who caused this please unfriend me now.



Zamujasa posted:

if you really want a hearty lol there's always log-symbols

21,984,229 weekly downloads and 3,637 dependents

here it is:

code:
import chalk from 'chalk';
import isUnicodeSupported from 'is-unicode-supported';

const main = {
	info: chalk.blue('ℹ'),
	success: chalk.green('✔'),
	warning: chalk.yellow('⚠'),
	error: chalk.red('✖'),
};

const fallback = {
	info: chalk.blue('i'),
	success: chalk.green('√'),
	warning: chalk.yellow('‼'),
	error: chalk.red('×'),
};

const logSymbols = isUnicodeSupported() ? main : fallback;

export default logSymbols;

if (isUnicodeSupported()) { useUnicode(); } else { useDifferentUnicode(); }

Cybernetic Vermin
Apr 18, 2005



Bonfire Lit posted:

if (isUnicodeSupported()) { useUnicode(); } else { useDifferentUnicode(); }

otoh the unicode checking dependency is pretty rough (this is the entirety)

code:
export default function isUnicodeSupported() {
	if (process.platform !== 'win32') {
		return process.env.TERM !== 'linux'; // Linux console (kernel)
	}

	return Boolean(process.env.CI) ||
		Boolean(process.env.WT_SESSION) || // Windows Terminal
		process.env.ConEmuTask === '{cmd::Cmder}' || // ConEmu and cmder
		process.env.TERM_PROGRAM === 'vscode' ||
		process.env.TERM === 'xterm-256color' ||
		process.env.TERM === 'alacritty';
}

Zamujasa
Oct 27, 2010





Bread Liar

Bonfire Lit posted:

if (isUnicodeSupported()) { useUnicode(); } else { useDifferentUnicode(); }

the forums converted it to html entities, it appears as regular text in the code proper. that said i do wonder if the "non-unicode" ones actually work on not-unicode consoles considering that the check and cross marks aren't plain low ascii and presumably the file's encoding is utf8 since it's for console output

Cybernetic Vermin
Apr 18, 2005



Zamujasa posted:

the forums converted it to html entities, it appears as regular text in the code proper. that said i do wonder if the "non-unicode" ones actually work on not-unicode consoles considering that the check and cross marks aren't plain low ascii and presumably the file's encoding is utf8 since it's for console output

it is pretty confused phrasing, in that windows nt cmd.exe (it and the linux console being the only environments actually singled out) has had unicode support since 1993 afaik. what it does *not* have is unicode *emoji* support.

pointsofdata
Apr 25, 2011



Don't be too harsh on them, it's tough to get the naming right across an entire library.

prisoner of waffles
May 8, 2007

Ah! well a-day! what evil looks
Had I from old and young!
Instead of the cross, the fishmech
About my neck was hung.


rotor posted:

what I mean is that the 'ansi-red' package and left-pad and all the others are predictable outcomes of someone whose career is incentivized to have popular open source projects

cobra farms but for lovely single-liner js packages

this made me scurry over to the Wikipedia article for Goodhart’s Law, which has a bangin’ list of articles related to unintended consequences:

Doom Mathematic
Sep 1, 2008


DaTroof posted:

i try not to front on people for poo poo they give away for free, but that guy's contributions are an utter embarrassment

He is the worst programmer that I'm aware of. It would be a net gain if all of his packages were scrapped from npm.

Zamujasa
Oct 27, 2010





Bread Liar

Doom Mathematic posted:

He is the worst programmer that I'm aware of. It would be a net gain if all of his packages were scrapped from npm.

:hmmyes:

Fortaleza
Feb 21, 2008

Feel It


I like that the only PR to that ansi-red repo is an update to the LICENSE file so the PR maker can "use this without legal risk" and it's just been sitting there ignored for 3 years

rotor
Jun 11, 2001

Official Carrier
of the Neil Bush Torch

 
 
 
 
teh butts


Fortaleza posted:

I like that the only PR to that ansi-red repo is an update to the LICENSE file so the PR maker can "use this without legal risk" and it's just been sitting there ignored for 3 years

i like that despite only being three lines long, it still has a dependency

Adbot
ADBOT LOVES YOU

prisoner of waffles
May 8, 2007

Ah! well a-day! what evil looks
Had I from old and young!
Instead of the cross, the fishmech
About my neck was hung.


rotor posted:

i like that despite only being three lines long, it still has a dependency

“the buck stops somewhere else”ism, an explosion of dependencies being taken as normal, and resume-driven development / “look at how many stars I have on github” driven development, too many different transpilers, a language gradually changing and causing even more fragmentation of “stylistic best practices”, plus major frameworks coming through and altering patterns of development: the story of why the node ecosystem sucks

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