Personal computing discussed

Moderators: renee, SecretSquirrel, just brew it!

 
RuiFig
Gerbil
Topic Author
Posts: 31
Joined: Tue May 19, 2015 4:46 am
Location: Edinburgh, Scotland
Contact:

Series of technical articles on C++ (mostly)

Wed Jun 08, 2016 4:50 pm

Been coding for some 25 years already, and this year I thought it was about time I start sharing knowledge instead of consuming it.
I focus mostly on C++, since that's what I use daily at work.

The last few months I've been creating articles about topics I've been dealing with at work. Mostly RPCs, Boost/Asio, etc.
Anyone interested in reading no-bs programming articles, go ahead. No ads. Just content, done with passion and love (And lots of wasted time). :)

Best ones so far (in my opinion), from oldest to newest:

Callstack markers (boost::asio::detail::call_stack)
Image

This article explores callstack markers, and a few things they can help us with. Very similar to a helper class found in Asio/Boost Asio (boost::asio::detail::call_stack) . Ends with a self-contained custom implementation.

How strands work and why you should use them
Image

This one focus on explaining the strand concept found in Asio/Boost Asio, and ends with a self-contained custom implementation. Uses the callstack markers class introduced in the previous one.

Portable C++ Timer Queue
Image

This dissects a portable timer queue, and again ends with a self-contained custom implementation.

Modern C++ lightweight binary RPC framework without code generation
Image

This one took me probably around 2 months to put together. Only a few hours here and there of course. It puts together a C++ RPC framework with a surprisingly simple API that doesn't need code generation. The framework has roots in something I started last year, but I pretty much refactored and improved the entire thing as I was writing the article.
I'm actively using this framework in my game, and it will be improved as I go. So the article will of course be out of sync with the source code repository soon enough.
Last edited by RuiFig on Wed Jun 08, 2016 5:10 pm, edited 2 times in total.
Code Monkey at Cloudgine Ltd. Personal blog on coding: http://www.crazygaze.com
 
morphine
TR Staff
Posts: 11600
Joined: Fri Dec 27, 2002 8:51 pm
Location: Portugal (that's next to Spain)

Re: "Crazygaze/Rui Figueira" technical articles

Wed Jun 08, 2016 5:05 pm

I'd like to place my Seal of Approval on Rui Figueira's articles. We're close friends, from the same hometown in Portugal (though he's currently in Scotland). He's already forgotten more about C and C++ than many people will ever know.
There is a fixed amount of intelligence on the planet, and the population keeps growing :(
 
lmc5b
Gerbil
Posts: 16
Joined: Tue Sep 15, 2015 5:33 pm

Re: Series of technical articles on C++ (mostly)

Wed Jun 08, 2016 7:38 pm

Thanks for sharing! You just gave me something to do this summer. (Portugal too btw)
 
RuiFig
Gerbil
Topic Author
Posts: 31
Joined: Tue May 19, 2015 4:46 am
Location: Edinburgh, Scotland
Contact:

Re: Series of technical articles on C++ (mostly)

Wed Jun 08, 2016 8:34 pm

lmc5b wrote:
Thanks for sharing! You just gave me something to do this summer. (Portugal too btw)


Yeah, what you should do this Summer is enjoy the Summer. I have none here to enjoy. hehe
Code Monkey at Cloudgine Ltd. Personal blog on coding: http://www.crazygaze.com
 
meerkt
Gerbil Jedi
Posts: 1754
Joined: Sun Aug 25, 2013 2:55 am

Re: Series of technical articles on C++ (mostly)

Wed Jun 08, 2016 8:40 pm

Thanks.

What do you create the charts with? :)
 
RuiFig
Gerbil
Topic Author
Posts: 31
Joined: Tue May 19, 2015 4:46 am
Location: Edinburgh, Scotland
Contact:

Re: Series of technical articles on C++ (mostly)

Wed Jun 08, 2016 8:45 pm

meerkt wrote:
What do you create the charts with? :)


With Leonardo

Quite good, although not ready for prime-time, since its still on version 0.11. Lots of artist tools missing.
I'm no artist, so it's plenty for me. I'm not missing any features.
The author is well on his way create the world's best painting application, like he claims in the website. :)

Update:
His twitter is https://twitter.com/henningtegen
Code Monkey at Cloudgine Ltd. Personal blog on coding: http://www.crazygaze.com
 
NTMBK
Gerbil XP
Posts: 371
Joined: Sat Dec 21, 2013 11:21 am

Re: Series of technical articles on C++ (mostly)

Thu Jun 09, 2016 6:19 am

Nice articles- bookmarked for later!
 
meerkt
Gerbil Jedi
Posts: 1754
Joined: Sun Aug 25, 2013 2:55 am

Re: Series of technical articles on C++ (mostly)

Thu Jun 09, 2016 9:10 am

RuiFig wrote:

Oh. Though you did it with some flowcharting software. How much work did it take?
 
RuiFig
Gerbil
Topic Author
Posts: 31
Joined: Tue May 19, 2015 4:46 am
Location: Edinburgh, Scotland
Contact:

Re: Series of technical articles on C++ (mostly)

Thu Jun 09, 2016 9:31 am

meerkt wrote:
RuiFig wrote:

Oh. Though you did it with some flowcharting software. How much work did it take?


Yeah, some of my co-workers thought I was using some fancy font to give it that feel. haha
At first I was drawing on the Surface Pro 3. Lately I've been using it with a Wacom drawing tablet.
The workflow on the Surface Pro is better, since we can rotate/zoom, etc easily.
But because I do most of my writing and coding on my desktop PC, I bought the Wacom to speed things a bit. Turns out it's not much of an improvement. The writing itself feels better. Feels closer to paper, instead of sliding on glass like the Surface Pro. But because Leonardo still has some problems with the Wacom tablets (He is aware of it), the workflow if not as good. I believe I draw faster on the Surface Pro.

Those articles took a long time to create. between 2 weeks and 1-2 months. But only a few hours here and there. Family life doesn't leave me much free time. Most code was initially from my own projects, but I ended up refactoring and improving it (e.g: To remove dependencies), so it took longer than it looks. For example, for the last article (the RPC framework), a couple of classes didn't even existed when I started.

The diagrams... yeah, they take a good while too, but I wanted the articles to have a bit of a personal touch, instead of just the usual enterprisey block stuff.
Code Monkey at Cloudgine Ltd. Personal blog on coding: http://www.crazygaze.com
 
RuiFig
Gerbil
Topic Author
Posts: 31
Joined: Tue May 19, 2015 4:46 am
Location: Edinburgh, Scotland
Contact:

Re: Series of technical articles on C++ (mostly)

Thu Jun 09, 2016 11:40 am

By the way, little poll on my twitter to decide what to write about next
https://twitter.com/RuiMVFigueira

For option 4, I'll do my best to write a quality technical article. :lol:
Code Monkey at Cloudgine Ltd. Personal blog on coding: http://www.crazygaze.com
 
RuiFig
Gerbil
Topic Author
Posts: 31
Joined: Tue May 19, 2015 4:46 am
Location: Edinburgh, Scotland
Contact:

Re: Series of technical articles on C++ (mostly)

Fri Jun 10, 2016 5:35 am

Next article planned after the short poll on Twitter.
Cache friendly ticking (as-in, ticking game component such as actors, calling functions at specified intervals, etc)
This one should be shorter and easier to follow. It's nothing that advanced.
The code will be short and easy to use template classes that makes ticking things easier, and hopefully more cache friendly.

I say hopefully, because although the code is useful as-is and I know it doesn't decrease performance, I never measured the potential gains.
I will be measuring it now and sharing the results, good or bad.
Code Monkey at Cloudgine Ltd. Personal blog on coding: http://www.crazygaze.com
 
meerkt
Gerbil Jedi
Posts: 1754
Joined: Sun Aug 25, 2013 2:55 am

Re: Series of technical articles on C++ (mostly)

Fri Jun 10, 2016 8:01 am

The drawings might go quicker if you find a decent flowcharting software, perhaps.
For the font, you can create one with multiple variants per letter. But you'll probably have to make a little utility to choose between equivalent codepoints at random.

Next article... although I'm not in the game, if I were I'd choose a combination of your mum + cats.
 
RuiFig
Gerbil
Topic Author
Posts: 31
Joined: Tue May 19, 2015 4:46 am
Location: Edinburgh, Scotland
Contact:

Re: Series of technical articles on C++ (mostly)

Fri Jun 10, 2016 8:25 am

[quote="meerkt"]The drawings might go quicker if you find a decent flowcharting software, perhaps.
For the font, you can create one with multiple variants per letter. But you'll probably have to make a little utility to choose between equivalent codepoints at random.

Well, I know it would be quicker if I used software. Especially when I decide to change the code midway and need to go back and change the drawing too. It happened a couple of times.
But It's meant to be a personal touch, so I don't mind the time. ;)

And yes, looks like mums and/or cats will be for the next time. hehe
Code Monkey at Cloudgine Ltd. Personal blog on coding: http://www.crazygaze.com
 
morphine
TR Staff
Posts: 11600
Joined: Fri Dec 27, 2002 8:51 pm
Location: Portugal (that's next to Spain)

Re: Series of technical articles on C++ (mostly)

Fri Jun 10, 2016 5:42 pm

Look at all these coders talking about the drawings instead of the code :x
There is a fixed amount of intelligence on the planet, and the population keeps growing :(
 
RuiFig
Gerbil
Topic Author
Posts: 31
Joined: Tue May 19, 2015 4:46 am
Location: Edinburgh, Scotland
Contact:

Re: Series of technical articles on C++ (mostly)

Fri Jun 10, 2016 5:45 pm

morphine wrote:
Look at all these coders talking about the drawings instead of the code :x


It's ok. Coders need to doodle too! :lol:
Code Monkey at Cloudgine Ltd. Personal blog on coding: http://www.crazygaze.com
 
Buub
Maximum Gerbil
Posts: 4969
Joined: Sat Nov 09, 2002 11:59 pm
Location: Seattle, WA
Contact:

Re: Series of technical articles on C++ (mostly)

Mon Jun 13, 2016 11:26 am

Looks like great stuff, Ruifig. Thanks for sharing it!
 
RuiFig
Gerbil
Topic Author
Posts: 31
Joined: Tue May 19, 2015 4:46 am
Location: Edinburgh, Scotland
Contact:

Re: Series of technical articles on C++ (mostly)

Sat Jun 25, 2016 5:08 am

I'm making some necessary changes to the RPC library because of what I need for my game, then I'll start working on a new article. ;)
Code Monkey at Cloudgine Ltd. Personal blog on coding: http://www.crazygaze.com
 
RuiFig
Gerbil
Topic Author
Posts: 31
Joined: Tue May 19, 2015 4:46 am
Location: Edinburgh, Scotland
Contact:

Re: Series of technical articles on C++ (mostly)

Tue Jun 28, 2016 8:42 pm

By the way... an oldie, done in 1997/1998, in collaboration with our dear friend morphine. Good times. haha

http://www.crazygaze.com/blog/2010/09/18/music-disk/
Image
Code Monkey at Cloudgine Ltd. Personal blog on coding: http://www.crazygaze.com
 
RuiFig
Gerbil
Topic Author
Posts: 31
Joined: Tue May 19, 2015 4:46 am
Location: Edinburgh, Scotland
Contact:

Re: Series of technical articles on C++ (mostly)

Thu Aug 24, 2017 3:50 am

Although it's been a while since I wrote any articles, about 2 weeks ago I gave a C++ talk here at Edinburgh.
First time they filmed those, so the setup was not the best, as you can see by the audio quality.
Also, I didn't have my notes due to the setup I was required to use, so I had to wing it a bit. Forgot some of the points I wanted to talk about.

https://www.youtube.com/watch?v=nb1fO4H9Q8w

And no, that's not Russian accent. It's portuguese. :)
Code Monkey at Cloudgine Ltd. Personal blog on coding: http://www.crazygaze.com
 
morphine
TR Staff
Posts: 11600
Joined: Fri Dec 27, 2002 8:51 pm
Location: Portugal (that's next to Spain)

Re: Series of technical articles on C++ (mostly)

Thu Aug 24, 2017 8:25 am

Ah, so many years working in a foreign country doing advanced stuff. But learning how to actually speak the language... oooh no, too much work.
There is a fixed amount of intelligence on the planet, and the population keeps growing :(
 
RuiFig
Gerbil
Topic Author
Posts: 31
Joined: Tue May 19, 2015 4:46 am
Location: Edinburgh, Scotland
Contact:

Re: Series of technical articles on C++ (mostly)

Thu Aug 24, 2017 8:45 am

The accent helps with the girls!
I'm like the Jose Mourinho of the games industry!
My mom always said I was special. 8)
Code Monkey at Cloudgine Ltd. Personal blog on coding: http://www.crazygaze.com
 
meerkt
Gerbil Jedi
Posts: 1754
Joined: Sun Aug 25, 2013 2:55 am

Re: Series of technical articles on C++ (mostly)

Thu Aug 24, 2017 6:48 pm

RuiFig wrote:
And no, that's not Russian accent. It's portuguese. :)

Russian, Portuguese... it's all Chinese to me. Especially Portuguese.

BTW, 1997-1998 isn't an oldie, it's a middie.

Who is online

Users browsing this forum: No registered users and 1 guest
GZIP: On