哪种语言,为什么? (C ++ / C) [英] Which language, and why? (C++/C)

查看:50
本文介绍了哪种语言,为什么? (C ++ / C)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hello Codeproject,



经过多年的C#经验,我终于决定更进一步,学习一门新的编程语言。



我对编程语言非常了解,并且已经了解到C#很好,但不符合我的需求。我也没有遇到任何困难(C ++ / C),但是想知道它们之间究竟有什么区别,我应该选择哪一个。



我将使用其中任何一种作为我将学习的最终编程语言。我想用它来开发游戏(3D,使用OpenGL或DirectX)并开发更复杂的程序(因为语言更快。)



我更喜欢在任何基础框架之外工作(例如.NET),所以我不再需要让用户安装特定的框架。 (他们应该能够运行给定的游戏,程序)。



两者之间究竟有什么区别?我应该选择哪一个,为什么?



编辑:编辑:

我忘了提到我特别想为Windows和Linux编写。

Hello Codeproject,

After years of experience with C# I've finally decided to go one step further and learn a new programming language.

I've become quite good with programming languages, and have learned that C# is good, but doesn't fit my needs. I would have no difficulties learning either(C++/C), but would like to know exactly what the difference is between them, and which one I should choose.

I will use either of those as my final programming language that I will learn. I want to use it for developing games(3D, with OpenGL or DirectX) and developing more complex programs(Since the language is faster.)

I'd prefer to work outside of any base framework(Such as .NET) so I no longer have to have users install specific frameworks. (They should be able to just run the given game, program).

What exactly are the differences between the two? Which one should I choose, and why?


I forgot to mention that I specifically want to write for Windows AND Linux.

推荐答案

这个问题根本没有任何意义。计算机语言无法用毫秒来衡量。



如果这对您来说不是很明显,那么您对C#的良好了解的说法听起来就不足为奇了。而且,在我看来,大多数人只知道一种计算机语言不能很好地理解它,只是因为它经常激发非常狭隘和僵化的思维。当然,这不是一个规则,但看起来像一个真正有效的经验法则。所以,你学习其他东西的想法非常有效。



现在,你对.NET框架限制的想法是非常错误的。 .NET可以被视为另一个平台,与Windows没有太大区别(CLR不必受Windows限制)。它已预先安装在较新版本的Windows上,因此您的限制问题有点人为。是的,用户群有限;它将排除一些用户(宽松:-))。但是使用Windows API,您可以排除Linux用户(但您可以使用.NET开发Windows和Linux,以及其他一些平台,包括Mac OS X,以获取您的信息)。实际上,.NET可以为您提供更广泛而非更窄的用户群。我从来没有听说过.NET性能的任何严重问题。



不要误会我的意思:我不是要坚持使用.NET。但我宁愿根据非常不同的范例建议一些真正不同的东西,而不是像C / C ++那样过时。例如,Haskell,Closure,Python,Scala,F#,甚至是Prolog(我只是为了列出它们而没有太多想法)。



记住:

This question does not make any sense at all. A computer language cannot be measured in milliseconds.

If this is not quite apparent to you, your claim about your good knowledge of C# sounds more than suspicious. And, in my opinion, most people knowing only one computer language cannot know it well, just because it often stimulated very narrow and inflexible thinking. Of course, this is not a rule, but looks like a really working rule of thumb. So, your idea to learn something else is quite productive.

Now, your idea about limitation of .NET framework is pretty much wrong. .NET can be considered as yet another platform, not much different from Windows (CLR does not have to be limited by Windows). It is pre-installed on newer versions of Windows, so your problem of limitation is a bit artificial. Yes, the user base is limited; it will exclude some users (loosers :-)). But with Windows API, you exclude, say, Linux users (but you can develop for both Windows and Linux using .NET, as well as some other platforms, including Mac OS X, for your information). Effectively, .NET can give you wider, not narrower user base. And I never heard of any serious problems with .NET performance.

Don't get me wrong: I am not trying to insist on .NET. But I would rather advise something really different, based on very different paradigms and not that archaic as C/C++. For example, Haskell, Closure, Python, Scala, F#, even Prolog (I am listing them without much thinking, just for example).

Remember:
Alan Perlis 告诉我们:
Alan Perlis told us:

一种不影响编程思路的语言,不值得了解。

http://www.cs.yale.edu/quotes.html

A language that doesn't affect the way you think about programming, is not worth knowing.
http://www.cs.yale.edu/quotes.html

金字!



-SA


Quote:

3D,使用OpenGL或DirectX

3D, with OpenGL or DirectX

C ++ 更适合这种编程,在我看来。



C++ is better suited for such kind of programming, in my opinion.

引用:

两者之间究竟有什么区别?我应该选择哪一个?为什么?

What exactly are the differences between the two? Which one should I choose, and why?

C 是一个简单,实用的金属语言。它是普遍支持的。

C ++ 是一种复杂的语言,多范式(支持例如OOP),它得到了广泛的支持。

在我看来, C ++ 更适合大型项目。对于中小型项目 C 非常适合这项工作。



C is a simple, pragmatic, 'to the metal language'. It is 'universally supported'.
C++ is a complex language, multiparadigm (supports for instance OOP), it is widely supported.
In my opinon C++ is better suited for large projects. For small to medium projects C fits the job very well.

引用:

有人能告诉我这些语言的速度有多快(压力测试,如果你愿意),以毫秒为单位吗?



C# :

Java:

C ++:

C:

Could anyone tell me how fast these languages are(A stress test if you will) in miliseconds?

C#:
Java:
C++:
C:



没有确切答案。但是,我个人的感觉是。

Java 是最慢的,然后是 C#,然后 C ++ ,最后 C ,这是最快的。

但是'速度'不能单独驱动编程语言的选择。毕竟,你需要一种编程语言来在合理的时间内编写应用程序。

编写非常复杂的程序,只需 C 即可例如,永远。






There's not an exact answer to that. There is, however, my personal feeling about.
Java is the slowest, then comes C#, then C++, finally C, which is the fastest .
But 'speed' cannot drive alone the choice of a programming language. After all, you need a programming language to write an application in a 'reasonable amount' of time.
Coding very complex programs in plain C could take forever, for instance.


引用:

编辑:编辑:

我忘了提到我特意想为Windows和Linux编写。


I forgot to mention that I specifically want to write for Windows AND Linux.



有几种选择。当然还有Java,还有Mono,允许 C#也可以在 Linux 上运行,例如 QT 用于开发跨平台 C ++ 应用程序:你必须自己做一些研究。


There are several options available. There is Java, of course, but also Mono, allowing C# to run also on Linux, and, for instance QT for developing cross platform C++ applications: you have to do some research yourself on the matter.


这篇关于哪种语言,为什么? (C ++ / C)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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