Live data from Hacker News

C++: A language for next generation web apps

stevehanov.ca

41–50 of 99 posts

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

#44

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 }

thats C not C++. geesh :P

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

#45
post #9

if you're on an embedded device, this is actually not a satire

So, serving web pages from an embedded device? Have we finally got to the "your washing machine is on the Internet" era? :)

It's not exactly Facebook, but I've seen plenty of small network-connected appliances provide web admin interfaces. Routers are a common example, I've also used network console servers that do this.

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

#46
post #24

Earlier quoted context omitted.

The question isn't "Can C++ work?" or "Will C++ be faster?" because we all know it can work and that it will be faster. The question is "At what point does the extra development time become more expensive than just adding another server to my Ruby/Python/C#/Whatever App" For me, someone who learned C++ in school but has been in managed enviornments ever since, I'd be too scared to use C++. I'm not ashamed to admit I…

"because we all know it can work and that it will be faster" Speed of execution depends more on the programmer's expertise than the language used.

Not really true. I can write the same algorithm in Perl as in Haskell, and the Haskell always runs faster.

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

#47
post #44

Earlier quoted context omitted.

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 }

thats C not C++. geesh :P

I hear C++ can call C functions these days.

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

#48
post #24

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…

The question isn't "Can C++ work?" or "Will C++ be faster?" because we all know it can work and that it will be faster. The question is "At what point does the extra development time become more expensive than just adding another server to my Ruby/Python/C#/Whatever App" For me, someone who learned C++ in school but has been in managed enviornments ever since, I'd be too scared to use C++. I'm not ashamed to admit I…

And it's not just the dev time: with C++ (and C, and any notorious unsafe language..) you've got to be extra diligent about security, which uses even more time, and requires expertise not just in C++ but also how to write secure software in low level languages... a skill many C/C++ devs lack, unfortunately.

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

#49

Earlier quoted context omitted.

"because we all know it can work and that it will be faster" Speed of execution depends more on the programmer's expertise than the language used.

Not really true. I can write the same algorithm in Perl as in Haskell, and the Haskell always runs faster.

So maybe he meant "on the expertise of the programmer" -- of the language/compiler...

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

#50
post #9

if you're on an embedded device, this is actually not a satire

I've worked on a lot of embedded devices with web services, and it seems pretty typical to just run a JVM and serve web pages out of it.

The few times I've seen actual web stacks done in C++, the end result has been... comedic.

Post reply on HN