The problem with user filters on forums is that I always end up unfiltering them because someone replies to the person that I filtered and I can't understand the conversation without reading the filtered comment.
It would be weird some people could be filtered bymost of the people there and then they wouldn't know what the hell was going on. I dont think filtering is necessary, you can do it in your head easier...unless you dont want to know what someone said because it drives you crazy in some way, then its you who has the problem.
EDIT: Parallelograms are the coolest shape, if i was a parallelogram all the other shapes would look up to me.
about the discussion before the shapes, Cire, your posts really matched my thoughts about the topic :P Lets keep this forum cplusplus.com and not cplusplusandsomejavaandmaybesomeassemblywhileweareatit.com
I (probably) only object in principle. In practice, I doubt such threads would amount to any significant volume, and I'm perfectly fine with that, but I would be remiss if they did and I said nothing. I would've said nothing if some of the posts weren't implying enough traffic to justify another forum.
You guys never consider that c++ is just better than Java and the people who use c++ are better than the people who use Java, and therefor you can not have a good java site :)
I know Java and C++ both pretty well, and while C++ is still my personal favorite, that's only because I use it more often and it was the first language I learned.
I like Java for its massive standard library; if there's something you want to do, either you can do it right away in Java or you have to link to a C library in C++. Java is very practical for a lot of things, it's just not meant for making games. I also really like reflection, I just wish it were implemented better in the language than it currently is.
I like C++ for it's fine control over inheritance (multiple & virtual inheritance, public/private/protected inheritance, private pure virtual functions, concrete pure virtual functions) along with a lot of other C++-only features (references, rvalue references, templates, template metaprogramming, const correctness is a big one, pointers to members, etc.) Operator overloading is also a nice plus, but I think it is too easily abused or misunderstood.
And, of course, Java and C++ are used for different reasons, therefore you can't say one is better than the other unless you're talking about a specific use.
Java has templates, though they are called generics: Vector<Integer> vect = new Vector<Integer>();
Or
1 2 3 4 5 6 7
class CustomClass<E extends Comparable<E>>
{
E myData; // Compile error if E does not implement Comparable
int check(CustomClass other)
{ returnthis.E.compareTo(other.e); }
}
Though, you cant make a generic array without "unsafe" casting.
Java generics are everything but templates. If you're new to Java they may seem the same, but they're extremely different.
Java generics:
-Are syntactic sugar for compiler-generated casts
-Don't exist at runtime
-Can't be used for overloading methods
-Can't be specialized
-Can only take a class type
-Aren't actually typesafe
Not true. They are first-class part of the type-system and the compiler can reason about them. They are just compile-time only.
-Don't exist at runtime
Only partially true. They do exist at runtime in a way you can query for types of generic inherited classes and interfaces. And generally this is not a problem and very easily workaroundable.
-Can't be used for overloading methods
Don't know what you mean by this. If you need to overload by different types of generic type T, then your design is screwed anyway. I never needed it and I wrote hundreds of thousands of lines of code.
-Can't be specialized
No need for that. JVM can specialize them (I'm not saying the mainstream implementations do, but it is certainly possible and works in some research-JVMs). This is like saying you can't specialize variables in C++, i.e. force the compiler to put them into given named register.
-Can only take a class type
Fixed in Scala.
-Aren't actually typesafe
As long as you don't deliberately cast the typesafety away by casting them onto non-generic classes - they are.
On the other hand:
+ They allow for separate compilation.
+ They allow for type bounds specification.
+ They offer much better error messages.
+ They don't cause code bloat
+ (only in Scala) Proper covariance handling: List[Int] is a List[Any]; in C++ it is not.
+ They play nice with IDEs, e.g. autocomplete.
+ They play nice with debuggers.
Contrary, C++ templates are not even a part of the type-system, but just a dumb textual replacement. They don't even hit the typechecker, so you can write incorrect code and it will compile. It is like duck typing.
@rapidcoder: You must be confused, I was explaining why Java generics weren't the same as C++ templates. You seem to be attempting to prove every one of my points wrong - are you saying java generics and C++ templates are the same?
rapidcoder wrote:
Contrary, C++ templates are not even a part of the type-system, but just a dumb textual replacement. They don't even hit the typechecker, so you can write incorrect code and it will compile. It is like duck typing.
And duck typing is bad?
Also, some of your points don't make sense or are otherwise invalid. For example: "[generics] play nice with IDEs, e.g. autocomplete." I'd like to know why you would try using autocomplete with C++ templates in an IDE that didn't fully support them.