TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: What is the correct method to teach C in a university?

2 点作者 philonoist超过 6 年前
My university in India has somewhat rigid rule to teach C and it is compulsory. The course spreads over 3 hours a week and spans through 4 months.

4 条评论

otras超过 6 年前
CS50, Harvard&#x27;s introductory CS class, introduces students to programming with C. I took the online version in 2016, and I greatly enjoyed the way it was presented. I&#x27;m not in the best position to compare and contrast teaching methods, as I&#x27;ve only taken the single class on C, but if you have the time I would highly recommend seeing how they do it.<p>You can access their lectures, notes, problem sets, slides, and other material for free on their course website [0] and on edX [1]. A warning in advance before you click the course website link though! It&#x27;s currently Halloween, and the page features an autoplaying scream sound. You&#x27;ve been warned!<p>[0]: <a href="https:&#x2F;&#x2F;cs50.harvard.edu&#x2F;2018&#x2F;fall&#x2F;" rel="nofollow">https:&#x2F;&#x2F;cs50.harvard.edu&#x2F;2018&#x2F;fall&#x2F;</a><p>[1]: <a href="https:&#x2F;&#x2F;www.edx.org&#x2F;course&#x2F;cs50s-introduction-computer-science-harvardx-cs50x" rel="nofollow">https:&#x2F;&#x2F;www.edx.org&#x2F;course&#x2F;cs50s-introduction-computer-scien...</a>
sloaken超过 6 年前
First question is why? Are you making systems programmers? Are you trying to ensure they have a deep understanding of how a computer works?<p>Personally I would recommend teaching some simple type-less language first. This will be their &#x27;Crutch&#x27; language, used to test out simple algorithms.<p>Then I would teach them assembly language. Make sure they call subroutines and use pointers, but on a simple level. Like sort an array of strings.<p>Then I would teach them the C and show how it directly and easily translates to assembly. Having done assembly they should have an easier time of pointers. As we all know, pointers is what makes the new C programmers cry. Well that and freeing the same space twice.
increment_i超过 6 年前
I suppose the main snag will be pointers. The approach that worked for me was the holistic approach of using C as a way of controlling the machine&#x27;s memory itself.<p>In my view, C really only makes sense in the context of manipulating data in and out of the heap and the stack. So once you&#x27;re past basic syntax, I guess start there: the heap and the stack. When you grasp that, I feel like you can stand on solid fundamentals on how computers work going forward.
kazinator超过 6 年前
The correct method to teach C must be rooted in specification of behavior.<p>Behavior that is <i>observed</i> in a C program is not necessarily one that is <i>required</i>. If that behavior is required at all, it might only be required by the platform or implementation, not by the language.<p>Students should not be discouraged from learning by experimenting, but they have to take the results with a grain of salt. Question, research and discuss everything.