Tuesday, October 22, 2013

Functions

I gravitate toward functions that are discrete. I.E. they only read or write information as defined in their prototype. But all day long at work I find functions that read and write global variables, UI items, and the database. We are good about labeling all functions with a short prefix. (IMNSHO, all shops should have a convention of giving names prefixes according to the type of things they name: strSomeString, intSomeInt, CSomeClass.file, objInstanceOfSomeClass, fncSomeFunc, subSomeVoidFunc.) But I think it would be cool if we also had an indication by looking if a function is an ideal function or something more promiscuous.

An ideal function's only interaction with the outside world is via its arguments and its return value. Other functions might choose to interact in their function bodies with global variables, user interface elements, or the database. In my personal prefix convention I'm going to add an indication of that.

prefixDescription
subA void function, possibly with parameters, but with no other outside interaction. A waste of computer time. The inside of a black hole's event horizon. The only legit use of this I can think of would be subWaitThisManySeconds(int) or something--even that might technically be considered reading the clock, which is link to the universe, i.e. a sensor. So that would really be subuWaitThisManySeconds(int) as defined below.
fncAn ideal function, with a return value, and parameter(s).
sub[d|m|u]A void function, possibly with parameters, that reads and/or writes values to/from the database, module level (global) variables, and/or user interface or sensor resources.
fnc[d|m|u]A function with a defined return value, possibly with parameters, that reads and/or writes values to/from the database, module level (global) variables, and/or user interface or sensor resources (mnemonic for sensors could be that they interact with outside universe).

Wednesday, April 11, 2012

GOP Governor Acknowledges Climate Change




Well, it looks like it took the warmest American March on record to make it happen, but Ohio Governor Kasich admits there might be some reality in what's been continuously proclaimed by science for 30 years now.

Hopefully the governor's policies will change to care more about the people and their children and grandchildren instead of harming them by protecting the golden fossil fuel calf and postponing its inevitable and imperative decimation, while stonewalling change to better technology, our easiest path to economic growth.

Tuesday, April 10, 2012

Bob Lutz on Colbert


Bob Lutz, Father of the Chevy Volt, Correcter of the Fox News, and apparently a descendant of the long-lived race of Numenoreans, reps more push-ups than Stephen on last night's Colbert Report.

Friday, April 6, 2012

I Can't Argue

Guardian: Nasa scientist: climate change is a moral issue on a par with slavery

I can't argue with this. We can't pretend we don't know what we're doing. We can't pretend we don't know some simple, honest, direct solutions.

NO. NEW. COAL PLANTS. EVER.

EPA has put in a rule that new power plants must produce more than 1MWh per 1000lbs of CO2 dumped. Coal produces around 1800lbs/MWh.
I never thought about my own drop-in-the-bucket contribution in terms of carbon or CO2 released, because I'd only heard it when discussing smaller units. For instance, burning a gallon of gas releases 5 pounds of carbon (19lb CO2), and a KWh from burning coal produces half a pound of carbon (1.8lb CO2).

But it's shocking to consider my usage from an individual household over more than a moment in time. Consider the numbers taken over a month. Just for me, with a compact car and a smallish house in a temperate month, I released 125lbs of carbon from 25 gallons of gas and 225lbs of carbon from 450kWh of coal electricity.

This month, I've taken 350lbs of carbon that God trapped discretely in the earth aeons ago. Perhaps it was captured at a time when the Sun was cooler, and the earth was hotter, and the seas were higher, and there were no large mammals, and no ecological niche for large mammals to thrive in. Then, I randomly dispersed it into the atmosphere so that it will take some more aeons to be re-captured and re-buried.

And that's for one light month! For the year, multiply by 12 and add more for the hot months and road trips. And I keep doing this year after year!!!

Next house upgrade: solar (10 year payback, then 10% return every year). Next car: Mitsubishi i EV ($22k) or Prius ($15k-$22k used).

Thursday, April 5, 2012

When are subsidies wrong? Are they ever OK?


350's Bill McKibben LA Times Op-Ed: Fossil-fuel subsidies: Helping the richest get richer

"There's just no reason to hand the richest industry on Earth a bonus to help them wreck the planet."