We don’t allow questions seeking recommendations for software libraries, tutorials, tools, books, or other off-site resources. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(8)
几年前,我的一个朋友问了我同样的问题:“我如何学习 C?” 我告诉他写一个设备驱动程序。
想象一下当他真的这么做时我的惊讶。
Several years back, a friend of mine asked me that same question: "How do I learn C?" I told him to write a device driver.
Imagine my surprise when he actually did it.
看一下
K&R 之后使用什么书学习纯 C 语言编程?
Have a look at
After K&R what book to use to learn programming in plain C?
有点偏离主题,但既然你提到你的背景是数学和统计,你应该尝试一下欧拉项目。 有超过 200 个数学/统计相关问题可供解决。 此外,一旦找到解决方案,您可以查看问题论坛以了解其他人如何解决相同的解决方案。 非常方便查看其他人如何解决问题...而且启动起来很有趣!
www.projecteuler.net
Somewhat off topic, but since you mention your background is in Math and Stats your should try your hand at Project Euler. There are over 200 math/stat related problems available to solve. In addition, once you arrive at a solution, you can view the problem forum to see how others solved the same solution. Very handy for seeing how others solve the problem... and fun to boot!
www.projecteuler.net
我和你有相似的背景。 我使用 Python 为我的博士研究以及网络编程进行大量数学和数据分析。 不同之处在于我是在 90 年代首先学习 C 的。
如果您可以为 Python 编写 C 扩展,那么我想说您对 C 的优点有很好的把握。 在我看来,如今的 C 最适合两件事:
当然,许多高级应用程序也是用 C 语言编写的,特别是在我发现的 Linux 下,但在很大程度上,这些应用程序并不是真正用 K&R 的“基本”C 语言或标准库编写的。 ,他们使用 Glib、wxWindows、Apache Portable Runtime 等框架,这些框架都使用某种面向对象的结构或约定,并且通常抽象出 C 的一些基本内存管理细节。
相反 我认为,要让您的 C 技能在当今的编程语言环境中发挥作用,主要是进行低级工作,或者熟悉这些高级框架之一。 我个人非常喜欢 Glib 和 GTK 库,因为它们使用非常动态面向对象的模型(很像 Python),而不妨碍您使用 C 的低级功能。
I have a similar background to you. I use Python to do a lot of math and data analysis for my PhD research, and also for web programming. The difference is that I learned C first, way back in the 90s.
If you can write C extensions for Python, then I'd say you have a pretty good handle on what C is good for. In my opinion, C today is best-suited for two things:
Of course a lot of higher-level applications are also written in C, especially under Linux I've found, but in large part these aren't really written in the "bare-bones" C of K&R or the standard library. Rather, they use frameworks like Glib, or wxWindows, or the Apache Portable Runtime, or others, which all put use some kind of object-oriented structure or conventions, and often abstract away some of the basic memory-management details of C.
So I think that making your C skills useful in today's programming language environment is largely about doing low-level work, or becoming familiar with one of these higher-level frameworks. I personally like the Glib and GTK libraries a lot, since they use a very dynamic object-oriented model (a lot like Python) without preventing you from using the low-level features of C.
在日常工作中查找或定义问题,并强迫自己使用 C 而不是 Python 来解决它。 这将迫使你学习这门语言,同时保持问题与你平时所做的事情相关。
Find or define a problem in your day-to-day work and force yourself to solve it using C instead of Python. That will force you to learn the language while keeping the problem relevent to what you normally do.
实现虚拟机(例如 JVM)。
Implement a virtual machine (the JVM, for example).
查看《Learn C the Hard way》,这是一本免费电子书,其中包含许多 C 代码示例和练习,以便您学习。
http://c.learncodethehardway.org/
check out learn C the hard way, it's a free ebook which takes you through many examples of C code and exercises in order for you to learn.
http://c.learncodethehardway.org/
您可以为一种简单的语言编写一个解释器。 使用 Flex/Bison。 使其成为多线程等。这很有趣并且往往会大量锻炼指针。 我为学校项目写了类似的东西:一种基于简单堆栈的语言,具有两种不同的垃圾收集器、TwoSpace 和并发版本。 蛮好玩的。 并且可以作为第一个比“hello, world”更大的 C 程序!
You could write an interpreter for a simple language. Use flex/bison. Make it multithreaded etc. This is fun and tends to exercise pointers a lot. I wrote something like that for a school project: A simple stack based language with two different garbage collectors, TwoSpace and a concurrent version. That was fun. And doable as a first ever c program bigger than "hello, world"!