Programming

What to learn to be a better developer

Back in 2013, I gave a brief talk at php[tek] which was about all of the things you need to learn along the way to be a developer. I promised I would put up the list from my notes — and as you can see from the date, I pretty much failed on that promise. However! I found the notes! So without further adu…

PHP Coder

  • Broaden your general PHP knowledge
    • PDO
    • Namespaces
    • OOP
    • PSR-0 (and other PHP-FIG initiatives)
  • Code versioning (Git, SVN, anything…)
  • Dependency Managers (Composer!)

PHP Developer

  • Design Patterns
  • SPL
  • Unit testing
  • Basics of encryption
    • Public and private key encryption specifically
  • Code smells

Web Developer

  • Javascript
  • HTML & CSS
  • UI integration tests
  • Protocols
    • HTTP
    • HTTPS
    • SMTP
    • TCP
    • UDP
  • Learn about build automation tools (phing, make, ant, jenkins, travis)
  • Learn about deployment automation (capistrano, dploy.io, etc…)
  • Pick up some solid Linux administration skills
  • Code smells (MOAR!)

Software Developer

  • Pick up more languages
  • More design patterns
  • More code smells
  • Better your testing approach
  • Programming styles
    • Procedural
    • Imperative
    • Functional
    • Object Oriented
    • Event Driven
  • Build on a new type of platform (notice the “web” in “Web Developer” went away up there?)
    • Build a desktop, or mobile app.
    • Build a server daemon.
    • Build command line tools.
  • Learn to do Security Model assessment

Software Evangelist

  1. Pick a new thing to learn, and learn it!
  2. Teach others what you just learned
  3. GOTO 1

Introduction to building a programming language

I gave a talk at San Francisco PHP last week all about what it takes to start building a programming language. For the example, I have built out a small implementation of PHP in JavaScript I called PHP.js. We talked about the process of what it takes to build a programming language, as well as why programming languages are made, and some of the decisions that get baked into them while doing so. It was a fantastic group of people and I had a lot of fun giving the talk.

Additional resources:

Applying functional programming design principals to server architecture design

It occurred to me this morning that there are actually quite a few parallels between functional programming and infrastructure design and management.

It all started by what I realized that I said while talking about environments: Production is meant to go from one stable, working, vetted version of code to another stable, working, vetted version of code. Any state between those two is invalid and should (preferably) never occur.

If you cycle on that again, you start to see that most deployment processes you know about violate this One Basic Rule(tm).

I posit that if you are deploying new code to currently running hosts that are handling traffic, you are doing it wrong.

Think about it like this: what is the one core feature of every highly scalable functional programming language? Every one has (or has developed patterns which essentially create) immutable values.

So when we scale this out of software and apply it to infrastructure, your code is the value of your server. If you are changing the value of your server while other processes are trying to access it, you’re going to run into concurrency issues. Ask any developer about sharing data between threads, and they’ll quickly tell you it’s difficult. Why, then, do we improperly share data between releases of our software?

The simple answer is that you have two options for atomic deployments that follow the rules of immutability:

  1. Drop the servers you are deploying to out of the flow of traffic. This is the easiest, but still fails to honor the spirit of immutability because the value of the server is still changing, it’s just changing while nobody is looking.
  2. Spin up new instances, and slowly work them into live traffic, confirming along the way that you are in fact getting the expected behavior out of the code.

Now, I know this is all hand-wavy because it glosses over the important aspect of data migration: I don’t have an answer there, yet. I suspect the true answer to that part of the solution would be something to the effect of being able to seamlessly decouple your entire system from write traffic (using a request proxy which could ‘pause’ calls) for some period of time while data updates are done.

What if, to create a truly fault tolerant design, you simply create a nearly 100% asynchronous  API. All requests come in and go into a process queue, and are handled from there. This way you are never required to turn off traffic to do an atomic update of your software because you can simply tell it to stop processing while the update progresses.

Thoughts?

Upcoming travels

This week, I am in Louisville, KY at Code PaLOUsa! Next week, I leave for SXSW Interactive in Austin, TX. Right as I get back from SXSW, I take off for Midwest PHP in Minneapolis, MN.

I’m speaking at Code PaLOUsa and Midwest PHP, so if you’re around, be sure to come check out why you should care about development environments, and how to go about implementing them in your organization.

I love to meet new people, so if you see me, please come say “Hi!!” and introduce yourself.

Back to the basics: weekend hack project

This weekend I was invited by a few friends from the Ann Arbor PHP User Group to join them on Saturday night and figure out something to work on together.

TLDR: I need to do this more. It was immensely fun.

So it started off with a few ideas flying around on what to build, and then I’d mentioned that I have wanted to build an app for estimation poker since forever. Also — it seems I can be somewhat persuasive.

So the four of us sat down (Jonathan, Kelly, Jason and I) and we sorted out what our MVP (Minimum Viable Product to those of you who don’t live in startup land) was going to be. We settled on features and the basics of the protocol, and then had to pick technology. I’d seen that Ember.js seems particularly well built for building a multiple concurrent user system, so I suggested that, and I believe it was Jonathan who suggested Node.js for the back end, and of course — socket.io for communication. Jonathan and Jason would pair to build the back end, while Kelly and I would take the divide and conquer approach for the front end. With all of that decided, there was only one other choice to make…

Estabomb

Because it’s a fun name to say, that’s why.

So as of today, the minimum viable pieces are actually working. You can check out the github repository, or even see the live demo up on Heroku. I’m hoping we can maybe look at using it at work to help encourage participation during planning meetings perhaps, but even if that never comes to fruition, it has certainly been a fun project to work on, even just as far as it is now. It still has a lot of rough edges, but you can see it starting to come together.

twitter