Sep 12 2021

Elon Musk at Starbase

In the following video, Elon Musk talks about his Five Step Process for designing and manufacturing complex systems. In this video, Elon is giving a guided tour at the facilities in Starbase, Texas where SpaceX is building Starship, the largest reusable rocket ship. Elon is applying this Five Step Process to building Starship but he alludes to how they came to be from his lessons ramping up the manufacturing process at Tesla.

You can read Elon’s ideas on design and manufacturing here: Five Step Process

Sep 11 2021

Elon Musk on Design, Development, and Manufacturing

Recently, I went down a SpaceX rabbit hole where Elon Musk shared his thoughts on design, development, and manufacturing. Here are some choice insights from Elon as he talks about the SpaceX Starship, a fully re-useable rocket.

  • If a design is taking too long, the design is wrong and therefore the design needs to be modified to accelerate progress.
  • One of the most fundamental errors we’ve made to advance development is to stick to a design even when it is very complicate and to not strive to delete parts and processes.
  • Everyone is chief engineer, everyone must understand how all the systems work so that you don’t have subsystem optimization.
  • The product errors reflect the organizational errors. Whatever departments you have, that will be where your interfaces will be. Instead of questioning the constraints, one department will design to the constraints that the other department has given them without calling into question and saying those constraints are wrong.
  • You should actual take the approach that the constraints you are given are some degree wrong, the counterpoint would be that they’re perfect.
  • One of the biggest traps for smart engineers is optimizing a thing that shouldn’t exist.
  • We often try to answer the questions we are given, instead of questioning the premise of the question itself.
  • We can produce boosters and ships way easier than we can make the launch site.
  • It’s 10 to 100 times more effort to design the manufacturing system than the engine (a first of its kind).
  • The amount that goes into the design rounds into zero, relative to the amount of effort that goes into the manufacturing system.
  • All designs are wrong, it’s just a matter of how wrong. Everyone is wrong, no matter who you are, everyone is wrong some of the time.

In large part from his experience at Telsa, Elon is now using this Five Step Process at SpaceX.

Five Step Process

  • Make your requirements less dumb, your requirements are definitely dumb. It doesn’t matter who gave them to you. It’s particularly dangerous if a smart person gave you the requirements because you might not question them enough.
  • Try very hard to delete a part or process. If you are not occasionally adding things back in, you are not deleting enough.
  • Simplify or optimize. The reason this is the third step is that it is very common for a smart engineer to optimize a thing that should not exist.
  • Accelerate cycle time, you are moving too slowly but don’t go faster than until you’ve work on the other things first. If you are digging your grave don’t dig faster, stop digging your grave.
  • The final step is automate.

About the above process, Elon states the following.

  • I’ve personally made the mistake of going backwards on all five steps, multiple times.

Nov 23 2019

Apple’s Pricing Genius

Laptops are designed to travel with. We taken home, to the coffee shop, to the library, when we travel, everywhere. It is not uncommon to misplace your power adapter when travel, or equally as bad forget it at home after you left for a trip. And of course, the cable used by the power adapter does wear and tear and would need to be replaced.
I must have been about 3 years when I last needed to replace the power adapter to a MacBook Pro. I remember the sticker shock when I picked up a replacement power adapter and found it cost $69, but I needed it so I paid the Apple tax and bought it.
Recently I had left behind at the office the power adapter for current MacBook Pro, 2016 model. I haven’t been in the office since and I needed charge my laptop. Luckily, so I thought, I have an Apple Store two blocks away from home. This time around, the full cost of a power adapter was $79, but Thunderbolt cable or batteries not included, I needed to shell out an additional $39 for a 0.8M USB-C cable.

Apple Store Receipt for MBP Power Adapter
Apple Store Receipt for MBP Power Adapter

This is truly Apple’s genius. To take a technology, like electricity, that was invented over a hundred years ago. A commodity technology that is found in products priced at $10 and below, like power cords. Change the connectors in such a way that others can’t legally copy your design. Break a product down to their essential components, the actual power adapter from the cable. Charge as much as possible for each component that is sold as a product.

Oct 18 2011

Common Causes for Memory Leaks

You’ll always have to deal with memory issues, no matter the programming language. Even with the Java programming language, if the right precautions are not taken, you will have some sort of memory leaks, memory issue, out of memory exception, or heap size problem. I’ve seen two common types of memory issues in every application I’ve worked on.

A common source of memory leaks is global static singleton god object that collects or manages a lot of data, maybe a system cache, object lookup table, service locator, etc. This type of singleton pattern will require other objects to register with it, add themselves to the global pool of objects, but if they are not properly removed, unregistered, when they are no longer needed you will see your memory usage increase over time. I’ve seen this issue when using the callback or listener pattern and the listener object itself holds a lot of other data. This sort of problem is usually relatively easy to identify with a profiler, it will usually be one of the largest objects in your system.

The other, more difficult memory leak to identify, is when you have hundreds of thousands of objects each taking up a reasonable amount of memory. In this case, a single object instance will not take a lot of memory but collectedly the hundreds of thousands of objects can eat up a lot of memory. Here are a few things you can think about when dealing with a small class that spawns thousand of objects…

If you have int types, see if you can change them to short or byte types. Try subclassing if you have any number of properties that most often than not set or are null. Think about lazy loading arrays, lists, and other objects references. If there are many object instances of this class, and any portion of these instances are logically equivalent, think of using the flyweight pattern.

Mar 18 2011

Chipotle Online Order System

I love me a good burrito, and although Chipotle is not my favorite burrito joint, they do have an online order system that makes ordering lunch for a team of hungry, and picky, developers simple. But while scheduling a pick up order for the entire team I felt more like a tester than a customer.

Right on the first page after login in, I encountered infinite navigation loops. At page where I was to order, there is a big red button that read “ORDER NOW.” If you click this button, it reloads the current page you are already on. After trying that trick for a few times I realized I had to select one of the four order methods: online, app, fax, or burritos by the box.

Order Now

Order Now

I then had ‘issues’ adding invitees to my order. Adding invitees is a three step process. You have to add a list of email addresses in the text area, click ‘Add To Invitees’, this then does some AJAX magic and creates a set of check boxes for each invitee and you have to select all before they are actually invited. I can honestly say that I had to this this step a few times to get it right. If done right, each invitee receives an email with a link to order their own meal.

Add Invitees

Add Invitees

One large problem that a few folks had was that they didn’t order what they actually wanted. Unbeknownst to several team members, Chipotle wants users to be explicit about each ingredient in a burrito. A lot of team members just clicked on Chicken and didn’t realize that Chipotle would just give you a piece of tortilla with some chicken. The burrito looked like it had some stunted growth issue, but worst was the faces of the folks that ordered such a mini-burrito. One problem here is that the UI for ordering what goes inside the burrito is cluttered and goes against conventions of ordering a burrito in most taquerias. This mistake happened to three developers, so I can deduce that it is a common error when ordering online from the Chipotle.

Burrito Builder

Burrito Builder

One final issue I encountered was with the pick up of the online order. I didn’t realize or received a message from Chipotle that I had to log into the system after everyone had made their order and check out. When the time came, I just showed up at my local Chipotle to pick up the food but to my surprised they had not received it because I forgot to check out. Of course, I logged onto their website from my phone there was no way for me to see the recent history or pending order. Lucky for me, I was able to reach an hungry developer in the office and asked him to log into their website from my computer and he was able to finalize the order.

In the end, a few folks didn’t get what they expected, the food was late, and I learned a valuable lesson. Next time I’ll just fax the order in.

Aug 19 2008

Database Best Practices

Every production application I have been involved with has made use of a database. As a programmer, you don’t have to be a DBA, but just as with software development you need to adhere to a core set of database best practices. Below are a few of the best practices I try to follow.

  • Use a database modeling tool that is vendor neutral.
  • Decide upon a database naming convention, standardize it across your organization and be consistent in following through with it. Always be consistent with the use of case and plural vs singular.
  • Have a similar naming between your table columns and object properties.
  • Try not to use system tables directly as they are not SQL standard and may change between releases.
  • Do not use SELECT * in your queries, explicitly write the required columns names in the select statement.
  • Always use a column list in your insert statements. This helps in avoiding problems when the table structure changes, like adding or removing columns.
  • Try to avoid wildcard characters at the beginning of the word while searching using the LIKE keyword.
  • Use the more readable ANSI standard join clause instead of he told style join.
  • If you have a choice, do not store binary files in the database. Instead store the path to the binary file in the database and store the file in the disk, preferably another disk drive.
  • Offload tasks like string manipulations, concatenations, row numbering, case conversions, type conversions, etc to the front-end application.
  • Store computed string manipulations, concatenation, case conversion, type conversions, etc in the database so you don’t have to waste CPU cycles recalculating.
  • Avoid leaking your database design details, such as primary keys.
  • Just like your code, be sure to comment your database design.
  • Use the bulk/multi insert statement.
  • Study the SQL execution plan prior to a major release.

Again, as a software developer you don’t have to be a database tuning expert but you also can’t be excused for not following the above best practices.

Technorati Tags: , , , ,