How do you program differently in dynamic languages?

前端 未结 15 1501
南笙
南笙 2021-02-01 03:37

How would someone who really knows how to take advantage of dynamic programming languages approach programming differently than someone working in a static language?

I

相关标签:
15条回答
  • 2021-02-01 04:13

    My biggest gains are in mapping between databases and objects (ORM).

    If there is no concept of a type, it becomes very easy to say assign every column in a row to a value in an object. Of course the trade off is that there can be a mismatch between the type of value you think is there and what type the computer does.

    0 讨论(0)
  • 2021-02-01 04:13

    I can't cite this right now (my memory is failing me), but I've heard something along the lines of:

    The closest the programming industry has come to a silver bullet is managed languages – freeing the programmer from having to worry about the details of memory management and letting them focus more energy on solving the problem at hand.

    So, I might venture a guess and say it's not so much that you program differently, it's that you can devote more of your brain to "solving the problem" rather than the solution's implementation details.

    0 讨论(0)
  • 2021-02-01 04:17

    Dynamic languages are capable of executing code which was created at run-time. This is very dangerous if malicious code is injected. But very powerful if you can sanitize the environment.

    I think Javascript people do this by executing JSON files.

    0 讨论(0)
提交回复
热议问题