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
zergstain
Dec 15, 2005

Or just use a test card number.

Adbot
ADBOT LOVES YOU

Jabor
Jul 16, 2010

#1 Loser at SpaceChem
The whole "OOP is the only conceivable way to do {X}" meme is a great example of how too much OOP causes brain damage.

Mustach
Mar 2, 2003

In this long line, there's been some real strange genes. You've got 'em all, with some extras thrown in.

Zombywuf posted:

When was it decided that OO == polymorphism? There are lots of types of polymorphism, only one involves sub-typing.
Since Simula and/or Smalltalk

Dren
Jan 5, 2001

Pillbug
That eevee post is pretty good. Eevee's point about the methods in the controller pattern actually being state is well conceived. I knew I didn't like callbacks implemented via inheritance but I hadn't put my finger on exactly why. Eevee's post nailed it.

Lately I've been messing with some C++ classes that use the callbacks via inheritance pattern. It's a poo poo pattern, and that fact is highlighted by the base class having a member variable that contains the type of subclassed object it is. It was done so that common code in the base class could switch on the type of the class. It's pretty bad.

tef
May 30, 2004

-> some l-system crap ->

Mustach posted:

Since Simula and/or Smalltalk

(smalltalk was about messages :3:)

Chin Strap
Nov 24, 2002

I failed my TFLC Toxx, but I no longer need a double chin strap :buddy:
Pillbug
What is the technical term for the way Go does it? Composition? Would that still be considered OO? I like that (but still wish it had generics).

Athas
Aug 6, 2007

fuck that joker

Mustach posted:

Since Simula and/or Smalltalk

I think the point is that while all OOP includes polymorphism, there are plenty of non-OO languages that still support polymorphism.

In Haskell, which is certainly not object-oriented by any reasonable measure, there is a way to turn objects into strings. Of course, Haskell does this with type classes. :tinfoil:

Plorkyeran
Mar 22, 2007

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

Chin Strap posted:

What is the technical term for the way Go does it? Composition? Would that still be considered OO? I like that (but still wish it had generics).

Structural typing.

Mustach
Mar 2, 2003

In this long line, there's been some real strange genes. You've got 'em all, with some extras thrown in.

Athas posted:

I think the point is that while all OOP includes polymorphism, there are plenty of non-OO languages that still support polymorphism.
Then I agree.

HORATIO HORNBLOWER
Sep 21, 2002

no ambition,
no talent,
no chance

Dren posted:

code in the base class could switch on the type of the class.

This is the biggest loving code smell in the world and I see it all the loving time.

Sagacity
May 2, 2003
Hopefully my epitaph will be funnier than my custom title.

Pollyanna posted:

Languages like Java with its crazy "EVERYTHING IS A CLASS" make the same mistake that's been repeated time and time again in history: it ditches a tempered approach to problem-solving and critical thinking in favor of one extreme ideology.

gently caress Java.
Please, go on. Can you give a few examples of the extreme ideology?

Houston Rockets
Apr 15, 2006

quote:

last week we had several unmonitored hours due to an issue with the nagios server. setup another nagios instance that only monitors the nagios server itself

QuarkJets
Sep 8, 2008

Sagacity posted:

Please, go on. Can you give a few examples of the extreme ideology?

I think he's specifically referring to "EVERYTHING IS A CLASS, NO EXCEPTIONS" as extreme ideology

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed
Which doesn't actually apply to Java, as it does have primitives.

carry on then
Jul 10, 2010

by VideoGames

(and can't post for 10 years!)

But Java has tons of exceptions :v:

ManoliIsFat
Oct 4, 2002


Well how else would you do it?

New Yorp New Yorp
Jul 18, 2003

Only in Kenya.
Pillbug

carry on then posted:

But Java has tons of exceptions :v:

And checked exceptions! :barf:

Dietrich
Sep 11, 2001

Sagacity posted:

Please, go on. Can you give a few examples of the extreme ideology?

Yes, heaven forbid you model your program as a class, as that might mean that hello-world type apps take a bit longer to write. Only a zealot would do such things.

leftist heap
Feb 28, 2013

Fun Shoe
I know when I think of extreme ideology in programming languages, I think of Java :v:

New Yorp New Yorp
Jul 18, 2003

Only in Kenya.
Pillbug

Dietrich posted:

Yes, heaven forbid you model your program as a class, as that might mean that hello-world type apps take a bit longer to write. Only a zealot would do such things.

But those extra 4 lines of boilerplate code are such a barrier to productivity!

Or, you can engage in ridiculous hyperbole like this acquaintance of mine:

Only registered members can see post attachments!

carry on then
Jul 10, 2010

by VideoGames

(and can't post for 10 years!)

I don't been know what to say. Wow.

Glimm
Jul 27, 2005

Time is only gonna pass you by

Ithaqua posted:

But those extra 4 lines of boilerplate code are such a barrier to productivity!

Or, you can engage in ridiculous hyperbole like this acquaintance of mine:



Wat. Did your acquaintance create a GUI "Hello World" and build the interface by hand, as well as, I don't know - lots of other stuff?

I haven't used much C# but that just doesn't make sense.

ManoliIsFat
Oct 4, 2002

Jesus christ, what the hell did he do to that thing!? Does he mean like the WPF template has 18 files? Still, what a crappy metric.

JawnV6
Jul 4, 2004

So hot ...
I dunno, seems about right for a naive 'wc -l *.cs'? Assume you're running the HTTP server under C# too. The kind of LOC count where you're grabbing all the whitespace too, not counting semicolons. As disingenuous as you could possibly be. Not that I'd know anything about that.

New Yorp New Yorp
Jul 18, 2003

Only in Kenya.
Pillbug

Glimm posted:

Wat. Did your acquaintance create a GUI "Hello World" and build the interface by hand, as well as, I don't know - lots of other stuff?

I haven't used much C# but that just doesn't make sense.

He probably created an ASP .NET application and chose one of the built-in templates, which does generate a ton of files and code... but it's a full demo application (including database back-end and authentication), so regardless, he's dumb.

He's also one of those anti-"Micro$oft" zealots.

astr0man
Feb 21, 2007

hollyeo deuroga
Why does he need five lines to do
PHP code:
echo "Hello world!";

New Yorp New Yorp
Jul 18, 2003

Only in Kenya.
Pillbug

astr0man posted:

Why does he need five lines to do
PHP code:
echo "Hello world!";

I don't know, but keep in mind this is someone who will blindly consider PHP and ColdFusion to be better platforms than .NET based only on how many files and lines of code it takes to write "Hello World".

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

astr0man posted:

Why does he need five lines to do
PHP code:
echo "Hello world!";

That isn't a complete PHP program. Without the opening and closing tags it will fail to run, even on the command line.

astr0man
Feb 21, 2007

hollyeo deuroga
PHP code:
<?php echo "Hello world!" ?>
is still one line :v:

Deus Rex
Mar 5, 2005

and
PHP code:
<?= "Hello world" ?>
doesn't even contain any statements :colbert:

Internet Janitor
May 17, 2008

"That isn't the appropriate trash receptacle."
Just drop the tags and have:
code:
Hello World
Look at all you guys with your excessive boilerplate.

carry on then
Jul 10, 2010

by VideoGames

(and can't post for 10 years!)

Pretty sure HQ9+ is better in that regard.

code:
H

Simulated
Sep 28, 2001
Lowtax giveth, and Lowtax taketh away.
College Slice
One of Java's problems is lack of function pointers/delegates/lambdas/blocks/whatever-you-call-it. That leads directly to code spaghetti and a million lines of boilerplate. That ties back into the methods-as-state problem in my mind... If you can pass bits of executable code around cleanly, it makes it easier to design and use objects properly. Java directly requires what those posts were partially about... Creation of useless stupid objects just to hold a method.

Lack of mixins/extension methods/categories is yet another thing that forces you to either layer on the boilerplate in your own project or makes the API so filled with factories and interfaces as to approximate a Rube Goldberg machine.

Type erasure is also 100% inexcusable. Unfortunately it handicaps the entire feature if you want to do anything even halfway dynamic or interesting with generics.


Java does suck. I'm sorry if that's what you learned in school or are forced to use at your soul-sucking corporate job. That doesn't change the fact that it sucks.



Edit: sorry folks, I should have paid closer attention. I am not defending Pollyanna's statement. Leaving the rest of my post here for posterity because I never pass up an opportunity to poo poo on Java.

Simulated fucked around with this message at 23:07 on Dec 16, 2013

New Yorp New Yorp
Jul 18, 2003

Only in Kenya.
Pillbug

Ender.uNF posted:

One of Java's problems is lack of function pointers/delegates/lambdas/blocks/whatever-you-call-it. That leads directly to code spaghetti and a million lines of boilerplate. That ties back into the methods-as-state problem in my mind... If you can pass bits of executable code around cleanly, it makes it easier to design and use objects properly. Java directly requires what those posts were partially about... Creation of useless stupid objects just to hold a method.

Lack of mixins/extension methods/categories is yet another thing that forces you to either layer on the boilerplate in your own project or makes the API so filled with factories and interfaces as to approximate a Rube Goldberg machine.

Type erasure is also 100% inexcusable. Unfortunately it handicaps the entire feature if you want to do anything even halfway dynamic or interesting with generics.


Java does suck. I'm sorry if that's what you learned in school or are forced to use at your soul-sucking corporate job. That doesn't change the fact that it sucks.

Those are all reasons why C#/VB .NET are better than Java, no doubt. But Pollyanna's statement that's drawing so much derision could just as easily be applied to .NET as to Java. There are plenty of reasons that Java sucks, but the amount of boilerplate you need in order to write Hello World isn't one of them.

JawnV6
Jul 4, 2004

So hot ...

Ender.uNF posted:

Java does suck. I'm sorry if that's what you learned in school or are forced to use at your soul-sucking corporate job. That doesn't change the fact that it sucks.

How many years of experience are you putting behind this opinion? How much experience with better languages that inform you of the tradeoffs and options available to a language designer?

Pollyanna's basing it on a couple weeks, a few blog posts, and the 3 lines of boilerplate for Hello World. Don't devalue your opinion by viewing this as a team sport and rallying behind the other person saying the same thing.

Nobody's defending java. Nobody's questioning that it sucks. We're questioning Pollyanna's strong stances on what we all know to be unsound footing.

..btt
Mar 26, 2008

Glimm posted:

Wat. Did your acquaintance create a GUI "Hello World" and build the interface by hand, as well as, I don't know - lots of other stuff?

I haven't used much C# but that just doesn't make sense.

Here is the (complete) C# hello world example from MSDN:

code:
public class Hello1
{
   public static void Main()
   {
      System.Console.WriteLine("Hello, World!");
   }
}
I cannot imagine what batshit insane tutorial he was following. Perhaps "C# for Enterprise Java Developers"? :v:

Factor Mystic
Mar 20, 2006

Baby's First Post-Apocalyptic Fiction

Ithaqua posted:

But those extra 4 lines of boilerplate code are such a barrier to productivity!

Or, you can engage in ridiculous hyperbole like this acquaintance of mine:



Ha, I want to get this guy's reaction to making a hello world program in Rails.

Dren
Jan 5, 2001

Pillbug
Poor Pollyanna just wants to unleash poorly founded vitriol about Java is that so wrong?

shrughes
Oct 11, 2008

(call/cc call/cc)
Things would just be so much better if we got rid of Java and made an intuitive visual programming language.

Adbot
ADBOT LOVES YOU

Simulated
Sep 28, 2001
Lowtax giveth, and Lowtax taketh away.
College Slice

Ithaqua posted:

Those are all reasons why C#/VB .NET are better than Java, no doubt. But Pollyanna's statement that's drawing so much derision could just as easily be applied to .NET as to Java. There are plenty of reasons that Java sucks, but the amount of boilerplate you need in order to write Hello World isn't one of them.

My apologies, I edited my post. I wasn't paying attention to post history on that one.

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