Computers have been around for less than 100 years. In that short period of time, some incredible things have happened: they’ve been universally adopted so quickly that we have them in our houses. In our cars. Even in our pockets. In the last 40 years, there have been many significant events when it comes to computers:
- Continuous decrease in size and increase in power.
- Access to computing at home and at work.
- Networking, the spread of the internet, and acceptance of the web.
- Computers in our hands (cell phones).
Similarly to those past events, an important development in computer science which has the potential to significantly impact the way we develop applications is machine learning and artificial neural networks.
I am privileged to say that over the last four years, I mentored a group of high school students wanting to experience STEM in a hands on way. The mission: create a robot in six weeks. The challenge: complete on time, under budget, and with a team who may not know one another. Sound familiar? (more…)
Software is a serious business. Fatal bugs have been around since at least the 1980s, and a decade-old report estimated the annual cost of bugs at $60 billion. Tech companies spend millions on political lobbying. Opponents argue over labor shortages and H-1B visas.
So how about we take some time out to give three cheers for a little levity?
hip hip array!
A few months ago I stumbled across an interesting open source project created by Katrina Owen
that provides a collection of programming practice problems in over 30 languages
. On the surface, it’s a great resource for learning to code or learning a new language. I’ve found however that as you dig deeper it has much more to offer on a number of levels.
To get started you simply install the exercism command line client, login with GitHub, pick a language to work in, and fetch your first problem. The first problem in many languages is often just a simple “hello world” exercise just to get you started. When you fetch a problem you get a ReadMe file with a description of the challenge and a suite of unit tests. In TDD style you write code until the tests are passing and you’ve solved the problem. Afterwards, you submit your solution and other exercism users are able to review and comment on your code. You can carry on the conversation and submit additional revisions of your code as part of this informal peer code review.
My previous post demonstrated the use of
Object.defineProperty to programmatically add a list of properties to an ES6 class, such as a Backbone.Model subclass, reducing the amount of boilerplate code necessary. The example in that post added simple getters and setters, but it’s possible to go further for Backbone.Model properties, also configuring in a single data structure functionality like:
- Options for properties, such as disabled setters
- Default values for properties
- Mappings for parsing date strings and model relationships
This technique uses a common base class from which all other model classes descend. The model subclasses (e.g. a user model) provide a list of property definitions, which centralize various aspects of those properties. The base class has configuration methods which iterate over the property definition objects.
In the particular examples below, the base configuration methods handle attribute to property name mapping, default values, and server data parsing, but this technique can be applied to other configurable property-related tasks, such as marking some properties blacklisted or viewable only by admins.