C#/Web 开发学习策略
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/294128/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
C# / Web Development learning strategy
提问by CPU_BUSY
For a newcomer to .NET Web Development and programming in general, who chooses C# as there preferred language?
对于 .NET Web 开发和编程的新手来说,谁会选择 C# 作为首选语言?
Is it better to learn C# first, without trying to apply it to web development? It seems most literature for C# uses Console or Windows Forms as a learning platform. So would that be the best direction?
最好先学习 C#,而不是尝试将其应用到 Web 开发中吗?似乎大多数 C# 文献都使用控制台或 Windows 窗体作为学习平台。那么这会是最好的方向吗?
Or should you practice in web development and try to learn C# alongside?
或者您应该在 Web 开发中练习并尝试学习 C# 吗?
采纳答案by flesh
You need to understand the fundamentals of C# in order to develop anything useful, be it an ASP.NET website, windows client or web service.
您需要了解 C# 的基础知识才能开发任何有用的东西,无论是 ASP.NET 网站、Windows 客户端还是 Web 服务。
I would start with some good tutorials around the basics of types, classes, methods, events and so on to get to grips with C#. C# Station has some good introductory tutorials here.
我将从一些关于类型、类、方法、事件等基础知识的优秀教程开始,以掌握 C#。C# Station 有一些很好的介绍性教程here。
To develop web specific skills, start with HTML and CSS.
要培养特定于 Web 的技能,请从 HTML 和 CSS 开始。
Then look at how the ASP.NET platform integrates both the C# (application code) and the HTML and CSS (presentational code).
然后看看 ASP.NET 平台如何集成 C#(应用程序代码)和 HTML 和 CSS(展示代码)。
And good luck!
还有祝你好运!
回答by Geoff Cox
I've helped several people go both from previous languages (like C++) as well as no experience to using C#.
我已经帮助了几个人从以前的语言(如 C++)以及没有使用 C# 的经验。
Definately learn C# before you try any particular kind of development (like Web stuff). It will only confuse the newcomer.
在尝试任何特定类型的开发(如 Web 内容)之前,一定要学习 C#。只会迷惑新人。
If you already know a language, reimplementing a small application from the old language to the new language can help a lot.
如果您已经知道一门语言,那么将一个小应用程序从旧语言重新实现到新语言会有很大帮助。
Also there are often books for common language transitions - the C# for C++ developers books are good examples. I recommend reading them.
也经常有关于公共语言转换的书籍——C# for C++ 开发人员书籍就是很好的例子。我建议阅读它们。
Here's my teaching plan (in short summary):
这是我的教学计划(简要总结):
- Give an overview of C# language (types, methods, Main()
- Have students write Hello World from the console.
- Have students implement the "Simon Says" game from the console.
- Have students implement "Simon Says" in WPF. (Using the designer. This used to be Windows Forms, but WPF is a cleaner model)
- Give a survey of the more advanced features in C# - delegates, events, etc.
- Have students implement "Simon Says" in ASP.NET.
- 概述 C# 语言(类型、方法、Main()
- 让学生从控制台编写 Hello World。
- 让学生从控制台实现“西蒙说”游戏。
- 让学生在 WPF 中实现“西蒙说”。(使用设计器。这曾经是 Windows 窗体,但 WPF 是一个更清晰的模型)
- 对 C# 中更高级的特性进行调查——委托、事件等。
- 让学生在 ASP.NET 中实现“Simon Says”。
回答by Kyle West
I disagree about learning C# in a bubble. If your end goal is to do web development why start with developing anything but?
我不同意在泡沫中学习 C#。如果您的最终目标是进行 Web 开发,为什么要从开发开始呢?
The one exception is the console. It's incredibly easy to learn if, for, foreach, etc. in the console.
唯一的例外是控制台。在控制台中学习 if、for、foreach 等非常容易。
Do you have any programming experience, web or otherwise? If the answer is no, I'd learn XHTML and CSS first. There are a million tutorials online and it is pretty easy.
您是否有任何编程经验,网络或其他方面的经验?如果答案是否定的,我会先学习 XHTML 和 CSS。网上有一百万个教程,这很容易。
If you already have web programming experience then learning C# and applying to the web shouldn't be very difficult. Make sure you read the basics of the two types of ASP.NET (WebForms and MVC) and pick which makes more sense to you. Go thru the tutorials on the asp.net and you should have a fairly good start.
如果您已经有 Web 编程经验,那么学习 C# 并将其应用于 Web 应该不是很困难。确保您阅读了两种类型的 ASP.NET(WebForms 和 MVC)的基础知识,并选择对您更有意义的。通过 asp.net 上的教程,您应该有一个相当好的开始。
That's how I did it anyway.
反正我就是这样做的。
回答by JB King
My suggestion would be to do both as if you are doing only web development, then console or Windows applications may not be meaningful to complete. Another point is that there may be parts of C# that are specific to Webforms such as AJAX functionality to name one example though the ASP.Net MVC may be another worth looking at to some extent.
我的建议是两者都做,就好像您只做 Web 开发一样,那么完成控制台或 Windows 应用程序可能没有意义。另一点是 C# 的某些部分可能是特定于 Webforms 的,例如 AJAX 功能来命名一个示例,尽管 ASP.Net MVC 在某种程度上可能是另一个值得研究的。
I would start with the simple, "Hello World!" example(Which can be done in a few ways in the web case and it is worth knowing all of them, e.g. straight HTML that doesn't have anything fancy, a Response.Write in the .aspx file, a Response.Write in the code behind, and using the "<%=" and "%>" tags for the last form) and then expand on that by using storage in files or databases and work towards building up various skills around a core of seeing C# used within web stuff.
我会从简单的“Hello World!”开始。示例(在网络案例中可以通过几种方式完成,并且值得了解所有这些,例如没有任何花哨的直接 HTML,.aspx 文件中的 Response.Write,.aspx 文件中的 Response.Write代码隐藏,最后一个表单使用“<%=”和“%>”标签),然后通过使用文件或数据库中的存储来扩展它,并围绕在网络中使用 C# 的核心构建各种技能东西。