Live data from Hacker News

C++: A language for next generation web apps

stevehanov.ca

11–20 of 99 posts

Re: C++: A language for next generation web apps

#14
It's perfectly sane to write web services (computationally heavy processes accessed via REST) in C++. But for the algorithm-light, marketing-heavy frontend to such a service, use something easier—the optimizations C++ offers aren't worth it there.

Re: C++: A language for next generation web apps

#15
To be fair, after coming back to C++ after years in the world of Python and Haskell, it's not as bad as I remembered.

C++ is actually a moderately effective functional programming language. With reasonable knowledge of the standard data structures, and using BOOST, one can actually write fairly expressive and effective C++ code.

Most of the time, I feel like all I'm doing is writing a much more verbose version of Python. The rest of the time, I'm hunting nightmarish segfaults and segfault and template errors.

Re: C++: A language for next generation web apps

#16

Earlier quoted context omitted.

I had to read that a few times. What is he talking about?

1 wchar_t * 2 utf2wide(const char *utf) 3 { 4 size_t len; 5 wchar_t *wide; 6 len = mbstowcs(NULL, utf, 0); 7 wide = malloc(sizeof(*wide) * (len + 1)); 8 mbstowcs(wide, utf, len); 9 return wide; 10 }

That is definitely the most to-the-point response I've ever seen.

Re: C++: A language for next generation web apps

#19

To be fair, after coming back to C++ after years in the world of Python and Haskell, it's not as bad as I remembered. C++ is actually a moderately effective functional programming language. With reasonable knowledge of the standard data structures, and using BOOST, one can actually write fairly expressive and effective C++ code. Most of the time, I feel like all I'm doing is writing a much more verbose version of Pyt…

Oddly enough I'm back to C++ too, after Ruby.

One nice thing is; in a fast language, tests run quickly too.

Also, Python and Ruby don't have the equivalent of an ASSERT (you could roll your own but it's not standard practice).

Also, C++ has standard hash lists and complicated data structure are actually going to run quickly.

And while memory management can be a pain, you are doing it yourself so you can track down memory leaks rather than having them be inherent in the interpreter...

...as in Ruby AND Mono.

Re: C++: A language for next generation web apps

#20

To be fair, after coming back to C++ after years in the world of Python and Haskell, it's not as bad as I remembered. C++ is actually a moderately effective functional programming language. With reasonable knowledge of the standard data structures, and using BOOST, one can actually write fairly expressive and effective C++ code. Most of the time, I feel like all I'm doing is writing a much more verbose version of Pyt…

Oddly enough I'm back to C++ too, after Ruby. One nice thing is; in a fast language, tests run quickly too. Also, Python and Ruby don't have the equivalent of an ASSERT (you could roll your own but it's not standard practice ). Also, C++ has standard hash lists and complicated data structure are actually going to run quickly. And while memory management can be a pain, you are doing it yourself so you can track down m…

C++ doesn't actually have a standard "hash list" (I assume you meant hash map or hash set?). Depending on your implementation, you either have hash_{map,set}, unordered_{map,set}, both, or something entirely different. tr1 specified unordered_{map,set}, but tr1 is only technically a proposal, not a standard.

I think a safe assumption is that tr1::unordered_{map,set} will be available in all implementations by now, but until C++0x is ratified and implemented by major compilers, you will run into different platforms having (possibly) different implementations. And lets be honest - even after C++0x has been implemented in major compilers, you will still have subtly different/buggy implementations.

edit: I had conflated {hash,unordered}_{set,map}. Fixed

Post reply on HN