Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

float x = 1 or float x = 1.0f

Name: Anonymous 2013-01-13 19:55

are there any benefits for the second?

Name: Anonymous 2013-01-13 21:45

FloatingPointFactory.createFloatingPointNumber(1.0f);

Name: Anonymous 2013-01-13 21:46

>>6
That's not how factories work. As much as I hate Java and ENTERPRISE bullshite, I'd wish people stopped making unfunny jokes about that.

Name: Anonymous 2013-01-13 22:06

>>7
How would a FloatingPointFactory work, then?

That's exactly how factories work.

The joke is that only an ENTERPRISE Java code monkey would think the best way to work around problems caused by ENTERPRISE bullshite is to create more ENTERPRISE bullshite.

Name: Anonymous 2013-01-13 23:43

>>8
A FloatingPointFactory would work something like this:


FloatingPointFactory floatingPointFactory = new DigitBasedFloatingPointFactory();
DigitBasedFloatingPointFactory digitBasedFloatingPointFactory = (DigitBasedFloatingPointFactory)floatingPointFactory;
digitBasedFloatingPointFactory.setBase(10);
digitBasedFloatingPointFactory.beginNumber();
digitBasedFloatingPointFactory.pushDigit(3);
digitBasedFloatingPointFactory.pushDecimalPoint();
digitBasedFloatingPointFactory.pushDecimal(1);
digitBasedFloatingPointFactory.pushDecimal(4);
digitBasedFloatingPointFactory.pushDecimal(1);
digitBasedFloatingPointFactory.pushDecimal(5);
digitBasedFloatingPointFactory.endNumber();
FloatingPointNumber pi = floatingPointFactory.createCurrentNumber();
return pi;


The problem with your example is that you entered a floating point number as an argument. It's a chicken egg dilemma.

Name: Anonymous 2013-01-13 23:45

>>9
I was just being lazy, but I like this more.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List