« first day (1546 days earlier)      last day (3409 days later) » 

11:02 AM
So, I should implement it throwing an UnsupportedOperationException? Then why isn't there a default implementation like that?
 
fge
@Jefffrey no idea; they probably could have done it, like they did for Iterator's .remove() in Java 8
An overlook, probably
 
Java's approach to static type safety is weird in places. I mean, throw new UnsupportedOperationException()? Come on!
 
fge
@FredOverflow I don't understand what this has to do with type safety?
 
^
 
Hm, maybe replace "approach to static type safety" with "standard library design"? :-D
I dunno, it somehow feels like a type issue that you can implement an interface by throwing an exception.
But maybe that's just me.
I mean, I don't see much difference between throw new UnsupportedOperationException in a statically typed language and MethodNotFound in a dynamically typed language.
 
fge
11:10 AM
I certainly do see one
UnsupportedOperationException is certainly not the same than NoSuchMethodError
 
I simply don't think implementing methods should be optional.
 
@FredOverflow +1. Break the interface to smaller ones and implement just the interfaces you support. Not possible if we talk about standard library though, so +1 also to "standard library design"
 
fge
@FredOverflow frankly, I don't see the problem; the javadoc says that this operation is optional, although the wording could have been better, admittedly
 
public void addFred(List<String> list)
{
    // The following line compiles fine, but it may fail at runtime; we don't know.
    list.add("Fred");
    // I don't care if this is a library or a type system issue; it's just stupid.
}
@DominikM Okay, so at least I'm not insane. Or we're both crazy ;)
 
11:25 AM
wait what
What is the semantic of this?
Is the passed in array only used to deduce the type? If so, why can't you just call toArray<T[]>()? If not, then why are we returning the same array passed in? What is that method used for? If it's not used then why isn't it optional?
> If the list fits in the specified array, it is returned therein. Otherwise, a new array is allocated with the runtime type of the specified array and the size of this list.
WAT
 
@Jefffrey Because the type must be found out at runtime.
Java Generics. Deal With It.
 
> If the list fits in the specified array with room to spare (i.e., the array has more elements than the list), the element in the array immediately following the end of the list is set to null. (This is useful in determining the length of the list only if the caller knows that the list does not contain any null elements.)
WAAAAT
Stahp
> Like the toArray() method, this method acts as bridge between array-based and collection-based APIs. Further, this method allows precise control over the runtime type of the output array, and may, under certain circumstances, be used to save allocation costs.
You are killing me Java, stahp
 
@Jefffrey Are you making that up? Never heard of that particular aspect before.
 
@Jefffrey An array is not a type.
 
@FredOverflow I wish
 
11:29 AM
you can't use [] inside of a type-specifier.
because there is no array :(
 
@Vogel612 what
yes it is?
 
nope.
there is no array type
or rather... there is no [].class
 
wat
 
Right, but for every type X, there is an array type X[].
 
int[] is an array and is a type
 
11:31 AM
^^ which is not a real type @FredOverflow
you can't call X[].class
 
How is Customer[] not a real type?
 
fge
Not on a generic type, but on a concrete type you can
int[].class works
 
...
 
fge
T[].class where T is a type parameter doesn't
 
public static void main(String[] args)
{
    System.out.println(int[].class);
}
 
fge
11:32 AM
Deal with it, guys, this is how arrays were specified in Java from the start and there's no going back
 
class [I
 
Stop using confusing wording :S
 
@fge oh that's new to me...
 
fge
Stop complaining about Java's design if you want to program in Java; just deal with its pecularities
 
The word "type" has well-defined meaning
 
fge
11:33 AM
And please don't forget that Java was designed in the 20th century
 
@fge so was Haskell
Just stop using terms that mean different things already to describe your broken designs
 
@fge Okay, but you can still call getClass.
 
fge
It is a testimony to its designers' prowess that the language has evolved the way it was and still remains backwards compatible all the way back to Java 1.0
 
public static <T> void lol(T[] a)
{
    System.out.println(a.getClass());
}

public static void main(String[] args)
{
    lol(new Integer[42]);
}
 
11:34 AM
This just confuses everyone
 
@fge Isn't the 20th century from 1900 to 2000? If so, p much every language was design in that period.
 
@Jefffrey except F# maybe :)
 
fge
@BartekBanachewicz stop with that; if you don't like Java, what can I do about it? As I said, deal with its pecularities
 
@Jefffrey surprising, right?
 
fge
Shape up or ship out
 
11:35 AM
lel. I'm not going to use java, there's no reason for me to.
 
fge
Then what are you doing here?
 
I'm just suggesting you stop misusing words
 
^ agrees with fge
 
@fge "want" is a strong word
"must" is better in my case
 
11:36 AM
> Every array has an associated Class object, shared with all other arrays with the same component type.
 
@fge I'm just here for the braces and the semicolons.
 
@Vogel612 Which is generated at runtime, and can only be accessed via reflection.
For example, class [LCint is an array of integer.
 
fge
@Jefffrey then just deal with it
If you have questions we can answer them
 
Or quit the job, I prefer this option
 
@Unihedro I can't quit uni.
 
11:38 AM
@Jefffrey Aww.
 
@Unihedro Oh, that is interesting. Is there some sort of global "array type factory" that is maintained by the VM?
 
@Unihedro ikr
 
@FredOverflow Implementation detail, but yes, the JVM acts as a factory for "array types" to work in runtime as classes, but they are not classes.
Arrays are not classes.
However, do consider:
 
@Unihedro And yet, every array type inherits from java.lang.Object, right? Interesting.
 
fge
And the other language I do is... Yes, C
 
11:39 AM
static <T> T[] baz(T[] foo, Qux qux);
Here invocation of foo.getClass() within the method will work.
Don't try this at home though.
 
@FredOverflow well everything somewhere comes from java.lang.Object ;)
 
5 mins ago, by FredOverflow
public static <T> void lol(T[] a)
{
    System.out.println(a.getClass());
}

public static void main(String[] args)
{
    lol(new Integer[42]);
}
 
@FredOverflow Array types are not objects.
Therefore, array types do not inherit from java.lang.Object - runtime representation classes of them are.
 
fge
Arrays in Java are pecular beasts in any event
You can use foreach on them even though they don't implement Iterable, for one
But then that's how Java 1.0 designed them so tough luck
They are covariant, generics aren't
Etc etc
 
Generics are broken.
Especially when you step onto raw typing.
 
fge
11:42 AM
Yes, but again that's due to Java's initial design
 
Me wants Java 2.0.
 
fge
Nothing you can do about it
 
@fge No even to rant? :(
 
fge
What use will that be?
That can help you vent your frustration, but that won't help you code
 
@Unihedro How about Perl 6?
@fge You're such a pragmatist...
 
fge
11:43 AM
Of course I am
 
@FredOverflow Hey, I like Perl 6.
 
fge
I'm a programmer
 
@FredOverflow pragmatism is IMO better than Idealism..
 
Perl 5.2 was extremely chaotic and stupid, though.
 
you can't argue with an Idealist.
 
11:43 AM
@fge We'll just let you work and earn money while we discuss programming language design and eat frozen pizza for breakfast ;)
 
@Unihedro how about android? looks eagerly with big open eyes
 
It's like the developers have no idea where they want the syntax to go.
@DroidDev Hey, I do code Android apps.
Except I don't use the SDK and just go OpenGL.
@FredOverflow That sounds unproductive.
 
That's because it is.
 
@Unihedro oh! I never did anything in OpenGL, though want to do something in it
 
And unpleasant. :/
@DroidDev Tsk tsk tsk. :P
 
11:44 AM
@Unihedro Don't worry, I was just kidding. Actually, I had pasta for breakfast.
 
Lucky. I made instant noodles.
 
on the other hand, I had lunch for breakfast :P
 
:|
Unhandled exception: ClassCastException
 
Again, stupid Java design mistake. ClassCastException shouldn't even be possible.
 
@FredOverflow That has come from writing loads of Test Cases :P
 
11:48 AM
@Unihedro actually, an NPE occurred at breakfast time and I caught that exception at lunch time :P
 
Wait, hasn't Erik Meijer debunked Test Driven Design lately? :)
 
@FredOverflow Well, there's always a noob thinking they could parse a String with:
(int) (Object) "12"
 
I wanna make my own tutorials...
 
me too
Guess what?
 
What?
 
11:49 AM
Write great self-Q-&-As instead! You'll get points*!
 
@Unihedro If you made them I'd watch them, regardless of what they are for :P
 
*: If they're awesome
 
@DroidDev Exactly...
 
@Unihedro That doesn't even compile. How about this:
int answer = (Integer) (Object) "42";
 
11:50 AM
@Unihedro No, what I want is too extensive for a Q&A on SO...
And... I need to learn this stuff so that I can make the tutorial I want to have now
 
@Gemtastic You should totally learn Monads and then make a Monad tutorial.
 
@Gemtastic Then you can try rebuild devdoodle.
We have a tutorial section. :)
And it's INTERACTIVE
But it blacklists IE.
 
@FredOverflow lol
 
@Unihedro By rebuild, do you mean make a better site design?
 
@fge somehow not surprising
 
11:51 AM
I still have no idea if he was joking or not in that video.
 
@Gemtastic No, makea similar site
 
@fge FTR I haven't said a single thing about Java being bad, good, wrong, right, whatever. I just pointed out that the terminology you choose to use is confusing.
 
Heh, this site just extended the whole "You can do so much more with JS than it was originally designed for"
Well, I need to learn stuff first.
The annoying thing is that noone teaches you about the tools
 
@fge Java is the C of the JVM world.
 
fge
@BartekBanachewicz what can I do if the JLS calls them "type parameters"? I just use the Java terminology
 
11:53 AM
@Jefffrey nah, I had to carry my kiwi muffin back to the office so couldn't type
 
@Jefffrey No, he just left the room and came back. It happens.
 
which is probably one of the weirdest sentences I ever used in the chat
 
Ugh... QA girls are so annoying :-/ Placing programmers and QAs as neighbors was really silly idea <_<
 
@Jefffrey I don't timeout unless things go haywire.
 
Sound delicious
 
11:54 AM
@BartekBanachewicz And there I was, pondering "What the hell is a Wiki muffin?" :-D
 
Like "Here you can find the tools. These tools do this, these tools are for this" it's all "Here's a variable. Here's a function. Here's how you iterate through things. Yaay! No you have no clue about anything else but what I just told you."
 
@OlegKuznetsov How unfortunate. I have better experience with them.
 
@OlegKuznetsov I know that feel
 
@Jefffrey haven't tasted yet. It's the one in the photo. Got it for grand total of €0.46
 
@OlegKuznetsov Quake Arena girls?
 
11:55 AM
@FredOverflow Quality assurance, AKA testers
 
@FredOverflow I wish...
 
Or: The Tech Test Dept.
 
fge
@FredOverflow well yeah, I'm a "close to hardware" guy :p I even know one thing or two about how the JVM actually works :p
 
@Uni I could try to make a site, but I'll have to have it proofread to see if what I attempt to teach is correct >_>
 
fge
OK, I really don't like the new SO layout
 
11:56 AM
> An array is a container object
 
fge
Sorry to their designers
 
@fge me neither
 
hmpfh, that talks about array's value
oh look
> Like declarations for variables of other types, [an array declaration...]
 
fge
~interesting
 
@BartekBanachewicz In this context, "object" refers to an actual object in abstraction, not Java Objects as in java.lang.Object.
@BartekBanachewicz Array declarations are like type declarations because arrays are types.
 
11:58 AM
And boss has banned headphones at work... :( sigh
 
29 mins ago, by Vogel612
@Jefffrey An array is not a type.
see what I meant when I said "confusing" ?
 
@fge If by that you mean "I have typed javap -c into my terminal once or twice", then I also know how the JVM works.
 
@BartekBanachewicz An array has a type, but it isn't a type.
 
fge
@FredOverflow no, I know more than that
 
@BartekBanachewicz arrays are types != an array is a type
 
11:59 AM
lol
 
@fge You typed it thrice?
 
fge
Oh dear
 
@Unihedro Release is soon, so they are running around with their "Regression testing" chores
 
@Unihedro so two arrays are two types, but one array isn't one type
 
@fge How does invokeinterface work? I always wondered how they do it without vtables.
 
12:00 PM
seriously, you have to get this straight
 
fge
@FredOverflow simple... You pass it a reference to the type, the method signature, it will take its argument from the stack and invoke the method
 
I meant how is the method resolved.
 
Well, here: X[] is a type for all abstraction of X.
 
for all what
 
Why doesn't java have default arguments?
 
fge
12:01 PM
@FredOverflow look here if you're not convinced
 
user1804599
@FredOverflow It looks it up in a table.
 
@Jefffrey Because that would make the language more complicated.
 
user1804599
Default arguments are incredibly silly.
 
However, For foo of X[] for all abstraction of X, foo is not a type, it is an array!
 
@Unihedro I'd ask whether you redefined "forall" too, but I kinda take it for granted here
 
12:01 PM
@рытфолд invokeinterface is more expensive than invokevirtual, right?
 
@Uni could you explain it as "array is a collection of a certain type"?
 
user1804599
@FredOverflow depends
 
In predicate logic, a universal quantification is a type of quantifier, a logical constant which is interpreted as "given any" or "for all". It expresses that a propositional function can be satisfied by every member of a domain of discourse. In other words, it is the predication of a property or relation to every member of the domain. It asserts that a predicate within the scope of a universal quantifier is true of every value of a predicate variable. It is usually denoted by the turned A (∀) logical operator symbol, which, when used together with a predicate variable, is called a universa...
 
fge
~interesting
 
@рытфолд How about class X extends Y implements Z
 
12:02 PM
~interesting
 
Or maybe "bundle" would be a better word considering collection is a thing...
 
yeah, better to reinvent arbitrary meanings to words
 
fge
@FredOverflow as to how the method is looked up, that is dependent on the JVM implementation; nothing to see
There's a specification for the JVM too
 
user1804599
@FredOverflow doesn't have to be expensive if the implementation can prove statically that the object is an instance of X but not a proper subclass of X.
 
fge
OK, can we please get back to Java questions?
 
user1804599
12:03 PM
Then no lookup has to take place at runtime.
 
fge
This is the Java room here, not the "CS rant against Java" room
 
@рытфолд Yay JIT!
 
inb4 Java isn't CS
 
user1804599
JIT compilation is good.
 
Java is a potato.
 
12:04 PM
inb4 more cs rants
 
where by potato of course I mean all abstractions of potato
 
@BartekBanachewicz Hey, I like potatoes.
 
user1804599
VMs are good.
 
@Unihedro it's not a potato
 
user1804599
Always run everything in a VM.
 
12:04 PM
@рытфолд I wholeheartedly agree.
 
@рытфолд Even the VM itself?
 
user1804599
@FredOverflow Yes.
 
fge
Frankly, these rants are becoming sickening
 
@fge I do realize.
 
@рытфолд What language does that?
 
12:04 PM
@FredOverflow Yo dawg,
 
user1804599
I leave the hardware stuff to the hardware people.
 
I see VMs are good, so I made you a VM to run a VM in a VM with a VM where the VM runs on a VM.
 
user1804599
The part that doesn't run in a VM is the problem of the datacenter guys.
 
user1804599
But luckily not mine.
 
@BartekBanachewicz If you're interested about the all abstraction part, consider Limits in Maths.
 
12:06 PM
what about them?
 
lim x -> 0: 1 / x is a really really large number, but 1 / 0 is not.
 
sure, 1/0 isn't a number
 
fge
@BartekBanachewicz you don't seem to realize one thing: there is no point in coming to a room dedicated to a particular language just to rant about that language, moreover from a point of view which is yours and not related to any other one's point of view in any way, shape or form. If I were to do that I'd flood the python room with my rants
Instead, I act, I code, I produce stuff, and people actually use my stuff
 
@fge except the python community actually seems to be able to use actual reasoning when talking about their language
 
fge
12:07 PM
Hah
hrm
Not my experience
 
@BartekBanachewicz Well, an array isn't a type either. But arrays of X are, under all abstractions of X.
 
@fge I wish Java was pointless, so I could write a b c instead of a.b(c)
 
That one was overboard. :P
 
@fge Then stay away from Scala.
 
fge
@BartekBanachewicz Scheme
And, yeah, I did perl too
Call me insane
 
12:12 PM
@fge how did you like scheme?
 
@BartekBanachewicz Ha!
in Tavern on the Meta on Meta Stack Exchange Chat, yesterday, by Jan Dvorak
Why? The lounge is a bunch of foul-mouthed C-lovers anyways...
 
lol
 
fge
@BartekBanachewicz I liked the general design, what I didn't like is that to do actual, useful stuff in it it was a nightmare
I prefer to use "lesser" languages (in the view of language purists) and get stuff done
And Java lets me do everything I want, except low level systems programming where I use C
 
@fge there are people perfectly productive in other languages
 
@BartekBanachewicz Haskell?
 
12:15 PM
bartk pls
4
 
fge
I doubt any of them are run on big iron for serving millions of users a second though
Java is, C is
In fact, C runs everything
 
@BoltClock was that a slap
 
Holy cow it's JABBA!
 
Holy cow it's the PeeHaa!
@fge Will my fridge run on C?
 
12:16 PM
Sigh whatever I'll smurf out of here
:get it:
I'll annoy you again when mods are asleep
 
fge
@Unihedro I'll stay away from everything "connected" in my house except for computers, thank you very much :p
 
@BartekBanachewicz ಠ_ಠ
 
Who the heck is flagging
 
I have no idea.
They really should let Room Owners see flags.
 
@Unihedro I do
 
12:18 PM
@OlegKuznetsov It's... you? :O
 
Stop with the flagging, jesus.
 
But... I TRUSTED YOU!! Why??
 
eh? Dude came here to insult other users, so I think he "deserve" a flag and some "care" from mods, no?
 
@OlegKuznetsov No, flags are a pain in the ass for every 10k people in every SO chat. There are other tools that owners have to kick people if they go out of bounds.
Jesus christ.
For the love of god, don't flag.
 
@Jefffrey You should flag the flaggers for flagging.
Flaggers gonna flag.
 
12:31 PM
@FredOverflow It would probably notify myself as well because "SO.chat is well written", so yeah, no.
 
@FredOverflow FlagOverflow?
 
fge
Well, given the last hour's worth of messages, this is rather TrashOverflow
 
XD
 
@RobertGrant I don't even know how to flag, and I don't want to know.
 
fge
And I have a design problem to solve which is not easy
Grrr
 
12:37 PM
Weren't Design Patterns invented to help with that?
 
@Jefffrey Well, hm... Then, I'll ask some more stupid questions on SO, get 10k+ rep for that and will flag again. Deal? P.S. lack of moderation is what killed Google Wave <_<
 
wat
The idea is not to flag. Ever.
 
@fge I saw your very aggressive messages earlier; I find it best to ignore the conversation if I don't want to participate
But possibly that's me being overly unbelligerent
 
Hello Python'er! Welcome to the room of Java!
 
Actually I'm a Java person who mostly hangs out in a Python room :)
 
12:41 PM
hi
 
:O
 
fge
@RobertGrant I plead guilty; but I find it unjustified to complain about a language's design in a room dedicated to that particular language. There are other places for CS theorists, and the worst thing is, they don't always agree with one another
 
Fair enough :)
I'm the opposite: I love thinking about languages, and I doubt we'd have a Java 1.1+ if people didn't do that sort of thing (and much better than I could). It's not a perfect science, but it's very healthy I think.
 
fge
Well, blame the core principle of the Java language designers which is to absolutely avoid breaking backwards compatibility; Java has baggage, there's no denying that
But I can certainly credit said designers to be able to make the language evolve to what it is today
And STILL be able to run 1.0 code
 
E.g. I think Python's default argument thing is dumb, and it makes Python worse. But it gets lots of other things right.
 
fge
12:45 PM
Complaining is one thing; acting on flaws is another
I prefer people who act
 
But discussing != complaining. You need lots of discussion to do something properly, or decide whether or not it should be done.
 
@Jefffrey that idea is dumb
 
@fge Sorry, that's just our nature, complaining about C++ in the C++ room all the time, you know?
@fge If that is your philosophy, you must adore Brian Goetz. Have you seen his talks on lambdas and value types? He's a genius of backwards compatibility.
 
fge
Yes, I've seen this talk
 
It hink it was two separate talks.
 
fge
12:48 PM
And yes, I'm a fan of Mr Goetz, and yes, I want to see a JCIP v2
 
I fucking love this guy.
 
fge
I also love his stance on Serializable :p
 
I didn't realize he was talking at a Clojure conference :)
 
Gotta love the JVM.
 
except for the not-being-aware-of-Generics part
 
12:52 PM
Yeah, type erasure is probably the worst thing about it all
But so much stuff is awesome
 
Oh, I wasn't aware of this talk:
 

« first day (1546 days earlier)      last day (3409 days later) »