Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [strong-typing]

The tag has no usage guidance.

0
votes
0answers
54 views

Apply Value Object (Stringly Typed) in PHP

What is the best way to prevent wrong states in an object? This is the source of my question. Basically my curiosity started with the intention of not letting a class exist with wrong values. Prevent ...
2
votes
4answers
215 views

“Duck-type-y” interface/implementation

I do not know the "correct" name of that pattern, so I'd like to describe it with a simple example. In C#, System.Windows.Window contains a ShowDialog method. I can define an interface containing ...
-2
votes
1answer
73 views

Should I use a strongly typed programming language for an integration with a JSON RPC 2.0 API?

I have to integrate with another company's API, which they unfortunately decided to write in JSON RPC 2.0. If you're not familiar with JSON RPC, it's a lightweight RPC protocol that defines a ...
53
votes
10answers
8k views

Why do mainstream strong static OOP languages prevent inheriting primitives?

Why is this OK and mostly expected: abstract type Shape { abstract number Area(); } concrete type Triangle : Shape { concrete number Area() { //... } } ...while this is not OK and ...
9
votes
3answers
540 views

Taking strong, static typing to an extreme? [duplicate]

It is common in strong, static typing to use different types even for variables with simple, primitive types to ease static analysis and indicate intent to the programmer. A color and a point in 3D ...
2
votes
2answers
130 views

Optional Member Data

I am creating a strong binding of an XML specification and I am essentially trying to "flatten" the specification as much as possible, so that it won't feel like you are manipulating an XML tree. ...
2
votes
2answers
148 views

Should ids be mapped to the implementation type

This is a question of model design, and hopefully some architecture nerds have strong opinions on this. I've been developing one that I will post in an answer. Typically, in every codebase I've ever ...