HACKER Q&A
📣 999900000999

Are strongly typed languages better for large scale projects?


If not, how do you manage a large scale code base ?


  👤 thesuperbigfrog Accepted Answer ✓
My opinion: Yes, strongly-typed languages are better for large scale projects because they help to detect errors earlier and, if used correctly, better document how the project was designed to work.

Ada is a very strongly-typed language and is great for large-scale projects.

"Underlying Ada's design are principles that include the following:

Readability is more important than conciseness. Syntactically this shows through the fact that keywords are preferred to symbols, that no keyword is an abbreviation, etc.

Very strong typing. It is very easy to introduce new types in Ada, with the benefit of preventing data usage errors.

It is similar to many functional languages in that regard, except that the programmer has to be much more explicit about typing in Ada, because there is almost no type inference.

Explicit is better than implicit. Although this is a Python commandment, Ada takes it way further than any language we know of:

There is mostly no structural typing, and most types need to be explicitly named by the programmer.

As previously said, there is mostly no type inference.

Semantics are very well defined, and undefined behavior is limited to an absolute minimum.

The programmer can generally give a lot of information about what their program means to the compiler (and other programmers). This allows the compiler to be extremely helpful (read: strict) with the programmer."

https://learn.adacore.com/courses/intro-to-ada/chapters/intr...

https://learn.adacore.com/courses/intro-to-ada/chapters/stro...

Strong typing is also great for optimization since it gives the compiler much more information about what is allowable for a given type or how it should be represented / implemented.


👤 freemint
Strong types are an obvious and IDE parseable way to express limited contracts with in the application. There are different methods with stronger and weaker level of that. There are codebases where they add a lot of value. In other big code bases strong types add no value or negative because they are to strong or to weak. For many applications they help.

Other ways to manage large code bases include TDD with sufficient unit tests (can give more insight then just type errors).


👤 verdverm
Given that two of the most widely used untyped languages have introduced typing, one might logically conclude strict typing is helpful. I doubt the scale matters here

(Python & JS -> TS)