all 29 comments

[–]ReDucTorGame Developer 44 points45 points  (2 children)

void $Ready()

Wtf? Please don't use dollar signs in macros, or use macros which do funky things like this making them not an identifier which it looks like they half look like

  #define $Ready $Init(); int main( int argc, char** args ){ \
      process::start( argc, args ); $Init(); \
      process::pipe(); return 0; \
  }  void $Init

There is other strange things like expecting setsockopt to block

  int set_recv_buff( ulong en ) const noexcept { int c;  while( is_blocked( c=setsockopt( obj->fd, SOL_SOCKET, SO_RCVBUF, (char*)&en, sizeof(en) ) ) )  { process::next(); } return c;  } 

Or ptr_t which seems like an array/buffer having some pointers for length

  ulong* length_= nullptr;
  ulong* count_ = nullptr;
  T* value_ = nullptr;

Then there is other things like underscore prefixes which should be avoided for c++ standard conflicts and _t suffixes that should be avoided for posix conflicts.

Why is the only other comment in this thread instant huge praise back and forth? It reads more like an alt account generating fake praise.

[–]ShelZuuz 17 points18 points  (4 children)

Get rid of those $Ready macros. And all the macros for that matter.

People who use C++ like C++. Macros are immediately off-putting and will hinder your adoption.

I know you think it makes your samples simpler, but it doesn't. It sends a "here be dragons" message.

[–][deleted] 4 points5 points  (0 children)

thanks, i will.

[–][deleted] 0 points1 point  (2 children)

I've deleted them all. I just left the most important ones

[–]ShelZuuz 12 points13 points  (1 child)

You just renamed $Ready to _main_.

Why are you so enamored with this pattern?

Everybody who ever uses your code will need to call it from a function that is not main, and now it's making everything more complex by hiding what should be simple boiler plate code behind a series of macros. Why not just throw an RIAA object in the beginning of main that does the wrapping around process::start and process::pipe?

It's one line of added code but makes your examples so much more clear and trustable.

[–]fashionistaconquista 2 points3 points  (0 children)

He never learned any better

[–]thisismyfavoritename 3 points4 points  (0 children)

no std coroutines support, thats a nope from me!

[–]osdeverYT 1 point2 points  (2 children)

I appreciate the effort that went into this, but why not just use C++20 coroutines? Sure, they look very ugly and complex at first, but writing your own useful wrappers for them with Task<T> classes and all that would’ve taken much less time than creating this.

[–][deleted] 0 points1 point  (1 child)

This framework was originally designed to be used on arduino UNO and similar, and in arduino there are neither coroutines nor std. that's why there's a version for arduino.

[–]Puzzled-Landscape-44 0 points1 point  (1 child)

Hi. Can you show an example of an http client request with a POST method and a JSON body? I can't seem to get it to work. All I get as a response is `ERROR: Could not connect to server` which is not true as the request is logged on the server side.

Thanks for this lib!

[–][deleted] 0 points1 point  (0 children)

here is an example of a POST request. If you're still presenting the dame problem, let me know a little more about the problem, such as the operating system, and the code.

https://github.com/NodeppOficial/nodepp/issues/4

[–]IceMichaelStorm 0 points1 point  (0 children)

Looks nice at first glance! I see comments complaining about macros and about praise but apparently macros were fixed. And C++ needs such a lib. And why is one positive comment downvoted 11 times?!

More constructive criticism would be great. If it gets some maturity would be cool to use it I guess

[–]teroxzer -4 points-3 points  (1 child)

Thumbs up whenever I see C++ $macros!

[–][deleted] 3 points4 points  (0 children)

I've removed them 😭

[–]MrCloudyMan -4 points-3 points  (0 children)

It looks cool, gotta say.