News for hackers. Stuff that matters.
Re:Ask HN: Why aren't there enough C & C++ Web frameworks? by rdouble on Monday March 04, 2013 @09:50PM (#5322561)
Because it sucks to deal with strings in C & C++, and the web is mostly strings.
Re:Ask HN: Why aren't there enough C & C++ Web frameworks? by slake on Tuesday March 05, 2013 @04:32AM (#5323708)
Is C & C++ really worse than Java at strings? Don't think so but I'm not sure. Can't imagine they're far apart.
Re:Ask HN: Why aren't there enough C & C++ Web frameworks? by mschuster91 on Tuesday March 05, 2013 @08:13PM (#5328671)
C definitely - strlen() not binary safe, you have to deal with malloc()/free()/strdup() etc. by hand instead of letting a highly optimized GC do the job...
Re:Ask HN: Why aren't there enough C & C++ Web frameworks? by dmm on Tuesday March 05, 2013 @10:27PM (#5329139)
Or you could just strdup and malloc a bunch of strings and let the kernel clean it up when the cgi process exits. ;)
Re:Ask HN: Why aren't there enough C & C++ Web frameworks? by wmil on Wednesday March 06, 2013 @02:28AM (#5329888)
Yes. C & C++ strings are so bad that most large libraries ship with their own string functions.
Re:Ask HN: Why aren't there enough C & C++ Web frameworks? by niggler on Monday March 04, 2013 @09:11PM (#5322441)
You should investigate "CGI", arguably the simplest such "framework"
Re:Ask HN: Why aren't there enough C & C++ Web frameworks? by mschuster91 on Monday March 04, 2013 @09:11PM (#5322442)
Easy for C, getting shit done (tm) is something for pros. The subtlety of getting malloc, free, and pointer arithmetic in general, right just isn't easy for a novice coder.

C++ suffers from the same problem, just to a lesser degree.

node.js on the other hand has the advantage that nearly everyone who knows a bit of JS from his latest website gig can also do a node.js application.

Re:Ask HN: Why aren't there enough C & C++ Web frameworks? by slake on Tuesday March 05, 2013 @04:30AM (#5323705)
Well isn't that really because nodejs has the V8 engine behind it which has created enough helper functions and libraries to make it easy to make a webapp on. Otherwise there isn't much on the barebones JS language itself to build a webapp is there? If C/C++ got those frameworks wouldn't they have had these libraries built as well.
Re:Ask HN: Why aren't there enough C & C++ Web frameworks? by slake on Tuesday March 05, 2013 @04:33AM (#5323709)
You're right on the pointer arithmetic though. But JS callbacks are pretty confusing too. But ppl learn it because they have to.
Re:Ask HN: Why aren't there enough C & C++ Web frameworks? by throwaway420 on Monday March 04, 2013 @09:45PM (#5322548)
The average website essentially boils down to a CRUD app of some sort. You're creating, reading, updating, and deleting text in a database.

Does using C really benefit the average new business with this task?

I'd love to do more C web-development, but it's sort of logical that C web frameworks aren't as common as other languages.

Re:Ask HN: Why aren't there enough C & C++ Web frameworks? by slake on Tuesday March 05, 2013 @04:34AM (#5323712)
Yeah but if CRUD alone was what's important, doubt the world would have gone far beyond PHP, right?
Re:Ask HN: Why aren't there enough C & C++ Web frameworks? by stewie2 on Monday March 04, 2013 @11:49PM (#5322990)
https://bitbucket.org/futurapp/swiftly

This is a C++ web framework I wrote. It's a work in progress. I could beat go and nodejs in some simple perf test.

Re:Ask HN: Why aren't there enough C & C++ Web frameworks? by slake on Tuesday March 05, 2013 @04:30AM (#5323707)
Sweet I'll check it out.
Re:Ask HN: Why aren't there enough C & C++ Web frameworks? by dmm on Tuesday March 05, 2013 @10:26PM (#5329134)
The OpenBSD news site undeadly.org is written in c. You can grab the source here: http://undeadly.org/undeadly-src.tar.gz
Re:Ask HN: Why aren't there enough C & C++ Web frameworks? by yen223 on Tuesday March 05, 2013 @09:32PM (#5328961)
In a way, all web frameworks are written in C - at least, the Python, Ruby, and PHP interpreters are written in C, and the V8 engine is written in C++ :)