就实际应用而言,C,C#和C ++有何区别? [英] What are the differences between C, C# and C++ in terms of real-world applications?

查看:48
本文介绍了就实际应用而言,C,C#和C ++有何区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

正如我之前在此处所述,我ve决定尝试其中的一种,但是鉴于我作为Web开发人员的兴趣,我想知道它们在实际应用程序中的区别.

编辑注释:

虽然我是网络开发人员,但请不要以此来限制您的回答.我30岁...我已经经历了多年的职业转变.

解决方案

C和C ++都为您提供了较低级别的抽象,它的复杂性增加了,提供了对底层计算机功能的访问权限,而这些功能不一定会与其他功能一起公开.语言.与C相比,C ++增加了完全面向对象的语言的便利性(减少了开发时间),这可能会增加额外的性能成本.在实际应用中,我看到这些语言已应用于以下领域:

C

  • 内核级软件.
  • 硬件设备驱动程序
  • 需要访问旧的稳定代码的应用程序.

C,C ++

  • 需要对内存管理进行微调的应用程序或服务器开发(不能留给通用垃圾收集解决方案使用).
  • 需要访问无法与更现代的托管语言很好地交互的库的开发环境.
  • 尽管托管C ++可用于访问.NET框架,但这不是无缝过渡.

C#提供了一个托管内存模型,该模型再次添加了更高级别的抽象.这种抽象级别增加了便利,并缩短了开发时间,但使对较低级别的API的访问复杂化,并使特殊的性能要求成为问题.

当然有可能在托管内存环境中实施性能极高的软件,但必须清楚其含义.

与C/C ++相比,C#的语法当然要求不高(并且不容易出错),并且对于初学者而言,其学习曲线较浅.

C#

  • 快速的客户端应用程序开发.
  • 得益于.NET框架的高性能服务器开发(例如StackOverflow).
  • 需要使用.NET框架设计语言的应用程序.

JohannesRössel提出了有效的观点,即使用C#指针,不安全和未经检查的关键字会突破构建C#的抽象.我要强调的是,编程类型是大多数C#开发方案的例外,而不是语言的基本组成部分(与C/C ++一样).

As I posted earlier here I've decided to try my hand at one of these, but given my interests as a web developer, I'd like to know the difference between them in their real-world applications.

Edit Note:

While I'm a web developer, please don't let that limit your answer. I'm 30...I've got years of career changing ahead of me.

解决方案

Both C and C++ give you a lower level of abstraction that, with increased complexity, provides a breadth of access to underlying machine functionality that are not necessarily exposed with other languages. Compared to C, C++ adds the convenience of a fully object oriented language(reduced development time) which can, potentially, add an additional performance cost. In terms of real world applications, I see these languages applied in the following domains:

C

  • Kernel level software.
  • Hardware device drivers
  • Applications where access to old, stable code is required.

C,C++

  • Application or Server development where memory management needs to be fine tuned (and can't be left to generic garbage collection solutions).
  • Development environments that require access to libraries that do not interface well with more modern managed languages.
  • Although managed C++ can be used to access the .NET framework, it is not a seamless transition.

C# provides a managed memory model that adds a higher level of abstraction again. This level of abstraction adds convenience and improves development times, but complicates access to lower level APIs and makes specialized performance requirements problematic.

It is certainly possible to implement extremely high performance software in a managed memory environment, but awareness of the implications is essential.

The syntax of C# is certainly less demanding (and error prone) than C/C++ and has, for the initiated programmer, a shallower learning curve.

C#

  • Rapid client application development.
  • High performance Server development (StackOverflow for example) that benefits from the .NET framework.
  • Applications that require the benefits of the .NET framework in the language it was designed for.

Johannes Rössel makes the valid point that the use C# Pointers, Unsafe and Unchecked keywords break through the layer of abstraction upon which C# is built. I would emphasize that type of programming is the exception to most C# development scenarios and not a fundamental part of the language (as is the case with C/C++).

这篇关于就实际应用而言,C,C#和C ++有何区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆