A
A
ANtlord2015-05-05 23:38:27
Programming languages
ANtlord, 2015-05-05 23:38:27

Is static typing useful in web programming?

Good afternoon! I do not expect a specific answer, and a number of links to what should be read will suit me perfectly if the question is absolutely not correct.
Recently, I thought about what the backend for web services is generally written on. Basically it is Python, Ruby, PHP, JS. These are all loosely typed languages, and having gained experience in developing a fairly large project (~8000 lines) and a large team, 7 people, including me. I noticed that quite often there are errors related to the fact that a variable of the wrong type came in, as expected, and all because the programmer did not check the part of the project in which the error occurred, or checked it, but with other incoming data. I know things like this can be solved with unit testing. However, it often happens that there is no time for it. And I know that the data type in the aforementioned PLs can be checked and asserted. But static typification, it seems to me, is still better at solving such problems.
I thought about using a programming language (PL) with static typing and saw that Java is quite popular for the backend, however, as far as I understand, it overtakes Python in terms of memory consumption. The situation with C# is not clear to me. I saw there is a Nancy project which, thanks to Mono, can be run on Linux. I also know that D, Rust, Go have web frameworks. More precisely, D has a framework for creating applications for processing asynchronous requests, but these projects are still risky to use in production.
After all this, I thought that static typing in web development is not practical, or is everything a little more complicated? I mean, maybe after a certain stage, part of the functionality goes into libraries written just in PL with static typing.
Thanks in advance!

Answer the question

In order to leave comments, you need to log in

4 answer(s)
S
sim3x, 2015-05-06
@sim3x

It’s about the developers of the
PL They don’t need stat typing - they don’t make shitty mistakes
Transferring the type checking functionality to frameworks ~ crutches with rhinestones
And in erlang they went further, you can’t rewrite the variable value at all
However, it’s a utopia to consider that strict typing will allow you to abandon unit tests

M
Maxim Kuznetsov, 2015-05-06
@max-kuznetsov

Perhaps this article will help you: habrahabr.ru/post/161205

S
Sergey, 2015-05-06
@begemot_sun

In fact, static typing is needed always and everywhere. Another issue is that the programmer should not declare types on his own, the compiler should deal with this (infer types from the program itself).

I
iscateli, 2021-09-03
@iscateli

Depends on how much time you are willing to spend on testing. In a large project, the difference becomes very significant.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question