如何教一个关于C ++的课程? [英] How to teach a crash course on C++?

查看:104
本文介绍了如何教一个关于C ++的课程?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在几个星期内,我们将为大学毕业的Java程序员讲授C ++的课程。



本课程的以前版本只有1或2个半天的课程,涵盖的主题包括:




  • 新语言功能,例如

    • 标题与实施

    • 指针和引用

    • 内存管理

    • 运算符重载

    • 模板




    • C库标头

    • basic iostreams

    • 基本STL


    • 使用图书馆(标题,连结)


    • 基本Linux控制台命令

    • gcc以及如何解读其错误讯息

    • Makefile和autotools


  • 基本调试器命令

  • 他们问的任何主题



在课程中,每个人都使用新引入的功能单独编写,编译,运行和调试简单程序。这是最好的学习方式吗?



您认为哪些主题是最重要的?

应添加或删除哪些主题?
$

解决方案

我只能再次指向 a href =http://www.research.att.com/~bs/new_learning.pdf =nofollow> Stroustrup 和讲道:不教C子集!这很重要,但不适合初学者! C ++非常复杂,因为它是标准库类,特别是STL,比C ++的C子集更加重要和(至少在表面上)更容易理解。



这同样适用于指针和堆内存分配。当然,他们很重要,但只有在教过STL容器后。



另一个重要的概念,新学生必须得到他们的头脑是不同的编译单元的概念,单一定义规则(因为如果你不知道它,你将无法解密错误消息)和标题。这实际上是一个障碍,并且必须早早被破解。



除了语言特性,最重要的事情是教你如何理解C ++编译器以及如何获得帮助。获得帮助(即知道如何搜索正确的信息)在我的经验是最重要的一件事,必须教的C ++。





/编辑:如果你碰巧知道任何德语,请查看 http://madrat.net/coding/cpp/skript ,一个非常简短介绍的一部分的课程。


In a few weeks we'll be teaching a crash course on C++ for Java programmers straight out of college. They have little or no experience yet with C or C++.

Previous editions of this course were just 1 or 2 half-day sessions and covered topics including:

  • new language features, e.g.
    • header vs. implementation
    • pointers and references
    • memory management
    • operator overloading
    • templates
  • the standard libraries, e.g.
    • the C library headers
    • basic iostreams
    • basic STL
  • using libraries (headers, linking)
  • they'll be using Linux, so
    • basic Linux console commands
    • gcc and how to interpret its error messages
    • Makefiles and autotools
  • basic debugger commands
  • any topic they ask about

During the course each person individually writes, compiles, runs, and debugs simple programs using the newly introduced features. Is this the best way to learn?

Which topics do you consider most crucial?
Which topics should be added or removed?
Which topics just can't be covered adequately in a short time?

解决方案

I can only once again point to Stroustrup and preach: Don't teach the C subset! It's important, but not for beginners! C++ is complex enough as it is and the standard library classes, especially the STL, is much more important and (at least superficially) easier to understand than the C subset of C++.

Same goes for pointers and heap memory allocation, incidentally. Of course they're important but only after having taught the STL containers.

Another important concept that new students have to get their head around is the concept of different compilation units, the One Definition Rule (because if you don't know it you won't be able to decypher error messages) and headers. This is actually quite a barrier and one that has to be breached early on.

Apart from the language features the most important thing to be taught is how to understand the C++ compiler and how to get help. Getting help (i.e. knowing how to search for the right information) in my experience is the single most important thing that has to be taught about C++.

I've had quite good experiences with this order of teaching in the past.

/EDIT: If you happen to know any German, take a look at http://madrat.net/coding/cpp/skript, part of a very short introduction used in one of my courses.

这篇关于如何教一个关于C ++的课程?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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