
Librestd: a library to create C++ RESTful API services - beefhash
https://github.com/evilsocket/librestd
======
humanrebar
Quick feedback:

Use at least C++11 and the thread and mutex types in the standard library
become available. Of if you must use C++03, use boost for these. There's not a
good reason to reinvent those wheels.

Importing names (`using std::vector`, etc.) at the global scope in a header is
not a great idea. You likely won't get burned by it as a library author, but
the people wanting to use your library will, eventually.

I like the simplicity of approach for the http_request and http_response
types. Many libraries try to provide type safety (i.e., a way to define a
UserLoginRequest), but this is best left to a higher level library, in my
opinion.

Don't name your enums WITH_ALL_CAPS. Those sorts of names often get smashed by
the preprocessor. Given enough use, your library will eventually have a name
collision there. I prefer using 'enum class' enums from C++11 and normal
variable names. The enum class syntax forces the name to be scoped, so you
don't have to worry about ambiguity or name collisions (provided you don't use
YELLING_CASE_NAMES). If you _must_ use all caps for some reason, prefix with
your almost-certainly-unique namespace, so something like
RESTD_HTTP_STATUS_OK.

~~~
fnord123
They got the include order correct. Many many projects use the broken bsd
ordering.

------
arximboldi
There is this very nice talk on building a C++ rest framework using functional
programming concepts. I like the analytical approach to design, and really
hope it becomes an open source library soon.

[https://www.youtube.com/watch?v=nR2raX2-a0Q](https://www.youtube.com/watch?v=nR2raX2-a0Q)

------
katastic
I'm not trying to sound like a dick here but:

Zero front page documentation. Zero open issues. What are we supposed to do
with this link? Start sifting through source code?

~~~
jandrese
In bold: _UNDER HEAVY DEVELOPMENT_

I think this was posted too early to HN. It's not ready for prime time yet.

------
je42
no tests. :(

~~~
je42
why down vote ? do you really want to use a library without tests ?

~~~
grzm
Speculation, but perhaps it was a reaction to the short, negative response.
Clearly, you looked at it enough to note a lack of tests. Did you see anything
you liked? Something you might find useful? It's likely not your intent, but
one could have read your comment as dismissive and unnecessarily negative.
Then again, it's hard to know definitively why someone downvotes.

~~~
je42
actually, i am disappointed. if someone posts a library and then doesn't have
any tests.

It will be causing pain for the guys/girl how are using it. i.e. minor
changes. that are actually breaking etc...

On top, no tests => inferior code structure and architecture.

Without tests, properly structuring according to SOLID principles, get's
difficult.

~~~
grzm
As someone else pointed out, the first commit was 16 hours ago. Maybe a little
early to be disappointed about a lack of tests? It might have been posted to
HN earlier than the author wanted it to be widely known. Who knows?

I'm a big fan of tests myself. I'm also a big fan of pointing out positives as
well as negatives, and keeping things in perspective. It's easy to tear down
projects in their early days (hours!). Let's show a little support as well if
we're pointing out flaws rather than doubling down on negativity.

Anyway, you asked, I speculated, and that's that.

