Category Archives: Computer Programming

The true power of programming languages is in their libraries

A few snippets taken from this insider’s view of what it is to be a coder in the industry.

“The true measure of a language isn’t how it uses semicolons; it’s the standard library of each language. A language is software for making software. The standard library is a set of pre-made software that you can reuse and reapply.  Take Python, which is “batteries included,” meaning that it comes with tons of preexisting code, organized into “modules,” that you can reuse. Its standard library has functions that let you copy Web pages or replace words in a document.  I am made of code, and I have a standard library of functions of my own. Sliders and buttons and timers can get wired up to anything on the page, because the page and every object on it is code, too.”

“What does that mean, to process text? Well, you might have a string of text (The Quick Brown Fox) and save it in a variable called my_string. So now you can call standard methods on that string. You can say my_string.lower(), and it will make all the words lowercase, producing “the quick brown fox.”  Truly understanding a language’s standard library is one of the ways one becomes proficient in that language. Typically you just visit Web pages or read a book.  But the standard library is only the beginning. For many languages—and Python is exemplary—there’s an enormous library of prewritten modules available for nearly instantaneous download, using “package manager” software. A module (or library, or package) is code that is intended to extend a language’s capabilities.”

“A coder needs to be able to quickly examine and identify which giant, complex library is the one that’s the most recently and actively updated and the best match for his or her current needs. A coder needs to be a good listener.”

Paul Ford (2015) What is code? Bloomberg.

 

A bee needs 6 grams of honey

A bee needs to eat 6 grams of honey to make 1 gram of wax or beeswax. This is the assertion made in the description of the production of beeswax at the Design Museum.

The production of beeswax and its use in efficient hexagons inspired Torsten Sherwood to choose honeycomb as their top design structure.

Personally, I find the evolutionary explanation of honeycomb to be all the more 
wondrous and inspiring. In a world limited in resources, bees that use wax most 
efficiently are more likely to survive, and given enough time this would naturally 
produce a race of bees building the optimized hexagonal design. This insight 
reveals honeycomb true designer, not God or even the bee, but the process, design 
methodology even, of Darwinian evolution.
Honeycomb of beeswax

A honeycomb made of beeswas forming a hexagonal tessellating structure.

An interesting concept of design: a blind designer, a design process is his top designer.

I wondered if this could be modeled using algorithms.

1. How many grams can each worker bee collect to feed the colony? What is the optimal ratio of collectors to hive workers?

1. Only bees sufficiently well fed could exude beeswax?  How much beeswax do you need to make a honeycomb to breed new workers and store excess honey? How do they choose between larvae or honey?

3. If we got hives to use alternative structures, which would be able to produce the most surplus and thus survive or grow bigger.

I thought it would be a nice test of efficiency in shapes within algorithms describing a similar process, but with one aspect different, the shape of the honeycomb.