Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Hard work pays off

82 views
Skip to first unread message

woodb...@gmail.com

unread,
Nov 28, 2019, 2:29:26 PM11/28/19
to
Shalom, comp.lang.c++,

I think my work in terms of on-line services is
in pretty good shape, but I'll let you be the judge:

https://github.com/Ebenezer-group/onwards

https://github.com/Ebenezer-group/onwards/blob/master/src/cmw/tiers/genz.cc
https://github.com/Ebenezer-group/onwards/blob/master/src/cmw/tiers/cmwA.cc

If you have suggestions on how to improve things, please
let me know.


Brian
Ebenezer Enterprises - Enjoying programming again.
http://webEbenezer.net

Öö Tiib

unread,
Nov 28, 2019, 6:03:02 PM11/28/19
to
On Thursday, 28 November 2019 21:29:26 UTC+2, woodb...@gmail.com wrote:
> Shalom, comp.lang.c++,
>
> I think my work in terms of on-line services is
> in pretty good shape,

Ok.
Strange little piece of code. What it does?
Why "::exit(EXIT_SUCCESS);" is better than "return EXIT_SUCCESS;"
in main()?
Also I would manually inline the "leave" since its name
and all the missing comments hide that it was a failure.

> https://github.com/Ebenezer-group/onwards/blob/master/src/cmw/tiers/cmwA.cc

C++17 features seem to be used just to make it harder
to read like:

if(auto ind=buf.reserveBytes(1);!buf.receive(ind,marshalFile(mdlFile,buf)))
receive(buf,mdlFile,1);

60 lines feels bit too long for a conversion constructor. Is
ambassador destructively constructing itself into that
"config"? Or why else conversion constructor has a mutable
parameter?

> If you have suggestions on how to improve things, please
> let me know.

Unsure. Does it have some benefits over Protobufs, Flatbuffers, Cereal,
Cap'n Proto, Bond, Apache Avro, Thrift, MessagePack etc etc?

With every other serialization library it takes about 15 minutes from
downloading or cloning to get something to work with no any external
aid needed. Here it is building some kind of 4 executables that are
needed to be registered somewhere even to try.

woodb...@gmail.com

unread,
Nov 28, 2019, 7:54:54 PM11/28/19
to
On Thursday, November 28, 2019 at 5:03:02 PM UTC-6, Öö Tiib wrote:
> On Thursday, 28 November 2019 21:29:26 UTC+2, woodb...@gmail.com wrote:
> > Shalom, comp.lang.c++,
> >
> > I think my work in terms of on-line services is
> > in pretty good shape,
>
> Ok.
>
> > but I'll let you be the judge:
> >
> > https://github.com/Ebenezer-group/onwards
> >
> > https://github.com/Ebenezer-group/onwards/blob/master/src/cmw/tiers/genz.cc
>
> Strange little piece of code. What it does?

It's the front tier of my code generator. It sends a message
to the middle tier and waits for a reply.

> Why "::exit(EXIT_SUCCESS);" is better than "return EXIT_SUCCESS;"
> in main()?
> Also I would manually inline the "leave" since its name
> and all the missing comments hide that it was a failure.

Leave is called in a number of places. Not sure of a better name.

>
> > https://github.com/Ebenezer-group/onwards/blob/master/src/cmw/tiers/cmwA.cc
>
> C++17 features seem to be used just to make it harder
> to read like:
>
> if(auto ind=buf.reserveBytes(1);!buf.receive(ind,marshalFile(mdlFile,buf)))
> receive(buf,mdlFile,1);
>

That line is tough, but at least the variable's scope is limited.

> 60 lines feels bit too long for a conversion constructor. Is
> ambassador destructively constructing itself into that
> "config"? Or why else conversion constructor has a mutable
> parameter?

That constructor used to be over 100 lines. It's the biggest
function by far in the program. I used to wonder if that
function would ever get better. Wrestling with it has paid
off. I think the parameter used to be const. I'll consider
making it const again.

>
> > If you have suggestions on how to improve things, please
> > let me know.
>
> Unsure. Does it have some benefits over Protobufs, Flatbuffers, Cereal,
> Cap'n Proto, Bond, Apache Avro, Thrift, MessagePack etc etc?
>
> With every other serialization library it takes about 15 minutes from
> downloading or cloning to get something to work with no any external
> aid needed. Here it is building some kind of 4 executables that are
> needed to be registered somewhere even to try.

Only 2 executables are needed. They are the ones I linked to
above. The other two are example programs. I'm happy to
give demos of the software. The first step is to download the
repo and build it. Yes, after that, you need a little help
from me. The example programs can be run without an account.


Brian
Ebenezer Enterprises
https://github.com/Ebenezer-group/onwards

Öö Tiib

unread,
Nov 28, 2019, 8:21:10 PM11/28/19
to
On Friday, 29 November 2019 02:54:54 UTC+2, woodb...@gmail.com wrote:
> On Thursday, November 28, 2019 at 5:03:02 PM UTC-6, Öö Tiib wrote:

> > Also I would manually inline the "leave" since its name
> > and all the missing comments hide that it was a failure.
>
> Leave is called in a number of places. Not sure of a better name.

English has plenty of verbs (like retiring, abandoning or ceasing)
that have more solemn implications than just leaving.
<https://www.thesaurus.com/browse/relinquish>



woodb...@gmail.com

unread,
Nov 29, 2019, 9:45:46 AM11/29/19
to
On Thursday, November 28, 2019 at 6:54:54 PM UTC-6, woodb...@gmail.com wrote:
> On Thursday, November 28, 2019 at 5:03:02 PM UTC-6, Öö Tiib wrote:
> > On Thursday, 28 November 2019 21:29:26 UTC+2, woodb...@gmail.com wrote:
> > > Shalom, comp.lang.c++,
> > >
> > > I think my work in terms of on-line services is
> > > in pretty good shape,
> >
> > Ok.
> >
> > > but I'll let you be the judge:
> > >
> > > https://github.com/Ebenezer-group/onwards
> > >
> > > https://github.com/Ebenezer-group/onwards/blob/master/src/cmw/tiers/genz.cc
> >
> > Strange little piece of code. What it does?
>
> It's the front tier of my code generator. It sends a message
> to the middle tier and waits for a reply.
>
> > Why "::exit(EXIT_SUCCESS);" is better than "return EXIT_SUCCESS;"
> > in main()?
> > Also I would manually inline the "leave" since its name
> > and all the missing comments hide that it was a failure.
>
> Leave is called in a number of places. Not sure of a better name.
>
> >
> > > https://github.com/Ebenezer-group/onwards/blob/master/src/cmw/tiers/cmwA.cc
> >
> > C++17 features seem to be used just to make it harder
> > to read like:
> >
> > if(auto ind=buf.reserveBytes(1);!buf.receive(ind,marshalFile(mdlFile,buf)))
> > receive(buf,mdlFile,1);
>
> That line is tough, but at least the variable's scope is limited.
>
After thinking about it, I changed the second line to this:
receiveNull(buf,mdlFile);

and changed the interface/implementation of the function
I had been calling in that snippet. Thanks for your comments.

woodb...@gmail.com

unread,
Dec 2, 2019, 10:51:36 AM12/2/19
to
I have these lines in a file:

#include<winsock2.h>
#include<ws2tcpip.h>

. If I remove the first include, the code still
compiles on my Windows 10 machine. Do you think it's
OK to commit it without that include? This is the file:
https://github.com/Ebenezer-group/onwards/blob/master/src/cmw/Buffer.hh

Tia.

Öö Tiib

unread,
Dec 2, 2019, 1:27:19 PM12/2/19
to
On Monday, 2 December 2019 17:51:36 UTC+2, woodb...@gmail.com wrote:
> I have these lines in a file:
>
> #include<winsock2.h>
> #include<ws2tcpip.h>
>
> . If I remove the first include, the code still
> compiles on my Windows 10 machine. Do you think it's
> OK to commit it without that include? This is the file:
> https://github.com/Ebenezer-group/onwards/blob/master/src/cmw/Buffer.hh

I usually comment #include why I include it, what I plan in current
file to use from it.
All your #includes are without comments ... you perhaps
dislike commenting in general? So now it is interesting task
how can we figure why you included these headers? May be you
have notes somewhere else and so can tell?

woodb...@gmail.com

unread,
Dec 2, 2019, 2:14:03 PM12/2/19
to
On Monday, December 2, 2019 at 12:27:19 PM UTC-6, Öö Tiib wrote:
> On Monday, 2 December 2019 17:51:36 UTC+2, woodb...@gmail.com wrote:
> > I have these lines in a file:
> >
> > #include<winsock2.h>
> > #include<ws2tcpip.h>
> >
> > . If I remove the first include, the code still
> > compiles on my Windows 10 machine. Do you think it's
> > OK to commit it without that include? This is the file:
> > https://github.com/Ebenezer-group/onwards/blob/master/src/cmw/Buffer.hh
>
> I usually comment #include why I include it, what I plan in current
> file to use from it.
> All your #includes are without comments

Some of the #includes in that file have comments.

> ... you perhaps
> dislike commenting in general?

I don't think there's much point in commenting
all of them. I admit it would be better if there
were a comment on the line in question. Sorry the
code isn't perfect... it is by the grace of G-d
getting better.

Öö Tiib

unread,
Dec 2, 2019, 2:57:46 PM12/2/19
to
On Monday, 2 December 2019 21:14:03 UTC+2, woodb...@gmail.com wrote:
> On Monday, December 2, 2019 at 12:27:19 PM UTC-6, Öö Tiib wrote:
> > On Monday, 2 December 2019 17:51:36 UTC+2, woodb...@gmail.com wrote:
> > > I have these lines in a file:
> > >
> > > #include<winsock2.h>
> > > #include<ws2tcpip.h>
> > >
> > > . If I remove the first include, the code still
> > > compiles on my Windows 10 machine. Do you think it's
> > > OK to commit it without that include? This is the file:
> > > https://github.com/Ebenezer-group/onwards/blob/master/src/cmw/Buffer.hh
> >
> > I usually comment #include why I include it, what I plan in current
> > file to use from it.
> > All your #includes are without comments
>
> Some of the #includes in that file have comments.

Mea culpa.

> > ... you perhaps
> > dislike commenting in general?
>
> I don't think there's much point in commenting
> all of them. I admit it would be better if there
> were a comment on the line in question. Sorry the
> code isn't perfect... it is by the grace of G-d
> getting better.

Ok. I wasn't trying to distract you from that process
just to give an hint why it is difficult for us to aid:
0 new messages