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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

What's your C migration plan?

40 点作者 lucasr超过 13 年前

15 条评论

jrockway超过 13 年前
You know what I've learned over the years? While many people are very bad about writing C, I'm pretty good at it. So C is not a bad language; there are just a lot of bad programmers around using it.<p>(And if you're wondering how to write good C? Make object ownership explicit. Never have malloc and free more than a page of code apart. Don't expose data structures as API. Make errors put your routine into a defined state that the caller can understand. Use bstrings instead of cstrings.<p>And although I don't write much C++, the more I learn about it, the more I believe it's possible to write good C++. Most people won't spend the time to write good software, and when you do that in C or C++ it's an absolute disaster. But if you go slowly, plan, think, exercise care, and review your work regularly, you can get good code that runs fast.<p>You can write a safe Haskell application in 10x less time than you can write a safe C++ application, though.)
评论 #3109207 未加载
评论 #3109464 未加载
评论 #3109228 未加载
评论 #3109227 未加载
coliveira超过 13 年前
This is just nonsense. C is perfect for what it is supposed to do: systems programming, the kind of software you write when creating operating systems, debuggers, and device drivers. It will hardly ever stop being useful for these tasks.<p>People that make this kind of complaint were using C for the wrong type of software. If you want to write a web application in C you just need to reevaluate your tool set.
评论 #3109178 未加载
评论 #3108967 未加载
评论 #3109082 未加载
bitops超过 13 年前
I doubt that the tech industry will ever move completely away from C. (I had a friend who was doing graduate work in physics and he was required to do all his work in Fortran, believe it or not, so old languages do stick around).<p>For "mainstream" (read: enterprise) software, yes, C may fall out of favor, but it's a great language and here to stay.<p>There are just too many cases where C is the right tool for the right job and it would be silly to use a different language.<p>I'm thinking particularly of embedded software. While languages like Lua are great for embedded scripting, they still need something to script against.<p>So, C isn't going anywhere and I expect that 100 years from now it will still be a worthwhile language to program in.<p>(Also, C is very much the Latin of modern programming. Learning it helps your understanding of so many other things. In case you're curious, Lisp is Greek and I mean that affectionately).
评论 #3109276 未加载
评论 #3109714 未加载
hkarthik超过 13 年前
C is the best thing we have that's truly cross platform and has consistent performance everywhere without any company to claim ownership of it.<p>Until that changes, C is here to stay.
tptacek超过 13 年前
The nice thing about an article like this is that anyone who is receptive to it truly shouldn't be writing C code, and anyone who should be writing C code is (in almost all likelihood) not receptive to it.
forrestthewoods超过 13 年前
As a game developer this post is rather amusing. I have far more questions about what happens behind the scenes on the python line than the C line.
__david__超过 13 年前
It really depends on what you are writing. If you're trying to write the next great startup web app then, yeah, use python or ruby or perl--C is probably too finicky for the fast pace of a web startup. But if you're writing systemd (an "init" replacement) you'd be the object of ridicule if you wrote it in any of those languages.
sbov超过 13 年前
I've been recently using Python more rather than Java, and I find myself writing C more than ever. I always seem to find some speed/memory issue in my programs that when rewritten in C goes away. Maybe I'm just not proficient enough in Python to avoid them yet. I would say its still a net gain over raw C.
评论 #3109586 未加载
评论 #3110777 未加载
trbecker超过 13 年前
What this can possibly mean? Because C is everywhere. It is in the code that runs the VM of your favorite language. It is in most compilers. It provides basic system services. Why should we have a plan to migrate from something that is everywhere?
swah超过 13 年前
But I don't want to use his language, I want to hack on it with him. To see how he solves problems. So, C.<p>Unless its something like Factor, where most of the implementation is written in Factor.
blackhole超过 13 年前
Changing languages will not save you from security holes, only change the kind of mistakes you have to worry about. Only knowing how to write secure code can save you from security holes. You cannot ignore how computers work, no matter how many layers of abstraction and libraries you pile on in an effort to shield yourself from reality.
评论 #3109218 未加载
klochner超过 13 年前
It's fitting that his site is timing out.
zmanji超过 13 年前
I am unable to load the article. Is there a mirror?
评论 #3109260 未加载
user911302966超过 13 年前
My suspicion is that this is not a C programmer at all. Claiming that you've "written loads of it" certainly lends the author a cloak of credibility, but I don't buy it.<p>"This one, you really can't tell."<p>A competent C programmer can absolutely discern what is happening... more importantly, though, is that the two examples don't do the same thing.<p>I stopped reading at that point.
评论 #3109641 未加载
mansr超过 13 年前
The author of that (badly timed, btw) post probably does not know that Python is implemented in C.
评论 #3109181 未加载
评论 #3109446 未加载