The State of C++17

Whelp, I haven’t written in a while (I knew this would happen), but it’s okay.  Nothing like a dev conference to get me writing again.

 

I had been selected for two talks for DevSpace2017, which is going on as I write this.  My two talks are “C++17: Not Your Father’s C++” and “Building a Development Community In Your Workplace”

 

I delivered the C++ talk this morning, and I thought it went quite well.  What I want to address in this blog post is the state of C++, with respects to C++17.  C++11 was a huge impact to the C++ community.  We got Lambda’s, Type Inference, Variadic Templates, Smart Pointers, Type Traits, Constexpr, and a bunch of other game-changers.

 

Around the community, I’ve heard some conversations about if C++17 is a bust.  Is it a joke?  I think the reason for this is that people measure C++17 against C++11.  But this isn’t necessarily correct.  C++11 had 7 or 8 years to get moving and to introduce it’s ideas.  It came all at once, and compilers had to play catch up to deliver all these cool new features.

 

But the C++ committee realized this was subpar.  It was too much all at once.  So now they are doing something a bit different.  Smaller releases, more frequent.  (Of course I like this idea, it’s much closer to a continuous integration mindset – and yes I know that 3 years between releases is not continuous, but for compiler releases, I’ll take it).

 

So instead, I measure C++ 17 against C++14.  C++14 gave me a few things like make_unique and auto parameters in lambdas, but this wasn’t a game changer for me.  They were quality of life improvements.  C++17 on the other hand, has variants (Type-safe unions), optional, parallel algorithms, std::byte, string_view, fold expressions, plus a whole bunch of quality of life improvements.

 

People also complain about features that aren’t in the standard (concepts, ranges, modules, reflection, etc.).  I agree, it stinks that these didn’t make it.  But let’s not judge C++17 by what didn’t make it in, but instead, let’s look at what did.  When I look at it this way, I consider C++17 a great improvement to the language.

Advertisements

The Release of RCFC

I’ve done it!  I’ve released my first PyPI package!  pypi_release

RCFC is a remote control for computers.  The basic idea is that I want to be able to write some Python functions, and then have a UI that can call those functions.  As I change the code, no UI changes required, it’s all generated dynamically.

Continue reading

Music City Code 2017

I just got back from Music City Code 2017 and it was a blast.  It was my first time going there, and I had no idea to expect.  The talks were much better than I thought they would be, the venue was nice (Vanderbilt has a wonderful campus), and I got to meet some great people.

Let’s break down the days.

 

Day 1

Keynote: Change Your World with this One Simple Trick by Jeremy Clark (@jeremybytes)

This keynote was great.  The slides were all hand drawn, reminiscent of David Neal’s talks.  It was all about how meeting someone new can make you a better developer, and that’s what the conference was all about.

Among some of the good tips:

How to start a conversation

  1. Hi I’m <so and so>?
  2. What do you do?
  3. What technologies do you use?

And he explained how developers love to talk, but hate to start conversations.  You could tell everyone was trying this out throughout the conference, and I got to meet some interesting people.

 

F# Type Providers by Chris Gardner (@freestylecoder)

 

I had met Chris since he does the DevSpace conference here in town, and I was going to this conference to learn some new things, so I thought F# was a decent one to go learn about.  My experience with it was one day during Advent of Code, so I wanted to see some of the cool things that it had to offer.

F# Type providers was a awesome way to check the types of a data source at compile time.  The more errors you can push earlier, the better.  Why wait until runtime, when building the code can tell you if your datasource has missing or wrong types.  I’ll probably never use this, but it’s a cool concept

Data Visualization with NVD3.js and D3.js by Dustin Ewers (@dustinewers)

Dustin was a fun presenter.  He started off with a great example of what makes data visualization (the ability to interact and tell a story).  He had a great sense of humor, and presented in an interesting way.  We didn’t get as deep into D3.js as I wanted (we use it someplace at work, and I’d like to understand how it works under the hood), but he introduced me to nvd3.js to create really quick line graphs.

I was talking to some of the attendees of how to set up a Python webserver to host some of this sort of data.  I told them I’d get them something over lunch.  During lunch, I wrote up a quick script (you can find it here).  It was just using bottle to spin up a webserver and then figuring out how to load that up into a line graph in nvd3.  It was a lot simpler than I expected, and the other guys appreciated it a lot.

Lunchtime Functional Programming Panel

This was just a 4 person panel talking about how to get into functional programming and the benefits of it.  A lot of it was stuff I had already drank the Kool-Aid for, so nothing was too new.

 

A Lap Around Xamarin by Douglas Starnes (@poweredbyaltnet)

I don’t do a lot of .NET or mobile development, and this was probably the wrong talk for me.  I didn’t get a lot out of this talk, since the text was too small for me to read to understand what was going on.  It was alright, and there was nothing against the presenter or material, just ended up not being for me.

 

IoT with the ESP8266 and NodeMCU Firmware by Jason Follas (@jasonfollas)

This was an interesting talk about the options you have when building cheap IoT devices.  My co-works talk about the ESP8266 a lot, and I now know a lot more about it.  Most of this talk was explaining Lua, which I had already known, but seeing the workflow for the ESP8266 was pretty cool.

 

Day 2

ElasticSearch in an Hour by John Berryman @(jnbrymn)

I really liked this talk.  I knew nothing about ElasticSearch even though we use it at work on some other projects.  I thought this was a great introduction into how search engines work and in particular, ElasticSearch.  We talked about tokenization, stemming, relevance and indexing.  There were also some great examples contrasting a relational database and ElasticSearch.

 

Lightning Talks

So they had lightning talks in the same time frame as the other talks.  It’s a shame, because this meant there were 8 other talks going on at the same time.  As a result, only one person had registered to give a lightning talk in the two sessions I went too.  There was only about 12 people in the first one, and 4 in the next one.  So, we just did impromptu lightning talks.  I gave two talks, one recapping what I had done the day before with bottle/NVd3 and another that I gave at ADTRAN about Terrible,Terrible Things you can do in C++.  I got to learn a whole lot of other stuff, such as bayes statistics, F# Type Providers (again), Accessibility, and Interview techniques.

 

Lunchtime Software Quality Panel

It was refreshing to hear people in the industry talk candidly about how they expect people to be writing tests up front, and how to change culture to address software quality.  There was a lot of great discussion, and I agreed with most of it.

 

R: It’s Not Just For Pirates Anymore by Dustin Ewers (@dustinewers)

I liked Dustin’s talk the day before, so I decided to listen some about R.  I don’t have any plans to write any R, but it was good to know what the language was capable of.  It reminded me of Pandas in Python.  Dustin had the same good humor and relevant examples.  It was also cool to see how easy it was to write a clustering algorithm or decision tree.  It seems that machine learning is a first class citizen for this language.

 

Career Growth Questions You’re Afraid To Ask by Cassandra Faris (@cassandra Faris)

I was originally going to go to a JS talk, but I decided to do a soft skills talk instead.  This was an interesting take from a recruiter/HR perspective of how to for a new job.  It was nice to see what they were looking for in candidates, what were red flags, and the advice on how to sell yourself.

 

Wrap-up

I will definitely go back to Music City Code next year, as it was much better than I expected.  Talks were good, food was good, people were friendly, and I couldn’t ask for much more.  Plus it’s an hour and a half away from me, so it makes it much easier to be able to go check it out each year.

The Thing I Hate About Distributed Systems

I’ve always been fascinated with distributed systems.  It’s awesome that although we haven’t seen much in terms of increase of processing power, but instead we are moving to multi-core commodity hardware and scaling horizontally across it.  When I just started professionally programming, distributed systems just meant you had a handful of programs keeping in concert with each other of sockets, each doing different pieces of the solution.   It was a simpler time.

Now, you’re talking about a much more massive scale.  I contribute IoT and cloud services like AWS or GCP with the rise of accessibility for making distributed programs easy.  There’s also a slew of tools that are awesome and specifically designed for managing distributed systems.  Kafka for your messaging, Zookeeper for service management, Spark for Data Science, the list goes on.  Even my favorite language, Elixir, is built with distributed systems in mind.  But there’s a catch

Continue reading

Alexa-Controlled Remote Part II

So I got my new LEDs in, and lo and behold, it works!

To make sure that they were blinking, I wrote a quick Python script that toggled multiple pins (right now its hardcoded to just 1 pin, but I could have changed variables to toggle others).  This was very nice, as I could have it turn on every 15 seconds or so and watch it on my phone camera.


import RPi.GPIO as GPIO
import time

gpio_start = 18
gpio_end = 19

GPIO.setmode(GPIO.BCM)

for x in range (gpio_start, gpio_end):
   GPIO.setup(x, GPIO.OUT)

while True:
   
   for y in range (gpio_start, gpio_end):
      GPIO.output(y, True)
      print 'on ', y
   time.sleep(15)
   
   for z in range (gpio_start, gpio_end):
      GPIO.output(z, False)
      print 'off ',z
   time.sleep(15)

Toggling pins through Python was nice and easy.

Continue reading

DIY Alexa-Controlled Remote Control

So, I think I’m going to embark on my first official hardware project.  I want to make something I can voice-control that allows me to do common operations on my projector and sound system (Like power on, switch to Blu-Ray, etc.)  I don’t have much of a HW background (I’ve made it maybe halfway through Make Electronics – excellent book by the way), so I figured this would be interesting.  I got a new RaspberryPi 3 for Christmas, and have been looking for a good project for it.

So, I knew I needed an IR transmitter to simulate a remote.  I figured I’d get a IR receiver as well to record signals and learn more.  So I browsed the web and found two that I liked (IR Transmitter and IR Receiver) from the same company.  It looked no-fuss as well, where I just had to connect ground, voltage, and two GPIO pins.  Didn’t sound too bad.

So let’s get started!

Continue reading

PyTennessee 2017 Day 2

Some of our party were feeling ill for the second day of PyTN, so we made it as far as my talk, and then had to boogey out of there.

Let’s see what I went to though:

 

Keynote: A deeper look at the Operating System by Sophie Rapaport (@sfrapoport)

Sophie was a good speaker, keeping us engaged for most of the talk.  While I knew most of the stuff from before, due to operating systems and working on embedded systems,it was still nice to see Sophie explain that even just with Python, you can start learning about under the hood parts of the language without diving into C.  I think it was a nice talk for all the people who had no OS experience before.  She also was able to relate to why we should care, and I’ve always liked when a speaker finds a way to connect the why with the how.

 

Scraping a great data set to predict Oscars by Deborah Hanus (@deborahhanus)

This was a nice quick talk about the methodology Deborah used to complete one of our course projects.  Her goal was to predict box office hits and Oscars using data science.  She walked through how to scrape data from multiple sources, how to analyze and clean data, and then how to present it.   I didn’t find too much of this revolutionary, but it did offer a glimpse into how easy it may be to grab a data set and go to town on it.

Lunch Lightning Talks

This was another set of good lightning talks.  We heard about writing great tutorials, Legacy Python vs Python 2, and a few others that I can’t remember

What Time is it Anyway by Greg Back (@gtback)

This was another quick talk discussing the options that you have in Python of how to get timing right.  We explored what the standard library gave us (which is great if you need to be timezone naive), and what some other libraries offered (including up to date timezone information.

BDD To The Bone by Pat Viafore (@PatViaforever)

So this was my talk!  It went quite well in my opinion, but I’m biased.  I didn’t get the audience I was hoping for (~25 people) but I saw a lot of vigorous nodding so I got some things right.  I had some immediate feedback and questions, which means people were interested.  I talked to some QA engineers from Emma, and some local Huntsville people and had some good discussions on how BDD can help people.

I had some nerves in the beginning, but I think the talk went smoothly.  See for yourself at https://youtu.be/H2FuJYlbzDg

 

We were so tired after all this though, we skipped the last two talks and headed home.  It was another great conference.  I wish I took some more time to meet more people, but I’ll have another chance when we go next year.