5

C の学習に興味があります。K & Rを読んだことがあり、R と Python で簡単な C 拡張作業を行ったこともあります。C でより実質的な何かを行うための価値のあるプロジェクトのアイデアは何ですか? Dive Into Pythonに似た優れたオンライン リソースはありますか? 特に、リソースは、C を学習しようとしている新しい言語を既に知っているプログラマーに焦点を当てていました (「C では配列に長さを尋ねるのはナンセンスです。怠け者の Pythonista」などについて言及しています)。

私の背景:

数学/統計、Python、R での日常的なプログラミング、主に自然言語処理、アルゴリズムなど。

4

8 に答える 8

15

数年前、私の友人が私に同じ質問をしました:「どうすればCを学ぶことができますか?」私は彼にデバイスドライバーを書くように言いました。

彼が実際にそれをしたときの私の驚きを想像してみてください。

于 2008-10-08T20:21:28.483 に答える
4

ややオフトピックですが、あなたのバックグラウンドは数学と統計にあると言っているので、プロジェクトオイラーで試してみてください。解決できる数学/統計関連の問題は200以上あります。さらに、解決策にたどり着いたら、問題フォーラムを表示して、他の人が同じ解決策をどのように解決したかを確認できます。他の人がどのように問題を解決するかを見るのに非常に便利です...そして起動するのが楽しいです!

www.projecteuler.net

于 2008-10-08T20:23:01.350 に答える
4

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:

  • Writing low-level software that interacts with hardware.
  • Writing code that does repetitive, tedious, CPU-intensive stuff (math, XML parsing, etc.)... perhaps as an extension for a higher-level language.

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.

于 2008-10-09T00:52:25.567 に答える
2

簡単な言語の通訳を書くことができます。フレックス/バイソンを使用します。マルチスレッドなどにします。これは楽しく、ポインタを頻繁に使用する傾向があります。私は学校のプロジェクトのためにそのようなものを書きました:2つの異なるガベージコレクター、TwoSpaceと並行バージョンを備えた単純なスタックベースの言語。それは楽しかった。そして、「hello、world」よりも大きな、初めてのcプログラムとして実行可能です。

于 2008-10-08T20:22:39.340 に答える
1

Learn C the hard way をチェックしてください。これは無料の電子ブックであり、C コードの例や練習問題を学習するために紹介しています。

http://c.learncodethehardway.org/

于 2012-06-01T15:45:03.170 に答える
0

日常業務で問題を発見または定義し、Python の代わりに C を使用して解決するように強制します。これにより、問題を通常の行動に関連させながら、言語を学ぶことが強制されます。

于 2008-10-08T20:20:41.933 に答える
0

仮想マシン (JVM など) を実装します。

于 2008-10-08T20:20:47.627 に答える