HN user

racER

1 karma

C/C++ hacker/coder :) Loving asynchronous I/O for high load internet applications.

Posts0
Comments2
View on HN
No posts found.
Side Projects Kill 14 years ago

Yes, mine! ;) I'm father of one kid, additional twins expected in december. :)

I think it depends on the type of work. We're developing software, and this can be done practically anytime. Personally I go to office very late (to have some time with my kid in the morning), and often return early enough to also play in the evening. Then, after putting her into bed, I can work again until 02.00 AM. But it's also important to mention that your wife (or spouse) has to tolerate this, too! :)

And to side projects: I think they're even more important the more time you invest into a certain single project, to look beyond one's own nose. They keep you open-minded, and sometimes even integrate into your current main project.

Well, I can't see any specific advantage on using C/C++ as backend of a plain old CGI API. Personally I'd use PHP or something like that, which integrates tighter with the web server. Using C on CGI is propably not very much faster compared to an optimized PHP environment with precompiled (cached) p-code.

> "C programs are suspectible to memory corruption." (tptacek)

Yes, they are, because in C you can do memory corruption, in many other languages you can't (even if you'd want to). But where do these corruptions most likely occur, when speaking in context of web applications? Yes, in I/O and string operations. And all these can be mitigated with somehow "safe" classes - by these I mean not a home-brew string-class, but something like STL (which has proven stability).

However, is memory corruption the only security risk? In my opinion, an average C/C++ programmer creates more secure code than an average PHP programmer - just because a C programmer is used to the intrinsic security issues, while the PHP coder won't produce an buffer overflow by not validating input, but leaves eg. XSS or SQL injection holes.

Writing a web application in C without preparing for safe I/O & string operations is as bad as writing dirty script code in PHP/Perl/Ruby/...

At my company we've written a really big web application (a hosting control panel) completely in C/C++, but for other reasons than execution speed: the runtime dependencies of a sellable web application are pure horror. Neverending CPAN-depencencies in Perl, incompatible function changes in PHP, and so on. With a monolithic app (web server & application logic all-in-one) you just need a libc - that's all. Easy to roll out, and thus easy to sell. :)