


When we programmers start a project, one of the key decisions we need to make is to choose a language, or a set of languages, to use to implement the system. This decision affects not only the implementation of the system, but also the design. For example, should we use an object-oriented language or a procedural language? The choice of language has a profound impact on the project and the life cycle of the program that is part of the project. Many times, we choose a language without thinking too much based on some very fickle factors: this language is what I usually use to implement this kind of Systematic; I know this language best; it is my favorite language and I enjoy programming in it; etc.
Since this decision will lead to profound and long-term consequences, shouldn’t we be more pragmatic when making this decision? Too often, we are blindly biased by the language we choose. And, sometimes the reasons why we don't like choosing that language may be the very reasons why we choose that language.
If we can open up and be honest about our biases, then we can alleviate some of the pain of trying to fit a square peg into a round hole when decorating. While there is no secret to choosing the perfect language for your project, there are some principles that can help us make a better, more appropriate language choice.
There is no perfect language
This is to be expected of anyone, even a newbie, and many of us are willing to admit, “Of course, this language is not a perfect language,” but At the same time, many of us still say, "This language is the best programming language." The key to saying a language is the best language for a project is the context of the project, that is, the best language only exists within a certain scope. This is our first principle:
There is no perfect language: every language has its advantages and disadvantages.
For example, many developers who typically use runtime languages such as Java or Python claim that C or C++ is breathless because they focus on low-level details such as memory management, or care about compile-time types Strict granularity of inspections while stifling decentralized responsibilities on developers. This is true as long as the project we are developing does not focus on seemingly trivial tasks such as memory management or the number of copy-assignments that occur in a single loop.
Conversely, if we work on a project, or part of a project, it is natural to have biased needs for how efficient the code should be and how critical and safe the program is, these seemingly tedious details may be exactly the level of granularity we are looking for . In this new context, the runtime nature of Java or Python seems too uncaring or too absent-minded. Instead, we want to be able to strictly control how many move-assignments and copy-assignments are executed when memory is allocated and freed, and catch as many errors as possible at compile time, rather than letting errors leak into the runtime (shown as runtime abnormal).
While in theory "no language is perfect" sounds obvious, our behavior as developers often departs from this concept: we say we know our favorite languages are imperfect, but we still Continue to use this language for the projects we develop, regardless of whether it is appropriate. Furthermore, when another developer questions our choice of language, we vigorously defend our choice rather than see the truth in his or her rebuttal. Remember: every language has its pros and cons. Understand the strengths and weaknesses of the languages you master and then make your choice based on your situation.
The reason you don’t like a language may be the reason you should use it
It may seem counterintuitive, but sometimes, the reason we don’t like a language may be the reason why we use it. Still with the above example, in my experience as a C++ developer, many times it takes too long to complete a project because there are so many different concepts to keep track of (memory management and object lifetime, the three principles of C++ programming, etc.) A simple function can become cumbersome. After a few weeks of developing in C++, using Python, Java or another "higher" language can feel like a godsend: but is it really so?
Sometimes, maybe the reason we don’t like a language is the reason why we use it. If I were developing a driver or some safety-critical, real-time system, the reasons stated above for being cumbersome might just be the greatest advantage of this language. For example, C++ provides a mechanism for expressing logic that is executed when an object is copied, which is invaluable when efficiency and rigor are in order.
This may all look good and great, so it’s hard to pinpoint a context in which a language you don’t like might be more helpful. So, how do we know which languages you don’t like are helpful? This brings us to our second principle:
Be honest with yourself: know why you don’t like a language, and don’t dogmatize your dislikes.
For example, in the C++ example above, the reason why I don’t like to program in C++ for a long time is because this language requires rigorous thinking, otherwise it is easy to make mistakes, just like being trapped in the jungle ( Focusing too much on the trees rather than the forest as a whole). This rigor prevents developers from questioning things like, "Am I creating objects on the stack or on the heap, or partially on the stack and partially on the heap?" or "To make this class extensible, it should be through templates." Parameters or inheritance?" and so on. In other languages, developers can accomplish these tasks by simply creating an object each and using object-oriented inheritance, and then move on to the next feature because the language (or, more accurately, the compiler or interpreter) takes care of these tasks. detail.
But if I'm honest with myself, I will admit that the reason I don't like these features of C++ is because it puts the onus on me to express these details. In other languages, not only am I not responsible for these details, but I also don't have the responsibility to express them: they are abstracted away from the developer. In a context where these details are essential, the reasons I don't like C++ are exactly the reasons I should use this language.
Does this mean we should frown and use features that make us irritated by the language? It's not necessary either. Maybe you can look at it another way: instead of seeing these features as drawbacks, maybe we should embrace them as necessities to get the job done. Instead of saying, “What a tragedy,” we should say, “Thank God I can do this in this language.” Remember: in some contexts, these capabilities will be a gift, and In other cases, they are a liability. Be honest with yourself about why you don't like a feature of a language.
The more familiar you are with other languages, the better
For this, here is the third principle we want to talk about:
If the only tool you have is a hammer, then every problem will look like a nail.
This rule does not apply to software engineering, but it sharply characterizes many software development situations. Many times, we choose a language, or a language-supported tool (such as Java's JMS, Python's ASYNCIO, Rails' Ruby, etc.) because we know they exist. If the only language we are familiar with is Java, then we will adapt all the problems we encounter to the context of Java. For example, "I need to create a routing framework for a communications application. How do I do this in Java?" This limits the tools available to us and artificially limits our ability to choose the right tool for the job.
The solution to this problem is to expand your horizons and understand the capabilities and intricacies of other languages. As Andrew Hunt and David Thomas suggest in "The Pragmatic Programmer", a good practice is to learn a new language every year. It's not as easy as it sounds, and learning a language will mean different things to different people. Another derivative problem is that we often only use this one language for ongoing projects, making learning another language useless. For example, if I'm an Android developer and basically only use Java every day, learning C# might seem like an untimely waste of time.
Don’t be fooled by illusions. The advantage of learning another language is that we can see a problem from a different perspective and use the tools that are best suited to the problem. In order to do this, we have to learn the caveats associated with other languages and the way developers use those languages to solve problems. For example, if a developer wants to perform metaprogramming in C++, then he or she can use Template Metaprogramming (TMP) in C++, but he or she can also use reflection in Java. Understanding how other languages solve similar problems reduces the risk of us deeming it useless.
As another example, if we need to be able to change the runtime characteristics of a class, a C++ developer who is deeply familiar with the intricacies of C++ may be tempted to concoct a solution that stretches the boundaries of this compile-time language. And another C++ developer, who also has some knowledge of Java, is able to say, "I like C++, but Java's runtime reflection is better suited to solve this problem."
Because there are so many programming Developers have the choice of language, so it is important to prioritize which languages to learn. You might as well start with the most popular languages today (please refer to "most popular languages on Github", "Language Trends on Github", "The 9 most popular computer languages", "according to the Facebook for programmers", etc.).
Language is a means, not an end
This is the fourth and final principle, which may sound the most philosophical, but it can also be said to be the most important:
Programming languages are a means, not an end.
Unless you are the author of a language standard or the author of a compiler, you should treat programming languages as a means rather than an end. The purpose is to complete the project: the ultimate goal is to complete the project, not Use specific language. This doesn’t mean that every developer doesn’t have the right to demand what he or she likes or dislikes about the language (in fact, if we’re honest with ourselves, these likes and dislikes can work in our favor; see the second principle above) , but we shouldn't fool ourselves into making decisions like, "This is a great opportunity for me to use this feature of the language," unless the features of the language truly fit the needs of the project.
It’s important to remember that language is just a way of expressing how to solve the problem at hand: make sure you choose the language that best expresses the problem domain you are solving.
Other things to consider
Here are some additional things we need to consider when choosing a language:
Consider how the language interacts with other languages. For example, if you decide that Python is the best language for most projects, but there is a well-defined component in your project that requires an extremely high level of granularity or efficiency (which would be better suited to C or C++), that doesn't mean You cannot use Python on this project. Instead, consider using Python, writing a specific component in C or C++, and then using the Python C API to interface to this component. Note that to formulate such a solution we need to know that Python has a C API; therefore, it is helpful to know these features of the most popular languages.
Middleware can allow the use of multiple languages. For example, if you have two applications that must communicate, such as a mobile device and a server application, this does not mean that they must use the same language (of course they can be the same if you decide that is the best decision ). If the mobile device is an Android phone, and the server application is perfectly suited as a Python application, then using a message broker such as RabbitMQ allows you to communicate using both languages at the same time: the Android application can use Java RabbitMQ API, while server applications can use Python RabbitMQ API.
Embrace the quirks of other languages. If you are a Java developer, then you will use packages to separate logical units of source code; if you are a Python developer, then you will use Python's package structure to do the same thing; if you are a C++ developer personnel, then you would use a namespace or prefix the class name (i.e. "DZone_MyClassName"). Understand the special features of the language you're speaking and embrace them: in Rome, do as the Romans do. Otherwise it would be like speaking German with an Italian accent because you prefer the Italian pronunciation of words, which would sound nondescript. Of course, it is also possible that a feature of a language has existed for a long time, but in this case, there must be a reason: make sure you understand the reason.
Original English text: Do Not Marry a Language: Selecting the Correct Language for the Job

如何在Windows10或11上检查PHP版本在学习本教程之前,请确保已在您的Windows系统上正确配置PHP。除此之外,您还需要一个命令提示符或终端访问权限。使用命令提示符或Powershell检查PHP版本识别已安装的PHP版本的最好和最简单的方法是使用其命令行工具。但是,要使用,用户必须有权访问Windows命令行应用程序,如CMD。转到Windows10或11搜索框并键入CMD或Powershell。您可以使用其中任何一个。当图标出现在这些

Python 已成为最流行的 Web 开发编程语言之一,这要归功于它的简单性、多功能性以及大量的库和框架集合。在使用 Python 构建 Web 应用程序时,开发人员有多种选择,从 Django 和 Pyramid 等全栈框架到 Flask 和 FastAPI 等轻量级微框架,再到用于数据科学应用程序的 Streamlit 等专用工具。在本文中,我们将比较三种最流行的 Python Web 框架——FastAPI、Flask 和 Streamlit——以帮助您为项目选择合适的工具。我们将探讨每个

自从Python编程语言诞生以来,它的核心理念一直是最大限度地提高代码的可读性和简单性。Python对可读性和简单性的追求简直达到了如痴如狂的境地。一个事实即可证实这一点:只要你在Python系统的根目录中输入命令“import this”后按下回车键,竟然马上打印出一首英文小诗,翻译成中文大致意思是:“美丽胜过丑陋,显式优于隐式。简单比复杂好,复杂比繁杂好。扁平优于嵌套,稀疏胜过密集。可读性很重要……”简单总比复杂好,可读性很重要。毫无疑问,Python确实在实现这些目标方面非常成功:它是迄今

使用命令提示符或PowerShell在Windows上安装PHP安装ChocolateyChoco包管理器我尝试了Windows默认包管理器Winget,但无法通过它安装PHP。因此,剩下的另一个最佳选择是使用流行的Chocolatey包管理器。但与Winget不同的是,Choco默认情况下不存在于我们的Windows系统中,因此我们需要在我们的系统上手动安装它。转到您的Windows10或11搜索框并键入CMD,出现时选择“以管理员身份运行”将给定的命令复制

不算。html是一种用来告知浏览器如何组织页面的标记语言,而CSS是一种用来表现HTML或XML等文件样式的样式设计语言;html和css不具备很强的逻辑性和流程控制功能,缺乏灵活性,且html和css不能按照人类的设计对一件工作进行重复的循环,直至得到让人类满意的答案。

在 Windows 10 或 11 上安装 Python 3在这里,我们讨论两种设置 Python 的方法,一种是使用图形安装向导,另一种是借助提示符或 Powershell(终端)中的命令。使用图形用户界面:1.下载Python最新版本众所周知,默认情况下,Windows 中不包含 Python 来编译我们基于它的程序。因此,请访问官方网站python.org ,通过单击“下

Python是最通用的编程语言之一:从研究人员运行他们的测试模型到开发人员在繁重的生产环境中使用它,几乎在每个可能的技术领域都有使用案例。在今天的指南中,我们将了解Brownie,一个基于Python的工具,用于编写和部署智能合约。准备安装Python3以太坊节点文本编辑器终端什么是Brownie?智能合约开发主要由基于JavaScript的库主导,如web3.js、ethers.js、Truffle和Hardhat。Python是一种通用的、高度使用的语言,也可用于智能合约/web3的开

Python 可以说是最容易入门的编程语言,在numpy,scipy等基础包的帮助下,对于数据的处理和机器学习来说Python可以说是目前最好的语言,在各位大佬和热心贡献者的帮助下Python拥有一个庞大的社区支持技术发展,开发两个各种 Python 包来帮助数据人员的工作。在本文中,将介绍一些非常独特的并且好用的 Python 包,它们可以在许多方面帮助你构建数据的工作流。1、KnockknockKnockknock是一个简单的Python包,它会在机器学习模型训练结束或崩溃时通知您。我们可以


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

Dreamweaver Mac version
Visual web development tools

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

SublimeText3 Linux new version
SublimeText3 Linux latest version

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function