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
The MUMPSorceress
Jan 6, 2012


^SHTPSTS

Gary’s Answer

Pavlov posted:

So I got into a debate about silly 'design patterns', and I thought I'd share two of my favorite Java classes. One is the AbstractSingletonProxyFactoryBean (which I still don't know what you'd use for), and the RequestProcessorFactoryFactory (which is, technically, a factoryfactoryfactory).

I try to read the descriptions for classes like this, but my brain always shuts down and starts parsing it as "durr durr durr durr" and I never leave the doc exactly sure of what in the gently caress the thing is supposed to do. "AbstractSingletonProxyFactorBean" is such a chain of buzzwords I don't even know how to attack it. What is a bean? Who knows.

Adbot
ADBOT LOVES YOU

New Yorp New Yorp
Jul 18, 2003

Only in Kenya.
Pillbug

LeftistMuslimObama posted:

I try to read the descriptions for classes like this, but my brain always shuts down and starts parsing it as "durr durr durr durr" and I never leave the doc exactly sure of what in the gently caress the thing is supposed to do. "AbstractSingletonProxyFactorBean" is such a chain of buzzwords I don't even know how to attack it. What is a bean? Who knows.

quote:

In computing based on the Java Platform, JavaBeans are classes that encapsulate many objects into a single object (the bean). They are serializable, have a 0-argument constructor, and allow access to properties using getter and setter methods.

Blotto Skorzany
Nov 7, 2008

He's a PSoC, loose and runnin'
came the whisper from each lip
And he's here to do some business with
the bad ADC on his chip
bad ADC on his chiiiiip
What is meant by the phrase "encapsulate many objects into a single object"? That doesn't seem to be the usage of the verb 'encapsulate' that I'm familiar with.

ExcessBLarg!
Sep 1, 2001

pigdog posted:

Nope, frameworks these days often act as web servers themselves.
That's a bigger horror to me. Writing secure Internet services is hard, and it took many years for the big guys (Apache, nginx, etc.) to get it right. I can't imagine that WEBrick, Mongrel, Phusion Passenger, Unicorn, Thin, and Puma have all had sufficient longevity to survive as public-facing HTTP daemons on moderately popular sites.

Everyone at least still proxies through nginx or Varnish first, right?

raminasi
Jan 25, 2005

a last drink with no ice

Skuto posted:

Nobody does because GCC defaults it for -O2 and -Os since many years anyway.

You'll find a lot of code turning it off though, because most programmers can't write correct C and in most cases don't think they are supposed to either, so they rant like this: http://www.mail-archive.com/linux-btrfs@vger.kernel.org/msg01647.html

Apple's GCC build turns it off by default. MSVC doesn't do it at all.

:argh:Mah durn compiler faithfully follows the spec it claims to:argh:

Blotto Skorzany posted:

What is meant by the phrase "encapsulate many objects into a single object"? That doesn't seem to be the usage of the verb 'encapsulate' that I'm familiar with.

Well, you see, they're hidden from clients, so that's "encapsulation" instead of boring ol' aggregation. You can then access each individual object via a getter and setter. Encapsulation! OOP! Design patterns!

pseudorandom name
May 6, 2007

GrumpyDoctor posted:

:argh:Mah durn compiler faithfully follows the spec it claims to:argh:

The committee changed the spec, breaking already existing working code, and the compiler writers didn't bother to detect and warn about these situations 100% of the time.

Hughlander
May 11, 2005

Blotto Skorzany posted:

What is meant by the phrase "encapsulate many objects into a single object"? That doesn't seem to be the usage of the verb 'encapsulate' that I'm familiar with.

C struct.

KaneTW
Dec 2, 2011

ExcessBLarg! posted:

That's a bigger horror to me. Writing secure Internet services is hard, and it took many years for the big guys (Apache, nginx, etc.) to get it right. I can't imagine that WEBrick, Mongrel, Phusion Passenger, Unicorn, Thin, and Puma have all had sufficient longevity to survive as public-facing HTTP daemons on moderately popular sites.

Everyone at least still proxies through nginx or Varnish first, right?

I'm pretty sure everyone proxies those. It'd be pretty insane not to.

Zorro KingOfEngland
May 7, 2008

Java code:
private Map<String, Map<Place, Map<Peak, Map<Integer, BigDecimal>>>> monthPlaceTypeHourUsage;
Some code I wrote 2 years ago that I'm having to update today. I'm sure this seemed like a good idea at the time.

HappyHippo
Nov 19, 2003
Do you have an Air Miles Card?

Pavlov posted:

So I got into a debate about silly 'design patterns', and I thought I'd share two of my favorite Java classes. One is the AbstractSingletonProxyFactoryBean (which I still don't know what you'd use for), and the RequestProcessorFactoryFactory (which is, technically, a factoryfactoryfactory).

quote:

All Known Implementing Classes:
RequestProcessorFactoryFactory.RequestSpecificProcessorFactoryFactory, RequestProcessorFactoryFactory.StatelessProcessorFactoryFactory

At what point do you step back and marvel at the ridiculousness of what you've created? Actually typing out "RequestProcessorFactoryFactory.RequestSpecificProcessorFactoryFactory" would give me serious pause to wonder if I was actually solving a useful problem, or just solving problems of my own creation.

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe

pseudorandom name posted:

The committee changed the spec, breaking already existing working code

No, they didn't. The first actual specification includes the aliasing rules. Feel free to search your copy of C89 for "/28/".

Also, the entire Linux kernel was written starting two years after that standard was published, so while Stephen Bourne would have a legitimate complaint, Linus does not.

pseudorandom name posted:

and the compiler writers didn't bother to detect and warn about these situations 100% of the time.

Other things that compilers don't detect and warn about in 100% of situations:
  • signed overflow
  • dereferencing null pointers
  • double frees
  • accessing past the end of an array or other allocation
  • giving declarations different types in different translation units
  • changing the definition of a type in different translation units
This list is not to be taken as exhaustive.

Examples of undefined behavior that would actually be reasonable to detect and warn about in 100% of situations:
  • literally nothing, because why would the language make it undefined behavior instead of just ill-formed if it were always trivial to detect?

Now, I don't agree with how GCC approached its strict-aliasing optimization; what they do is legal under the standard but really goes out of its way to break reasonable code. There is no good reason to miscompile casting the address of a local int variable to float* and immediately loading/storing, and the legal alternative (memcpying to a temporary) is really a pain in the rear end. This is why Clang's strict-aliasing optimization allows itself to be overridden by the knowledge that two addresses definitely alias.

But acting like the entire concept of aliasing optimizations is some gross imposition invented by egg-head compiler writers who don't really understand C, maaaaan, is just obnoxious.

pigdog
Apr 23, 2004

by Smythe
You could as well call them DoucheNozzle.LolButt , but pattern-based nimes like *Factory, *Strategy, *Singleton* etc do give a brief idea of what the class is all about and what it's used for, without needing to dwell into them further.

Spring does like to take that idea into extremes.

KaneTW
Dec 2, 2011

pigdog posted:

but pattern-based nimes like *Factory, *Strategy, *Singleton* etc do give a brief idea of what the class is all about and what it's used for, without needing to dwell into them further.

Yes, it should give you the idea to throw yourself into an active volcano.

KaneTW fucked around with this message at 22:02 on Jan 28, 2015

OddObserver
Apr 3, 2009

rjmccall posted:


Examples of undefined behavior that would actually be reasonable to detect and warn about in 100% of situations:
  • literally nothing, because why would the language make it undefined behavior instead of just ill-formed if it were always trivial to detect?

What does the spec say about passing objects through varargs? gcc's "... will crash at run time" warning always struck me as, well, a bit of a horror.
(In being a warning, that is).

HappyHippo
Nov 19, 2003
Do you have an Air Miles Card?

rjmccall posted:

Examples of undefined behavior that would actually be reasonable to detect and warn about in 100% of situations:
  • literally nothing, because why would the language make it undefined behavior instead of just ill-formed if it were always trivial to detect?

I agree with the general thrust of your post, but in some cases it seems like the standards committee just got lazy. For example, apparently this is undefined in c:

quote:

An unmatched ‘ or ” character is encountered on a logical source line during tokenization.

Is it really that hard to detect that and warn about it?

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe

OddObserver posted:

What does the spec say about passing objects through varargs? gcc's "... will crash at run time" warning always struck me as, well, a bit of a horror.
(In being a warning, that is).

Oh, you're right, I take it back; there is that one example. It's actually theoretically something that compilers could support — this came up on cxx-abi-dev vaguely recently because I believe somebody was asking GCC to support it — but don't because (1) it would significantly complicate va_next and (2) nobody cares, except apparently whoever's paying GCC to implement it. (Supporting this in va_next properly requires va_next to be implemented as a compiler intrinsic, which is often but not always true. Some platforms with really simple calling conventions implement it in system headers instead.)

That's a weird exception because the standard only really allows it for the convenience of metaprogramming — you can test whether one type is convertible to another by looking at the result type of a calling an overloaded function, where one overload takes the target type and the other takes ... (i.e. anything). But then it turned out that that normal type-checking doesn't give you quite the right results, so type-checking calls to variadics in unevaluated contexts needs to be a special case anyway.

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe

HappyHippo posted:

I agree with the general thrust of your post, but in some cases it seems like the standards committee just got lazy. For example, apparently this is undefined in c:

Is it really that hard to detect that and warn about it?

A lot of the lexical undefined behavior rules are because the language can't quite guarantee that code won't compile in some perverse case.

I don't know what the deal with unmatched quotes is, but every compiler I know about treats it as an error. Maybe they were worried about backwards compatibility.

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
Linus is really terrible. He has some bad idea about something, and then thinks anybody who doesn't agree with his interpretation of complex issues, and I quote, "should be retroactively aborted. Who the f*ck does idiotic things like that? How did they noty die as babies, considering that they were likely too stupid to find a tit to suck on?"

ryde
Sep 9, 2011

God I love young girls
... and then a bunch of people rush in to defend his use of acerbic language and laud him as being a straight-shooter who gets things done.

Deus Rex
Mar 5, 2005

Suspicious Dish posted:

Linus is really terrible. He has some bad idea about something, and then thinks anybody who doesn't agree with his interpretation of complex issues, and I quote, "should be retroactively aborted. Who the f*ck does idiotic things like that? How did they noty die as babies, considering that they were likely too stupid to find a tit to suck on?"

The thing you're quoting appears to be Linus's reaction to some code that read from a file descriptor making a system call to read individual bytes one at a time. I don't see how that's a "complex issue" open to "interpretation," it's just obviously bad practice.

Of course the real issue is whether it's appropriate to use such an acerbic rhetoric with long-time contributors to the project you manage (it's probably not!). You don't have to go out of your way to frame his outrage like it's over a mere difference of opinion.

Pavlov
Oct 21, 2012

I've long been fascinated with how the alt-right develops elaborate and obscure dog whistles to try to communicate their meaning without having to say it out loud
Stepan Andreyevich Bandera being the most prominent example of that

Deus Rex posted:

The thing you're quoting appears to be Linus's reaction to some code that read from a file descriptor making a system call to read individual bytes one at a time. I don't see how that's a "complex issue" open to "interpretation," it's just obviously bad practice.

Of course the real issue is whether it's appropriate to use such an acerbic rhetoric with long-time contributors to the project you manage (it's probably not!). You don't have to go out of your way to frame his outrage like it's over a mere difference of opinion.

They were just trying to say Linus is an rear end in a top hat. The quote, even in context, still makes him sound like an rear end in a top hat.

sarehu
Apr 20, 2007

(call/cc call/cc)

Suspicious Dish posted:

Linus is really terrible. He has some bad idea about something, and then thinks anybody who doesn't agree with his interpretation of complex issues, and I quote, "should be retroactively aborted. Who the f*ck does idiotic things like that? How did they noty die as babies, considering that they were likely too stupid to find a tit to suck on?"

Or maybe you could just not be a pissy little pussy.

:)

Deus Rex
Mar 5, 2005

Pavlov posted:

They were just trying to say Linus is an rear end in a top hat. The quote, even in context, still makes him sound like an rear end in a top hat.

Sure. I just don't understand the point of mentioning "complex issues" and "interpretations" when the provided example had nothing to do with those things. Linus looks like a weird dick on his own.

NovemberMike
Dec 28, 2008

sarehu posted:

Or maybe you could just not be a pissy little pussy.

:)

The problem with this style isn't that it pushes away pussies, it's that it pushes away anyone that knows more than Linus. There have been a few cases where he's been the retarded monkey throwing poo poo and driving smart people away.

Suspicious Dish
Sep 24, 2011

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

sarehu posted:

Or maybe you could just not be a pissy little pussy.

:)

Sure, but only after you stop being a horrible racist, sexist shitbag.

KernelSlanders
May 27, 2013

Rogue operating systems on occasion spread lies and rumors about me.

HappyHippo posted:

At what point do you step back and marvel at the ridiculousness of what you've created? Actually typing out "RequestProcessorFactoryFactory.RequestSpecificProcessorFactoryFactory" would give me serious pause to wonder if I was actually solving a useful problem, or just solving problems of my own creation.

I think it was the python thread that introduced me to execution in the kingdom of nouns

Deus Rex
Mar 5, 2005

NovemberMike posted:

The problem with this style isn't that it pushes away pussies, it's that it pushes away anyone that knows more than Linus. There have been a few cases where he's been the retarded monkey throwing poo poo and driving smart people away.

Do you have specific examples, just out of curiosity?

Deus Rex fucked around with this message at 03:55 on Jan 29, 2015

Suspicious Dish
Sep 24, 2011

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

Deus Rex posted:

Do you have specific examples, just out of curiosity?

There's this specific thread which happened to a former colleague, where Linus makes bold claims about cache coherency that are just flat out wrong: http://marc.info/?l=linux-mm&m=139939405221810

Deus Rex
Mar 5, 2005

Suspicious Dish posted:

There's this specific thread which happened to a former colleague, where Linus makes bold claims about cache coherency that are just flat out wrong: http://marc.info/?l=linux-mm&m=139939405221810

This is (maybe, I don't know anything about this topic, but I'll take your word for it) an example of Linus being wrong, but doesn't seem to me like one where he is abusive or being a retarded monkey throwing poo poo. In fact, someone on the mailing list appears to have corrected him here and I didn't see Linus blow up or anything like that in response. It also doesn't look like this experience dissuaded your colleague from making further contributions.

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

It would take something impressive indeed to get Rik to stop contributing to Linux.

Suspicious Dish
Sep 24, 2011

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

Deus Rex posted:

This is (maybe, I don't know anything about this topic, but I'll take your word for it) an example of Linus being wrong, but doesn't seem to me like one where he is abusive or being a retarded monkey throwing poo poo. In fact, someone on the mailing list appears to have corrected him here and I didn't see Linus blow up or anything like that in response. It also doesn't look like this experience dissuaded your colleague from making further contributions.

My former coworker was Jerome Glisse, not Rik. He's going to continue working on HMM, but he expressed frustration when trying to convey his ideas to Linus. He's not overly abusive in that thread, no, but he was wrong.

He's more abusive here: https://lkml.org/lkml/2014/11/10/649

Make sure to read the followup where he admits he hasn't read the actual patches or actually tried to understand the problem space at all while Jerome tries to carefully explain to him the problems he faces using the simple solutions he suggested.

In one of those revisions, Linus said "wait, you're doing it way X? What the gently caress is wrong with this idiot? Do it way Y instead!" and then in a follow-up, "jesus, wow, I think I liked way X instead". I can't point to the specific ML posts, since this was just in person talking on the T back home, and also a year ago.

NovemberMike
Dec 28, 2008

Deus Rex posted:

Do you have specific examples, just out of curiosity?

I can't remember who it was, but there was a contributor that was basically considered the leading expert on a certain space. I can't remember if it was memory management or networking or graphics or security or what, and it's not particularly important. The important bit was that this was an old unix greybeard dude that built everything in this space originally so when he says something you listen. Linus didn't listen, he heard something he didn't understand, mixed it up with a different bug and started bitching at the guy to stop being retarded. They go into a bit of a back and forth and now the dude is building an OS for some weird architecture that was obsoleted in the 80s instead of contributing to Linux.

FlapYoJacks
Feb 12, 2009
Is a 100,000+ line main.css and a 50,000+ line main.js file a coding horror?

1337JiveTurkey
Feb 17, 2005

NovemberMike posted:

They go into a bit of a back and forth and now the dude is building an OS for some weird architecture that was obsoleted in the 80s instead of contributing to Linux.

Most Linux contributions are to add bug-for-bug support for some Slovenian knockoff of a Romanian clone of a Soviet re-implementation of some dumb terminal you could only get for a thousand boxtops of a cereal that was discontinued after a month.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

ratbert90 posted:

Is a 100,000+ line main.css and a 50,000+ line main.js file a coding horror?

Replace all syntactically-relevant newlines and delete the rest of them, problem solved!

sarehu
Apr 20, 2007

(call/cc call/cc)

Suspicious Dish posted:

My former coworker was Jerome Glisse, not Rik. He's going to continue working on HMM, but he expressed frustration when trying to convey his ideas to Linus. He's not overly abusive in that thread, no, but he was wrong.

He's more abusive here: https://lkml.org/lkml/2014/11/10/649

He's expressing confusion and openly stating he might not understand things in that email and the follow up. You're also using the word "abusive" in a new recently-made-popular way to describe comments made online that doesn't actually correspond to anything known as "abuse." Linus is not abusing the recipient of his email, nor is he abusing the email system. So his email is not abusive. Unless you really think having and sharing beliefs about code being bad is a way to abuse somebody and also think having that having and sharing uncertain beliefs while going out of your way to point out that you might be wrong is a way to abuse somebody. (It seems to me you just like to try hard to hate people for no reality-based reason. See for example you calling me a racist because of a post that Skuto made.)

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed

ExcessBLarg! posted:

That's a bigger horror to me. Writing secure Internet services is hard, and it took many years for the big guys (Apache, nginx, etc.) to get it right. I can't imagine that WEBrick, Mongrel, Phusion Passenger, Unicorn, Thin, and Puma have all had sufficient longevity to survive as public-facing HTTP daemons on moderately popular sites.

Everyone at least still proxies through nginx or Varnish first, right?

Passenger fully integrated with nginx, so no need to proxy it. Unicode is explicitly designed to sit behind a reverse proxy. Puma and Thin sorta try to not require a reverse proxy, but in practice do anyway for performance reasons.

People totally do toss run production servers on poo poo like unproxied WEBrick all the time, but the application code written by such people is a much larger security concern than the application server.

Look Around You
Jan 19, 2009

sarehu posted:

He's expressing confusion and openly stating he might not understand things in that email and the follow up. You're also using the word "abusive" in a new recently-made-popular way to describe comments made online that doesn't actually correspond to anything known as "abuse." Linus is not abusing the recipient of his email, nor is he abusing the email system. So his email is not abusive. Unless you really think having and sharing beliefs about code being bad is a way to abuse somebody and also think having that having and sharing uncertain beliefs while going out of your way to point out that you might be wrong is a way to abuse somebody. (It seems to me you just like to try hard to hate people for no reality-based reason. See for example you calling me a racist because of a post that Skuto made.)

I'm pretty sure he's not saying the criticism itself is abusive, but rather the manner in which it's delivered is. There's way more professional and tactful ways to express disagreement/misunderstanding than literally saying "WHAT? \n NONE OF WHAT YOU SAY MAKES ANY SENSE." and other very vitriolic poo poo ("you should be retroactively aborted", etc). Talking to someone that way (esp. in a semiprofessional environment) honestly is abusive. There's nothing wrong with disagreeing with someone's approach or with not understanding their methodology. However, there's definitely no reason to literally publicly berate someone (especially using the language/statements that Linus does) for making a contribution that you don't yet understand, and don't even try to take the time to read the patches to understand. It's really hosed up to do, and I guarantee you it's turning people away from contributing.

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
Hm, what's that you say? You called read(1);? Jesus Christ, how are you even alive? How have you not gotten the Guinness World Record in racking up the most Darwin Awards by now? You know what, if you don't find a way to run into a truck by next week, I'll just do the world a favor and hire an assassin to rid the face of the planet of you!

Suspicious Dish fucked around with this message at 08:00 on Jan 29, 2015

Adbot
ADBOT LOVES YOU

Look Around You
Jan 19, 2009

sarehu posted:

He's expressing confusion and openly stating he might not understand things in that email and the follow up. You're also using the word "abusive" in a new recently-made-popular way to describe comments made online that doesn't actually correspond to anything known as "abuse." Linus is not abusing the recipient of his email, nor is he abusing the email system. So his email is not abusive. Unless you really think having and sharing beliefs about code being bad is a way to abuse somebody and also think having that having and sharing uncertain beliefs while going out of your way to point out that you might be wrong is a way to abuse somebody. (It seems to me you just like to try hard to hate people for no reality-based reason. See for example you calling me a racist because of a post that Skuto made.)

Also in what loving world do you live in where repeatedly posting/sending death threats to "express disagreement" to someone online is not abusive? Or having multiple people do it? How about posting their address and threatening to rape and murder them? How is any of that not abusive? Like do you honestly think that the #gamergate bullshit is actually about "ethics in video game journalism" and not a way to further disempower and subjugate women to push them further away from their sacred loving video games or whatever the gently caress their goal is now?

Like I honestly want to know how any of that poo poo is not abusive. Please justify it to me, I'd love to hear an explanation.

e: (that is not directly related to the linus style stuff, but to explain my reasoning, judging by how you framed your post talking about essentially fake abuse online, it definitely leads me to believe that you view that poo poo in the same way)

e2: ((and along the lines of the linus stuff, in what world is it not abusive to talk to someone like that? It's like the very definition of abusive language))

Look Around You fucked around with this message at 08:27 on Jan 29, 2015

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