The tag has no wiki summary.

learn more… | top users | synonyms

3
votes
2answers
222 views

Parameterized Java Types (Generics)

Consider this "legacy" code: public interface IPersistentCollection { IPersistentCollection cons(Object o); } Genericized in Java, it could become something like this: public interface ...
2
votes
1answer
71 views

How to define different names for the same type and have the compiler check them? [duplicate]

I would like to define several names for the same type and have the compiler distinguish between them. My motivation is that different int variables could represent very different units, and I would ...
16
votes
2answers
641 views

C++ strongly typed typedef

I've been trying to think of a way of declaring strongly typed typedefs, to catch a certain class of bugs in the compilation stage. It's often the case that I'll typedef an int into several types of ...
4
votes
1answer
238 views

What is the evidence that an API has exceeded its orthogonality in the context of types?

Wikipedia defines software orthogonality as: orthogonality in a programming language means that a relatively small set of primitive constructs can be combined in a relatively small number of ways ...
0
votes
1answer
178 views

Can JSP Expression Language provide type safety like scriptlets in Eclipse IDE?

Almost everywhere you can read that you should use EL instead of scriptles in JSP. And I agree that you should not use any JAVA code in JSP except for calling getter methods on model objects. This is ...
5
votes
2answers
977 views

Should I feel “uncomfortable” using auto in C++? [duplicate]

C++11 features the new auto type declaration, allowing you to work with an object without ever knowing its actual type. I use only strongly typed languages - C++, Delphi (Object Pascal), Go, etc and ...
0
votes
1answer
142 views

Type Safety of Spray.io

Yesterday I read a tweet disparaging Jersey with JAX-RS due to run-time errors. Spray.io was mentioned in the tweet: Not even 5 minutes using Jersey / JAX-RS and already a runtime error due to a ...
0
votes
0answers
219 views

Changing method signature for implementing classes in PHP

Is there any decent work around to PHP's lack of Generics that allow static code inspection to detect type consistency? I have an abstract class, that I want to sub-class and also enforce that one of ...
40
votes
8answers
3k views

What are the safety benefits of a type system?

In JavaScript: The Good Parts by Douglas Crockford, he mentions in his inheritance chapter, The other benefit of classical inheritance is that it includes the specification of a system of types. ...
6
votes
2answers
152 views

Abstracting user interface from domain

My course text suggests creating a 'facade' class to completely abstract the user interface from the domain layer. That is, the UI uses only basic types, and if it needs a reference to a domain ...
81
votes
18answers
8k views

Is it poor programming practice to pass parameters as Objects? [duplicate]

So, we've got a guy who likes to write methods that take Objects as parameters, so they can be 'very flexible.' Then, internally, he either does direct casting, reflection or method overloading to ...
16
votes
5answers
1k views

Would it make sense to use objects (instead of primitive types) for everything in C++?

During a recent project I've been working on, I've had to use a lot of functions that kind of look like this: static bool getGPS(double plane_latitude, double plane_longitude, double plane_altitude, ...
3
votes
3answers
1k views

Is Google's Go a type-safe language?

this page http://golang.org/doc/go_faq.html writes: although Go has static types the language attempts to make types feel lighter weight than in typical OO languages So my question is ...
40
votes
21answers
12k views

Is type safety worth the trade-offs?

I began coding in in Python primarily where there is no type safety, then moved to C# and Java where there is. I found that I could work a bit more quickly and with less headaches in Python, but then ...
14
votes
5answers
4k views

What arguments are there in favor of weak typing?

This came up in a discussion with a friend, and I found myself hard-pressed to think up an any good arguments. What benefits do weak typing confer?