Skip to main content
Share Your Experience: Take the 2024 Developer Survey

Questions tagged [strong-typing]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
73 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
4 answers
311 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 ...
-1 votes
1 answer
288 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
10 answers
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
3 answers
663 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
2 answers
185 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
2 answers
158 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 ...