在开始使用 c# 4.0 之前是否必须学习所有其他版本的 c#?

发布于 2024-08-29 13:01:49 字数 170 浏览 10 评论 0原文

因为我是一个刚刚完成工程的初学者,并且我对 C、C++ 有很好的了解... 我也想学习c#,但我发现c# 4.0已经发布了……

  • 我应该关心以前的吗 版本?
  • 您对初学者快速学习 C# 有何建议?
  • 需要考虑哪些因素 当从 c、c++ 迁移到 c# 时?

As i am a beginner who just finished my engineering and i have good knowledge in c,c++...
I thought of studying c# as well but i found that c# 4.0 has been released.....

  • Should i care about the previous
    versions?
  • What are the tips you give for beginner to learn c# quickly?
  • what are the factors to be considered
    when moving from c,c++ to c#?

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

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

发布评论

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

评论(11

不…忘初心 2024-09-05 13:01:49

C# 4 基本上是所有其他版本的超集,因此如果您了解 C# 4,那么您肯定了解早期版本。另一方面,我认为了解哪个版本中有什么内容是值得的。我的 C# 深度网站上有一些 “虚张声势的指南”,其中提供了一些信息关于 C# 2 和 3 - 我很快就会为 C# 4 做类似的事情。有关每个功能的非常简短的列表,请参阅此问题版本。

至于从 C 和 C++ 迁移 - 尝试忽略您认为您知道的一切。有些位会相似,有些则完全不同。您应该尝试按照语言期望的方式工作,而不是应用 C++ 习惯用法。

您可能想阅读C# 4.0 基础C# 4.0 简而言之加速 C# 2010。我自己的书 - C# in Depth - 很快就会有第二版,涵盖C# 4,但它实际上是为已经了解 C# 1 的人设计的。

C# 4 is basically a superset of all the other versions, so if you know C# 4 then you definitely know the earlier versions. On the other hand, I think it's worth knowing what's in which version. I have a couple of "bluffer's guides" on my C# in Depth web site which give a bit of information about C# 2 and 3 - I'll do a similar one for C# 4 soon. See this question for a very brief list of features in each version.

As for migrating from C and C++ - try to ignore everything you think you know. Some bits will be similar, some will be completely different. You should try to work the way the language expects you to, rather than applying C++ idioms to it.

You might want to read Essential C# 4.0, C# 4.0 in a Nutshell or Accelerated C# 2010. My own book - C# in Depth - will have a second edition soon, covering C# 4, but it's really designed for people who already know C# 1.

打小就很酷 2024-09-05 13:01:49

不,买一本关于 4.0 的好书就可以了。如果这本书是完整的(即“对于了解 3.5 的人来说)”,那么它就完整了。

只要忘记以前的版本,除非特别要求(目前不是每个商业项目都会使用 4.0)。

提示?获得一个好的书,阅读 C/C++ 文档

- 欢迎进入托管内存世界。现在就避免使用指针(您可以操作),并且不要抱怨它 - 您适应得越快。在这样的环境下,你很快就会感觉还好;)

No. Just get a good book about 4.0. If the book is complete (i.e. nto a "for people knowing 3.5) then it is complete.

Just forget about previous versions, UNLESS specifically called for (not every commercial project is going to use 4.0 at the moment).

Tips? Get a good book, READ THE DOCUMENTATION.

C/C++ - welcome in a managed memory world. Get around the garbage collected approach. NOW. Get around not having pointers (that you can manipulate) and don't bitch about it - the faster you get comfortable with that environment, the faster you feel ok ;)

多像笑话 2024-09-05 13:01:49

我应该关心以前的版本吗?

是的。您至少应该知道旧版本没有 4.0 的哪些功能。

如果您在工作中使用 .NET,那么它们很可能还没有达到 4.0。因此,您需要知道可以使用哪些功能以及必须解决哪些功能。

您对初学者快速学习 C# 有哪些建议?

找一本好书并从头开始。

我建议 Pro C# 2010 和 .NET 4.0 平台C# In深度:第二版

从c、c++迁移到c#时需要考虑哪些因素?

了解各自的命名约定和差异。

C/C++ 被编译为本机代码。 C# 进行 JIT 编译。

C#有内存管理。 C/C++ 没有(至少不一样)。

C 不是面向对象的语言。 C++/C# 是,但各自处理 OO 的方式略有不同。

这些差异将改变您编写/思考代码的方式。

Should i care about the previous versions?

Yes. You should at least know which features of 4.0 the older version DON'T have.

There's a good chance that if you're using .NET on the job, they're not going to be at 4.0 yet. Therefore, you're going to need to know which features you can use and which you're going to have to work around.

What are the tips you give for beginner to learn c# quickly?

Find a good book and start at the beginning.

I would recommend either Pro C# 2010 and the .NET 4.0 Platform or C# In Depth: Second Edition

What are the factors to be considered when moving from c,c++ to c#?

Know the naming conventions and differences of each.

C/C++ gets compiled to native code. C# gets JIT compilation.

C# has memory management. C/C++ doesn't (at least not the same).

C is not an object oriented langauge. C++/C# are, but each handles OO in a slightly different way.

Those kind of differences will change how you write/think about your code.

红焚 2024-09-05 13:01:49

我应该关心之前的吗
版本?

是的,你应该。我建议从 2.0 开始,这是所有未来版本的基础,然后逐步学习 3.0、3.5 和最近发布的 4.0 版本。

您给出的建议是什么
初学者快速学习c#?

与大多数语言一样,最大的技巧是使用它。开始编写一些小型应用程序以尝试利​​用公共语言功能,然后继续尝试您感兴趣的框架的不同领域。

Should i care about the previous
versions?

Yes, you should. I'd recommend starting with 2.0, which is the foundation for all future versions, then incrementally learning the 3.0, 3.5 and recently released 4.0 versions.

What are the tips you give for
beginner to learn c# quickly?

Like most languages, the biggest tip is to use it. Start coding some small applications to try and take advantage of common language features, then move on to try different areas of the framework that interest you.

靖瑶 2024-09-05 13:01:49

我也是 C# 的初学者。我专注于新技术,因为大多数公司都想要最新的技术。所以我强调了3.5(并简单浏览了3.0和2.0)。
您很可能不会使用 1.0 或 1.1 来开发新项目
如果我是你,我会专注于 4.0,并深入了解 3.5

HTH

I am a beginner in C# as well. I am focusing on the new technology, since most companies will want the newest tech. So I emphasized on 3.5 (and breifly glanced over 3.0 and 2.0).
Odds are, you will not be working on a new project using 1.0 or 1.1
If I were you, I woudl focus on 4.0 and have a good understanding of 3.5

HTH

残疾 2024-09-05 13:01:49

C# 4.0 是以前版本功能的超集。所以你的第一个问题的答案是“不,只需阅读一本 C# 4.0 的书”。

C# 4.0 is the superset of the previous versions' features. So the answer to your first question is "no, just read a C# 4.0 book".

自由如风 2024-09-05 13:01:49

.NET 4.0 在以前的版本之上添加了功能,即使它完全是一种新语言,您仍然需要了解“以前的”版本,因为它们仍在行业中使用。
好消息是,您不需要学习某个版本,只需学习 .NET,然后查找以前版本中是否存在该功能即可。

学习 C# 就像学习任何其他语言一样 - 要么参加课程,创建一个宠物项目,要么边学边学(或全部学习)。

从 C++ 迁移到 C# 时,最大的区别是垃圾收集的存在。幸运的是,C# 与 C++ 非常相似,因此您应该能够从第一天起就能够以虚拟方式读取(和编写)它。您应该能够发现一些差异(结构是与 int 类似的值),并且您有一个可以使用的非常广泛的基类库。

.NET 4.0 adds capabilities on top of the previous versions and even if it was a new language altogether you still need to know the "previous" version because the are still used in the industry.
The good news is that you don't need to learn a version just learn .NET and then find if the feature exist in previous versions.

Learning C# is like learning any other language - either take a course, create a pet project or learn as you go (or all of them).

When moving from C++ to C# the biggest difference is the existence of garbage collection. Luckily c# is very similar to C++ so you should be able to read (and write it) virtually from day one. You should be able to find a few differences (structs are values just like int) and you have a very extensive base class library you can use.

﹎☆浅夏丿初晴 2024-09-05 13:01:49
  1. 您应该关心 .NET 3.5。
  2. 学得快吗?编写大量代码 - 并阅读
  3. C是一种完全不同的动物。 C++ 没有 GC 和其他细节。你(希望)能够理解物体。但是 C# 支持许多新事物,例如接口、委托、内置线程、LINQ 等。
  1. You should care about .NET 3.5.
  2. Learn quickly? Write lots of code - and read this.
  3. C is an entirely different animal. C++ has no GC and other niceties. You'll (hopefully) understand objects. But there are lots of new things supported in C#, like interfaces, delegates, built-in threading, LINQ, etc.
鸢与 2024-09-05 13:01:49

我能给出的最好建议是——买一本好书!查看 Wrox 系列 - 他们有非常好的书籍,可以让您快速入门。寻找诸如“.NET 4 Beginning”之类的内容。

不,如果您了解原则,则您不必了解以前版本的所有细节,特别是如果您确信自己只会使用新版本。但是如果你有时间和愿望 - 了解更多总没有坏处,相信我:)

祝你好运!

Best advice I can give - get a good book! Check the Wrox series - they have very good books, and can get you started quickly.. Look for something like ".NET 4 Beginning".

And no - if you know the principles you don't have to know all the details about the previous versions, especially if you're confident that you will only be working with the new ones.. But if you have the time and the desire - it never hurts to learn more, trust me :)

Good luck!

梦巷 2024-09-05 13:01:49

学习所有 C# 版本会浪费你的时间。直接学习 C# 4.0,不要忘记 4.0 之前的版本。对所使用的 IDE 的掌握非常重要。最重要的是,代码,代码,代码。

c、c++ 和 c# 是“兄弟姐妹”,所以您处于熟悉的领域。

It would be a waste of your time to learn ALL the C# versions. Go straight to learning C# 4.0 and don't forget the version immediately preceding 4.0. The mastery of the IDE you use matters very much. And most importantly, code, code, code.

c,c++ and c# are "brothers and sisters" so you're in familiar territory.

银河中√捞星星 2024-09-05 13:01:49

到目前为止,所有答案似乎都没有提到的一个因素是,如果您从头开始构建新的 .NET 4 应用程序,以前版本中的许多构造将不再相关。

仅仅知道 .NET 4 是以前版本的超集是不够的,您需要知道以前版本的哪些区域基本上已过时,以便您可以避免它们并使用新的、更好的构造。

例如,不要使用ArrayList,而是使用通用List;不要使用 Hashtable,使用 HashsetDictionary;使用新的 Task 类型代替线程和同步原语来简化代码;等等等等

One factor none of the answers so far seems to have mentioned is the fact that there are many constructs in the previous versions that are no longer relevant if you are building a new .NET 4 application from scratch.

It's not sufficient just to know that .NET 4 is a superset of previous versions, you'll want to know which areas of the previous versions are essentially obsolete so you can avoid them and use the new, better, constructs.

For example, don't use ArrayList, use generic List<T> instead; don't use Hashtable, use Hashset<T> or Dictionary<T, U>; use the new Task type instead of Threads and synchronization primitives to simplify you code; etc. etc.

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