Worm with Glasses

Coding • DevOps • Personal

Dec 12, 2017

🔗 Writing Code Like a Mathematical Proof

Spiro Sideris writes:

To write understandable code, always ask the question of who your audience is. What level of experience do they have? What are the prerequisites they should know before reading this function? There are even differences in the semantics between programming languages, so knowing the best practices, and the language coding style, will ensure you are writing readable code for developers in that language.

Writing Code Like a Mathematical Proof

Dec 12, 2017

🔗 Rob Pikes 5 Rules of Programming

Rule 1. You can’t tell where a program is going to spend its time. Bottlenecks occur in surprising places, so don’t try to second guess and put in a speed hack until you’ve proven that’s where the bottleneck is.

Rule 2. Measure. Don’t tune for speed until you’ve measured, and even then don’t unless one part of the code overwhelms the rest.

Rule 3. Fancy algorithms are slow when n is small, and n is usually small. Fancy algorithms have big constants. Until you know that n is frequently going to be big, don’t get fancy. (Even if n does get big, use Rule 2 first.)

Rule 4. Fancy algorithms are buggier than simple ones, and they’re much harder to implement. Use simple algorithms as well as simple data structures.

Rule 5. Data dominates. If you’ve chosen the right data structures and organized things well, the algorithms will almost always be self-evident. Data structures, not algorithms, are central to programming.

Rob Pikes 5 Rules of Programming

Nov 10, 2017

🔗 Coding Principles Every Engineer Should Know

Sam Schillace writes:

I was talking with the engineering team at Box about what I’ve learned along this journey, and what came out of that conversation were my personal engineering principals. These aren’t rules or engineering guidelines. They’re simply the principles that I pay attention to when I write and operate code.

These include:

  • Be paranoid.
  • Don’t lie to the computer.
  • Keep it simple.
  • First rule of optimizing: don’t.
  • Don’t just fix the bug; fix all possibility of it ever happening again.
  • Question assumptions constantly.
  • Think long term. Slow down, it goes faster.
  • Care about your code.
  • Cheap, fast, right — pick two.
  • Conclusion: Be curious. Learn as much as you can, all the time.
Coding Principles Every Engineer Should Know

Nov 10, 2017

🔗 Feature Toggles are one of the worst kinds of Technical Debt

Jim Bird writes:

Using run-time flags like this isn’t a new idea, certainly not invented at Flickr or Facebook. Using flags and conditional statements to offer different experiences to different users or to turn on code incrementally is something that many people have been practicing for a long time. And doing this in mainline code to avoid branching is in many ways a step back to the way that people built software 20+ years ago when we didn’t have reliable and easy to use code management systems.

Feature Toggles are one of the worst kinds of Technical Debt

Nov 6, 2017

🔗 12 Ways To Instill Your Kid With An Entrepreneurial Mindset

  1. Never say: “Do as I say, don’t do as I do”
  2. Create An Environment Of Play
  3. Manage What They Consume
  4. Interrupt Negative Self-Talk
  5. Actively Remind them to be Grateful
  6. Make Rigid Routine Days Mandatory
  7. Encouraging Curiosity and Asking Questions
  8. Encourage Independence From Diaper Years
  9. Never Teach Them Ugly Ideas About Money
  10. Let Them Have A J.O.B.
  11. Answer Their Questions With A Question
  12. Pour On The Hugs and Kisses
12 Ways To Instill Your Kid With An Entrepreneurial Mindset
Next → Page 1 of 7