Sunday, October 14, 2012

Reflective and Imperative Programming - Yet Another


Hank

Okay, I've been learning html. By that I mean learning enough so I could actually use it. 
This lead me to learn about CSS.
So this morning I got up and decided to look up what PHP, Ruby, and Ruby on Rails is,was,are?
All stuff I've brushed up against in the last few years but haven't been interested to learn "yet another" F.I.B. (Fill In the Blank ... get it? Pretty clever, huh? Don't answer that.)

When I got to the explanation of Ruby I fell down the rabbit hole of WTF are they saying? Kind of like when I read Scailia's majority opinion on the DC gun law case where he explained his opinion in terms of what it was not in relation to the minority opinion. The minority opinion was a wonderful piece of straight up beautiful English prose and explained the 2nd amendment issue.

The Ruby explanation says that it is imperative programming (WTF is that?) It's programming that is not procedural (that's like a soccer mom yelling don't bunch up around the ball). 

Wait let me quote from wikipedia:
"Ruby is a dynamicreflective, general-purpose object-oriented programming language that combines syntax inspired by Perl with Smalltalk-like features."
 and
Ruby supports multiple programming paradigms, including functionalobject oriented,imperative and reflective.

So what's imperative programming?
I quote
"In computer scienceimperative programming is a programming paradigm that describes computation in terms of statements that change a program state. In much the same way thatimperative mood in natural languages expresses commands to take action, imperative programs define sequences of commands for the computer to perform.
The term is used in opposition to declarative programming, which expresses what the program should accomplish without prescribing how to do it in terms of sequences of actions to be taken. Functional and logic programming are examples of a more declarative approach.

Procedural programming is imperative programming in which the program is built from one or more procedures (also known as subroutines or functions). The terms are often used as synonyms, but the use of procedures has a dramatic effect on how imperative programs appear and how they are constructed.


Declarative programming is a non-imperative style of programming in which programs describe the desired results of the program, 

Many imperative programming languages (such as FortranBASIC and C) are abstractions ofassembly language.
[edit]
The hardware implementation of almost all computers is imperative;[note 1] nearly all computer hardware is designed to execute machine code, which is native to the computer, written in the imperative style. 
Okay, got it.

Now let's look at reflective programming
In computer sciencereflection is the ability of a computer program to examine (see type introspection) and modify the structure and behavior (specifically the values, meta-data, properties and functions) of an object at runtime.[1]
The earliest computers were programmed in their native assembly language, which is inherently reflective as it is programmed by defining the instructions as data.

So it sounds like imperative and reflective are the same thing except reflective allows self-modifying code.

Geez, this reminds me of my sophomore year and there were these two guys who were coming up with any excuse they could to get on a machine: Algol, cobol, Snobol - whatever.
This would have been 1970. There were no PCs. My college had a computer center where you could take decks of Fortran cards to and get a run, maybe two, in a day.
The comp sci dept had some kind of mini that we could do Basic on (twice a week for half an hour each time). 
There was essentially two compiled programming languages: Fortran and Cobol.
And there was Basic.
Then there was all this weird stuff that no one really used.

When I read the imperative reflective stuff I start getting a headache. It sounds like all things to all people. 

Were you around XYZ Corp when they were pushing The Substrate?
I think that's what it was called.
There seemed to be two camps in XYZ's programming section. One was the Next/Apple group that was pushing the substrate - the idea that you could put some kind of diagram or functional objective outline of what you wanted into this software called the Substrate and application code would fall out the bottom. These folks actually believed someone would use something that they didn't understand!

No one understood it but you were supposed to Believe!

I just wonder if any of this stuff can do Hello World
Forget the new line.

Gotta go,

B

Tuesday, October 02, 2012

The Ryan Medicare voucher thing is very personal to me




     This whole Ryan Medicare voucher thing is very personal to me. 
     My dad went to college during the Great Depression. He worked his way through grad school by working at an observatory. I didn’t realize until earlier this year that at that time it housed the largest telescope in the world. One of the things he did there was to layout a system for mapping the stars and galaxies. It’s the system everyone uses today. He would have gotten a doctorate for it had he written it up, but I’ve learned my dad was not a good writer. 
     He went to work for a large firm and he and a friend designed all the cameras that firm used for years. He was lured away from there to a small start up, this in the late 1930’s. He was the seventh employee. His first job was working on a camera that was to be used to film what the Norden bombsight was dropping bombs on. I didn’t realize how special that was until I read about it in Laura Hillenbrand’s book Unbroken. Once the bomber set the bombsight on a target the bombsight took over flying the plane until the bomb was dropped. Whether the camera was in the Enola Gay when it dropped the atomic bombs on Japan my dad never knew. He never spoke about it because it was top secret. What I knew I learned from my mom.
       After that he worked on all kinds of cameras and telescopes. His firm designed the optics, the stuff that made the cameras really work. They always worked as a sub-contractor so their name rarely if ever appears in manifests of the equipment. The pictures of the Cuban missiles, the U2 pictures, all the pictures from space, the Hubble, they are all the optical systems that my dad and the company he was with designed and built. 
      My dad’s idea of recreation was to work on various unsolved mathematical problems. While I was growing up he worked on Fermat’s Last Theorem. We never talked about sports. He wasn’t interested. His idea of a great Sunday afternoon was to sit in the living room alone with a spiral note pad and a #2 pencil and scratch out equations. He was so honest that he wouldn’t even take a pencil from work to use. I remember him skipping into the dining room one day; he never skipped. He had solved Fermat’s Last Theorem
     Before he sent it off to one of his buddies to review, a guy named Chandra, he gave it a last look. There was a problem. I only realized a few years ago that Chandra was Chandra Sekhar, the man who won the Nobel prize for theorizing that there were black holes.
     My dad had the ability to concentrate and lock out distractions. There were funny stories about how he drove and missed a turn. He missed the turn off the Garden State Parkway for The New Jersey Turnpike and didn’t realize it until he got to Cape May. He drove around the Washington Beltway twice before he found the turn to route 95 north.
      He was suffering from some form of dementia and we all missed the signs for years. My parents moved from their retirement home to a senior living center, from the independent living space to a condo, and finally my dad was put in a senior assisted living center. A place that he specifically asked not to be placed. I visited numerous other facilities, much nicer, much better care; but my mother went with her doctor’s suggestion because it was the only place the doctor had visiting rights. 
      One of the last times I saw my dad he had taken off all his clothes except his boxer shorts and he was pawing the side of the mattress. I always remember that sight when I think of Dad and all the great things he accomplished in his life.
      I think of Paul Ryan strolling in and handing my dad an envelope with a piece of paper in it and saying, “Here’s some money for your health care. You’re free to negotiate with whomever you like. Good luck.” And strolling out whistling to himself.

Monday, October 01, 2012

Ask a demented old man to negotiate his health care - really?


Ask a demented old man to negotiate his health care - really?

Dear Hank;

     History has a funny way of repeating itself. I remember as a kid reading about Ulysses S. Grant as a president. He had about the most corrupt government we’ve ever seen. The term lobbyist was coined when he was in office. (He used to go across the street to read the paper in the lobby of the hotel there. People would hang out there to make their entreaties and were termed lobbyists. His term was in the 1880 and I always thought that about that time we’d see our government get more corrupt in the 1980s. 
     I figured it would last much the way it did then for about 40 or 50 years with some stops along the way to try and right the ship of state. I’d say we are about half way through this time of corruption and self serving. One man, be it Teddy Roosevelt or Barack Obama, can’t stop it. They can slow it down, break up bits, and try to lay the seeds for a better future but not unless and until there is a huge ground swell of support can the evil practices really be stopped.
     I was pleased to read that in Benghazi, where our ambassador to Libya was killed, the local people had had enough of the militia behind the attack and overran their compound and drove them out of the city. Perhaps, similar actions here will be needed. 
     Before that can happen I think we need to take a page out of Samuel L. Jackson’s video and “Wake the Fuck Up!” 
     Let’s start with a simple question. Do you want to hand your father or grandfather a check from the government and say to them, “Hey, go negotiate your own health care, hope this is enough.” That’s Paul Ryan’s suggestion. 
     I can’t figure out if Ryan is wet behind those big ears or just plain stupid between them. Medicare was put in place because the insurance companies would not insure people in that age group except at very very high rates if at all. The cost to seniors has ben calculated to be in the neighborhood of $12,500. That does not take into account that many seniors are not all there and would not be able to negotiate much of anything. I see this as a massive scheme to defraud our seniors of any sense of dignity while being ripped off by the kind of companies that Rick Scott created. Remember Mr. Fifth amendment 75 times in his Medicare Fraud Case of $1.7 billion?
     So what chance does a demented old person with a voucher have against a shark like Rick Scott?
     If you think that’s a fair deal then vote for Paul Ryan and what his name, the empty suit.

Bryce