为什么程序员有时会提到“C++/STL”?喜欢它是一种单独的语言吗?

发布于 2024-08-25 07:02:59 字数 157 浏览 4 评论 0原文

这似乎是一个微不足道的问题,但却是最近困扰我的一个问题。为什么有些程序员将“C++/STL”视为另一种语言? STL 是 C++ 标准库的一部分,因此也是“C++”语言的一部分。它不是一个单独的组件,并且它并不单独存在于 C++ 的范围内。然而,有些人却一直表现得好像这是一种完全不同的语言。为什么?

This may seem a trivial question, but it's one that's bothered me a lot lately. Why do some programmers refer to "C++/STL" like it's a different language? The STL is part of the C++ standard library -- and therefore is part of the language, "C++". It's not a separate component, and it does not live alone in the scope of things C++. Yet some continually act like it's a different language altogether. Why?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

暖心男生 2024-09-01 07:02:59

有可能成为一名有能力且经验丰富的 C++ 程序员而从不使用 STL。您可能正在使用 Boost 或 ACE,或者已经成为 MFC Windows 程序员 10 年了。

如果您想要有使用 STL 经验的人,那么要求了解 C++ 的人并不能保证您一定能得到。

另外,在我看来,编写严重依赖于 STL 的代码与编写 MFC 代码感觉非常不同。它们也可能是不同的语言。它们看起来肯定不会特别相似。

It's possible to be a competent and experienced C++ programmer and never use the STL. You may be using Boost or ACE, or been an MFC windows programmer for 10 years.

If you want someone experienced in using the STL, asking for someone who knows C++ is no guarantee that you'll get one.

Also for my mind, writing code that's heavily dependent on the STL feels very different to writing, say, MFC code. They might as well be different languages. They certainly won't look particularly similar.

探春 2024-09-01 07:02:59

理解 C++ 并不需要理解 STL。当您需要 ADT 时,拥有它很有用,但您可以(可能已经完成?)不需要它就可以完成您的整个 C++ 职业生涯。

An understanding of the STL isn't necessary to understand C++. It's useful to have when you need ADTs, but you can go (could have gone?) through your whole C++ career without needing it.

内心激荡 2024-09-01 07:02:59

上面的答案确实很好;我只会在更广泛的背景下添加他们的内容。

开发人员可能会参考语言/api|库,例如 C/Win32、Java/Struts、Java/Spring、C#/.net MVC,因为本质上有两个知识库 - 相关语言的知识和如何使用该特定语言的知识库、API 或框架。像 Win32 这样的东西相当庞大,就像我目前正在学习的 Django 一样。 Django 本身以一种非常具体的方式工作,我知道这是我正在学习的,而不是 Python。

C++/MFC 或 C++/Boost 或 C++/STL 也是如此。语言是 C++ - 您使用的 API/库是 MFC、Boost 或 STL。

The above answers are really good; I'm only going to add to their content in a broader context.

Developers might refer to language/api|library e.g. C/Win32, Java/Struts, Java/Spring, C#/.net MVC because there are in essence two knowledge bases - knowledge of the language in question and knowledge of how to use that specific library, API or framework. Something like Win32 is pretty huge, as is say Django, which I'm currently learning. Django itself works in a very specific way and knowing that is what I'm learning, not Python.

The same is true of C++/MFC or C++/Boost or C++/STL. The language is C++ - the API/library you're using is MFC, Boost or STL.

巨坚强 2024-09-01 07:02:59

可能是因为STL在C++游戏中出现得有点晚,并且许多人编写的代码不使用任何STL。例如,想想早期使用 MFC 进行 win32 编程。

Probably because STL came a little late to the C++ game, and many people have written code that does not use any STL. For example, think early win32 programming with MFC.

岁月静好 2024-09-01 07:02:59

猜测:

C++刚发布时,STL还不存在。它后来作为可选补充而存在,然后被纳入标准。

Guess:

When C++ was first released, the STL did not exist. It came into existence later as an optional addition and then was incorporated into the standard.

雨轻弹 2024-09-01 07:02:59

在撰写简历时,人们经常将 C/C++ 列为一种语言,这在很多情况下意味着他们也不了解。

有时简历会将“Visual C++”列为一种语言,试图表明他们不知道什么是语言。

这句话,连同“精通 C++ 和 PHP”的陈述,直接进入我的公司的回收站。并不是因为他们一定是糟糕的程序员——而是因为浪费面试时间是不值得的。

When writing a resume, people would often list C/C++ as a language, which, in many cases means they don't know either.

Sometime resumes would list "Visual C++" as a language, trying to indicate they don't know what a language is.

This, together with "great knowledge of C++ and PHP" statements, go strait into recycle bin at my firm. Not because they are necessarily bad programmers - but because the interview time waste is not worth it.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文