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
Happy Thread
Jul 10, 2005

by Fluffdaddy
Plaster Town Cop

Nude posted:

Is it too much to ask what's so horrific bout blockchain? Apologies in advance if so.

Ask in these two places, they're pretty experienced at answering it

https://forums.somethingawful.com/showthread.php?threadid=3878587

https://forums.somethingawful.com/showthread.php?threadid=3838405

Adbot
ADBOT LOVES YOU

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed
If you don’t have any of the proof of work stuff it’s just a merkle tree (or even just chained hashes) and while those are cool and useful things... they’re cool and useful things that have been widely used for a long time.

QuarkJets
Sep 8, 2008

Blockchains are the largest ecological disaster of our time but provide nothing that doesn't already exist in a superior and more efficient form.

Doom Mathematic
Sep 2, 2008

Nude posted:

Is it too much to ask what's so horrific bout blockchain? Apologies in advance if so.

James Mickens has a pretty succinct breakdown of what blockchains do and why it's not very useful for them to do that:

https://www.youtube.com/watch?v=15RTC22Z2xI

99% of situations where a blockchain is used/suggested, a database would be more appropriate.

Slash
Apr 7, 2011

Doom Mathematic posted:

James Mickens has a pretty succinct breakdown of what blockchains do and why it's not very useful for them to do that:

https://www.youtube.com/watch?v=15RTC22Z2xI

99% of situations where a blockchain is used/suggested, a database would be more appropriate.

Wow the comments on that video are a cesspool of btc fanboys.

Bruegels Fuckbooks
Sep 14, 2004

Now, listen - I know the two of you are very different from each other in a lot of ways, but you have to understand that as far as Grandpa's concerned, you're both pieces of shit! Yeah. I can prove it mathematically.

Slash posted:

Wow the comments on that video are a cesspool of btc fanboys.

i'm trying to imagine the process to becoming a btc fanboy and failing. i like bitcoin because it lets you buy illegal drugs online and make money from idiots. i do not understand how people's liking money and drugs translates to "let's see if we can make everything blockchain because of btc".

then the wall street journal has an article about "agile cloud blockchains", the next big nosql replacement uses blockchain instead of just putting all the database in the machine's ram without using memory mapped files, and microsoft decides that you can't build typescript anymore without blockchain storing all the changes.

Clanpot Shake
Aug 10, 2006
shake shake!

Nude posted:

Is it too much to ask what's so horrific bout blockchain? Apologies in advance if so.

https://chrome.google.com/webstore/detail/replace-blockchain-with-s/johdgapbhomlhcflancninpeafocpopn?hl=en-US&gl=US

kitten emergency
Jan 13, 2008

get meow this wack-ass crystal prison

Bruegels Fuckbooks posted:

i'm trying to imagine the process to becoming a btc fanboy and failing. i like bitcoin because it lets you buy illegal drugs online and make money from idiots. i do not understand how people's liking money and drugs translates to "let's see if we can make everything blockchain because of btc".

they stan blockchain because their line of thinking goes "well people laugh at btc, but btc is mostly about the blockchain, if blockchains become real then btc is real too". it's get-rich-quick schemes all the way down.

Ola
Jul 19, 2004

Greater fool theory works if there are greater fools.

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



Slash posted:

Wow the comments on that video are a cesspool of btc fanboys.

Cesspool (or cesspit) would be a great choice for a collective noun for cryptocurrency fans

uncurable mlady posted:

they stan blockchain because their line of thinking goes "well people laugh at btc, but btc is mostly about the blockchain, if blockchains become real then btc is real too". it's get-rich-quick schemes all the way down.

It's all money laundering OP

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


https://twitter.com/mattblaze/status/1034844783691190272

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

Bruegels Fuckbooks posted:

i'm trying to imagine the process to becoming a btc fanboy and failing. i like bitcoin because it lets you buy illegal drugs online and make money from idiots. i do not understand how people's liking money and drugs translates to "let's see if we can make everything blockchain because of btc".

it really started with the economic collapse of 2008. capitalism is failing but it's the only system that's ever worked, at least from the perspective of a bitcoiner. everyone wants to regulate the banks, but that would be against capitalism. bitcoin lets them continue to believe in capitalism because it's a free market solution to regulating the banks.

if it had a chance of working, it wouldn't be unreasonable.

DONT THREAD ON ME fucked around with this message at 21:48 on Feb 28, 2019

xtal
Jan 9, 2011

by Fluffdaddy
Bitcoin is cool and good as long as you remember that its purpose is not to speculate, but to buy illegal things. Not sure why that thread's title is "Bitcoin: ketamine-2-go is not a legitimate business" when it pretty clearly is.

Cuntpunch posted:

Am I wrong to find that Blockchain is being split into two definitions these days?

The first is the 'original' meaning, which involves Work of Proof nonsense ala Bitcoin. This is basically just a roundabout way to feather the accelerator for rising sea levels.

The second is the 'free VC money' meaning, which is basically what git does.


When we talk about things like chain of custody solutions, I don't see any reason why we'd be talking about the original meaning, but the latter meaning seems like a 'of course you'd want to do something like this, but now if we say Blockchain, we get showered in cash' opportunistic thing.

Even the dumb VC cash grabs that use the blockchain term tend to use real blockchains, just for no reason.

xtal fucked around with this message at 22:39 on Feb 28, 2019

Soricidus
Oct 21, 2010
freedom-hating statist shill

xtal posted:

Bitcoin is cool and good as long as you remember that its purpose is not to speculate, but to buy illegal things. Not sure why that thread's title is "Bitcoin: ketamine-2-go is not a legitimate business" when it pretty clearly is.

love to buy illegal things with a currency that records every transaction on a public ledger

xtal
Jan 9, 2011

by Fluffdaddy

Soricidus posted:

love to buy illegal things with a currency that records every transaction on a public ledger

The public ledger is secure unless you leak your addresses (it doesn't have forward secrecy.) So, the easy solutions are: don't leak your addresses; or, use a currency based on zero-knowledge proofs. The fact that Bitcoin is secure minus screwing up is evident by the fact that people continue to use it, and all the bad stories are about people screwing up.

xtal fucked around with this message at 01:05 on Mar 1, 2019

JawnV6
Jul 4, 2004

So hot ...

Soricidus posted:

love to buy illegal things with a currency that records every transaction on a public ledger

One of the surprising facts to fall out of the Ulbricht trial was that Silk Road's tumbler worked. That's not saying that it can't eventually be cracked, or if the domain operator hadn't kept an open laptop with my_crimes.txt up when he got nabbed they would've tried harder, but the general sentiment is that transactions at scale were successfully obfuscated.

QuarkJets
Sep 8, 2008

xtal posted:

The public ledger is secure unless you leak your addresses (it doesn't have forward secrecy.) So, the easy solutions are: don't leak your addresses; or, use a currency based on zero-knowledge proofs. The fact that Bitcoin is secure minus screwing up is evident by the fact that people continue to use it, and all the bad stories are about people screwing up.

And yet the vast majority of people buying bitcoins with real money definitely gave someone their name and address and probably a copy of their ID, and then those that go on to make illegal purchases make no attempt at all to hide what they're doing

Xarn
Jun 26, 2015

xtal posted:

The public ledger is secure unless you leak your addresses (it doesn't have forward secrecy.) So, the easy solutions are: don't leak your addresses; or, use a currency based on zero-knowledge proofs. The fact that Bitcoin is secure minus screwing up is evident by the fact that people continue to use it, and all the bad stories are about people screwing up.

The only reason the public ledge is even remotely pseudonymous is that basically nobody uses it. If the world ever went bitcoin maximalist (insert laughing bender gif), deanonymizing it would be quite easy, because payments follow patterns.

Ola
Jul 19, 2004

The evil AI will fail to enslave the human race because its computing power will be bogged down by keeping track of centuries of encrypted toilet paper purchases.

xtal
Jan 9, 2011

by Fluffdaddy
nm, ot

xtal fucked around with this message at 15:43 on Mar 1, 2019

karms
Jan 22, 2006

by Nyc_Tattoo
Yam Slacker

Ola posted:

The evil AI will fail to enslave the human race because its computing power will be bogged down by keeping track of centuries of encrypted toilet paper purchases.

i hope the ai will appreciate we gave them their version of clay tablets but this time with embedded instructions of how to get child porn

Cuntpunch
Oct 3, 2003

A monkey in a long line of kings
Every day I lose a little more faith in humanity. Generally when I'm handling PRs.

code:
//C#

public class Foo 
{
	public abstract int X;
}

public class BBar : Foo 
{
	public override int X;
	public int Y;
}

public class CBar : Foo
{
	public override int X;
	public int Y;
}

public class DBar : Foo
{
	public override int X;
	public int Y;
}
There...isn't any difference between B, C, and D? I ask, woefully aware that I'm going to exit this conversation needing a drink.

"Well yes there is, one is a B, one is a C, and one is a D!"

But...they all do the same thing. Do we need this to be this way?

"Yes! Because we wouldn't want to confuse a B for a C!" says the culprit, blissfully unaware that his work is a testament to David Dunning.

code:
//C#
//Relevant signatures
public class Foo {} //Yes, the same Foo from above.

public class Bar : Foo {}  //After the discussion settled the above horror

public void SomeMethod(Foo[] things) {}

//Inside some other method
var x = new List<Bar>();

/*populate that thing*/

SomeMethod(x.Cast<Foo>().ToArray());
Why are we using Cast here? I ask to the 20-years-of-experience-certified-in-multiple-OO-languages developer.

Little did I realize, this would trigger the need for a 45 minute long explanation about textbook polymorphism.

(No, C# nerds, we're never manipulating the collection inside SomeMethod)

Hammerite
Mar 9, 2007

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

Cuntpunch posted:

Every day I lose a little more faith in humanity. Generally when I'm handling PRs.

code:
//C#

public class Foo 
{
	public abstract int X;
}

public class BBar : Foo 
{
	public override int X;
	public int Y;
}

public class CBar : Foo
{
	public override int X;
	public int Y;
}

public class DBar : Foo
{
	public override int X;
	public int Y;
}
There...isn't any difference between B, C, and D? I ask, woefully aware that I'm going to exit this conversation needing a drink.

"Well yes there is, one is a B, one is a C, and one is a D!"

But...they all do the same thing. Do we need this to be this way?

"Yes! Because we wouldn't want to confuse a B for a C!" says the culprit,

This is perfectly defensible

Volte
Oct 4, 2004

woosh woosh
So basically it looks like he didn't realize that array types are covariant, which they really shouldn't be anyway, and also understands the main purpose of types. What a dimwit!

Jabor
Jul 16, 2010

#1 Loser at SpaceChem
methods should not accept arrays as input anyway. just accept a List

(the only exception being varargs methods since there you're getting an array whether you want it or not)

Cuntpunch
Oct 3, 2003

A monkey in a long line of kings

Volte posted:

So basically it looks like he didn't realize that array types are covariant, which they really shouldn't be anyway, and also understands the main purpose of types. What a dimwit!

I have to imagine my example is trimmed down too much for the sake of simplicity and somehow a masterful complexity is being imagined. These are API DTOs. X in this case *literally* being an ID value. Y in this case is *literally* a constant value that is shared by all of the roles.

And we're not even talking variance or the fact that we should operate on an abstraction like IEnumerable or IList rather than an array - we're talking just a preliminary 'Why are we casting?' and then having to spend serious time explaining the actual loving purpose of subtypes in the first place.

I don't have the energy to try and obfuscate/abstract away the other wild bizarre stuff going on in that code. Like despite going to great lengths to setup a class tree, doing all sorts of weird external type sniffing
code:
var foo = //some Foo
if(typeof(foo) == typeof(Bar))  //Do something

if(typeof(foo) == typeof(Baz)) //Do something else

Pollyanna
Mar 5, 2005

Milk's on them.


Isn’t abstracting behavior behind interfaces and methods the whole point of OOP?

New Yorp New Yorp
Jul 18, 2003

Only in Kenya.
Pillbug

Jabor posted:

methods should not accept arrays as input anyway. just accept a List

Almost agree; they should accept IList if they need list behavior (indexers, adding/removing elements) or IEnumerable if they just need to be able to enumerate the members of the collection.

dwazegek
Feb 11, 2005

WE CAN USE THIS :byodood:

New Yorp New Yorp posted:

Almost agree; they should accept IList if they need list behavior (indexers, adding/removing elements) or IEnumerable if they just need to be able to enumerate the members of the collection.

ICollection, IReadOnlyCollection and IReadOnlyList are also really useful. I generally even prefer IReadOnlyCollection over IEnumerable as it sidesteps a number of gotchas that IEnumerable has.

raminasi
Jan 25, 2005

a last drink with no ice

Cuntpunch posted:

we're talking just a preliminary 'Why are we casting?'

Why, uh, do you think the cast isn‘t necessary?

New Yorp New Yorp posted:

Almost agree; they should accept IList if they need list behavior (indexers, adding/removing elements) or IEnumerable if they just need to be able to enumerate the members of the collection.

We just do “IEnumerable if you’re enumerating once and array if you’re enumerating more than once and just never mutate an array” and it honestly works just fine. It turns out that we run into very few cases where being able to juggle fancier collection types really buys us anything (not doing anything performance-sensitive might help here, I don’t know).

Soricidus
Oct 21, 2010
freedom-hating statist shill

raminasi posted:

Why, uh, do you think the cast isn‘t necessary?

are you saying you think it is? if so, what purpose do you think it serves?

Volte
Oct 4, 2004

woosh woosh
The cast isn't necessary but it should be. Array types are covariant so you can pass a Bar[] where Foo[] is expected if Bar is a subtype of Foo, but the method that accepts the Foo[] can (without violating any contracts) attempt to put some other subtype of Foo into the array, which will fail at runtime. If you cast first, then it becomes an array of Foo[], so the method can do whatever it wants and it's the caller's responsibility to deal with that.

GABA ghoul
Oct 29, 2011

Aren't Lists internally implemented as dynamic arrays in .NET? Why do I see people converting them to static arrays? What's the advantage?

Soricidus
Oct 21, 2010
freedom-hating statist shill
it feels more efficient. closer to the metal, you know?

qsvui
Aug 23, 2003
some crazy thing

Soricidus posted:

it feels more efficient. closer to the metal, you know?

You joke, but it's been my experience that people who say this have never once profiled code in their lives.


To contribute, here's a minor horror I found:
C++ code:
if (x == y)
{
  return true;
}
else
{
  return false;
}

VikingofRock
Aug 24, 2008




Volte posted:

The cast isn't necessary but it should be. Array types are covariant so you can pass a Bar[] where Foo[] is expected if Bar is a subtype of Foo, but the method that accepts the Foo[] can (without violating any contracts) attempt to put some other subtype of Foo into the array, which will fail at runtime. If you cast first, then it becomes an array of Foo[], so the method can do whatever it wants and it's the caller's responsibility to deal with that.

Just wanted to say that this was a really clear explanation of an unintuitive issue. Thanks!

CPColin
Sep 9, 2003

Big ol' smile.

qsvui posted:

To contribute, here's a minor horror I found:
C++ code:
if (x != y)
{
  return false;
}
else
{
  return true;
}

Fixed for more efficiency.

Che Delilas
Nov 23, 2009
FREE TIBET WEED

CPColin posted:

Fixed for more efficiency.

Burn you monster.

Cuntpunch
Oct 3, 2003

A monkey in a long line of kings

CPColin posted:

Fixed for more efficiency.

code:
return x != y ? false : true;
Reduced LOC

Adbot
ADBOT LOVES YOU

Linear Zoetrope
Nov 28, 2011

A hero must cook
code:
bool x_is_not_y = x != y;

if (x_is_not_y == true) {
    return false;
} else if (x_is_not_y == false) {
    return true;
} else {
    throw "Boolean value is not true or false!";
}

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