10/30/2013 § Leave a Comment
I can’t think of a bigger reason to ditch a tool than because it doesn’t do what you want it to do, or because the user can’t get it to do what he needs it to do. I have no use for nonsense like that. But worse, I have no use for a tool that is pretentious. And that’s how I feel about RoR.
I mean, that the hell is this crap?? EVERYONE is doing RoR, everyone is adding “gems” (or ruby libraries) to its related repositories, every Tom, Dick, and Harvey is writing Tech Articles about the wonders of RoR. Its the new wonder widget for the Web, as far as I can see from the volume of articles on the web regarding it. But I didn’t find it so, and I’ll tell you why.
RoR is pretentious, and presents itself like the second coming. You can see this from the sheer volume and tone of the tech articles written about it. Its not difficult to find example code and how-tos using ruby to accomplish many different things on the web. Its a web language, there’s no doubt about it. But everyone using it seems to me to have a tone of “Well, to do that you just blah blah blah…”, and indeed, there does some to be a “thing” for every “thing” you need done on the web. But the actual application of the solution…
Ruby, in my opinion, is horribly fragmented. You can’t say it any plainer than that. Just following a simple step-by-step for newbs yielded different results for me on different machines, and I could have sworn I installed Ruby the same way on both machines, both the same linux distribution even. Logically speaking, repeating the same actions should yield the same results on the same versions of the platform. But in my case it didn’t. Clearly there were slight differences in *something* regarding the platform (Linux Mint 15 “Olivia”), but any differences in the tool chain or the clib or anything else I couldn’t say, and I shouldn’t have to. Yet on my successful platform I had a simple example web site working, and on the other I had stack traces after issuing “rails server”, or at least what looks like stack traces, I don’t know what they are called in RoR.
“Ok, never mind that.” I said, and proceeded to ask of Ruby a very essential, yet non-trivial, web problem.
Many websites need to be a portal, or a gateway, that protects it’s resources from as-hoc use, that is to say, it needs to recognize it’s registered users. Resource protection is not a trivial problem; how do you keep random Web surfers out of things you don’t want them messing with when the http protocol is stateless? You can access a page on the web by simply typing it’s URL into the browser, and the browser does it’s best to present the page (or resource) you’ve requested. Something else has to keep it from the browser’s request. That “something” is the heart of any web portal, and needs to be designed carefully. It’s inherent complexity makes it a common attack vector for hackers and exploiters.
The point is, that “thing” is very important, and not something you write off-the-cuff. So I proceeded to look for something that had already been written. I didn’t think this a would be a chore with all the add-ons and cruft that’s already been written for Ruby, this should have been a snap, right? And boom, a google search yielded a butt-load of urls with ready to go portal gems, gems that would use mySQL or PostgreSQL authentication, gems that used openID (yay!), and other stuff (radius, for example.) So with a song in my heart I downloaded one that seemed reasonable. *Boom*. Stack trace. Something about the version of ruby, or something in ruby. Or rails. Or a gem. I dunno. So I located another one, and deployed it. *Boom*, stack trace. I repeated this act several times until I finally landed on something that didn’t result in a stack trace. Since there were no instructions to speak of I navigated to the root of the system. I got the default red-trimmed rails server page. Great. After an hour of screwing around with how-tos I got to a point where I wanted to encrypt the user password input. “Just add the bcrypt gem and ta da da da day daaaa.” *Boom*, some kind of version issue with the bcrypt gem.
At that point I gave up. At least for now. Obviously this stuff works, I just don’t have the snuff to make it happen, but this absurd fragmentation in Ruby is for the birds. And I know that’s the problem, I can see from the stack traces. Every problem that comes up is due to something not liking the version of something else. Its plain from the errors. For all the issues I have with PHP at least I was able to get a basic web portal up and running in no time.
10/23/2013 § 2 Comments
The principals behind banks are something everyone can understand. They hold your money for you, and pay for the privilege, current interest rates not withstanding. The banks that service checking accounts for most people are retail banks, and they are strictly regulated and heavily insured, an important by-product of the disaster of the Great Depression. But how many really understand the Credit Default Swap scandal of the last 7 or so years?
Other less regulated banks are investment banks, these banks are a bit freer to take bigger risks with the potential for more profit. When retail banks start doing things like take those same risks things like the Great Depression happen, which is why the Glass–Steagall act was born. This legislation strictly separates the activities of investment banking from retail banking; when an investment bank sinks it hurts investors that had the money to blow anyway. When a retail bank goes down, it takes people like you and me with it.
Interestingly, starting from the ’60′s on legislators started chipping away at Glass-Steagall, culminating in the Gramm-Leach-Bliley act of 1999, also known as the “Financial Services Modernization Act of 1999″, intended to address the cloudy “realities of modern finance”, and the most sweeping blow to the protection of Glass-Steagall to that time. Banks starting dabbing their collective kerchiefs into the risks and rewards of investment banking with plain account holders money. All three congressmen who introduced the bill were republicans by the way.
Because of the rendering of the Glass-Steagall act into a gutless cube of butter something interesting in the real estate market started happening; because banks were able to dabble in investment banking they were able to create “investment packages” that they could sell off to other institutions, and some of those packages started including real estate loans. There is no downside to this for the banks at all as the loans go completely out of their hands. Buyers of these “investment” vehicles don’t have a real issue with them; if the bundle contains a few bad loans, so what? Besides, these “bundles”, or Mortgage-Backed Securities could be re-sold, usually for a huge profit, and re-sold, and so on. As the immediate downside for the banks was none and the profits were many, there was little problem (as far as they saw it) to shoveling mortgages out the door by the truckloads masked in these so-called “Securities.” But to make mortgage-backed securities, you need real estate loans. Queue the Subprime mortgage crisis of 2007-08. “Give the people loans”, said representative Barney Frank of Massachusetts, so the banks complied by giving anyone a real estate loan, and covering their asses by selling off the loans in these securities.
Its difficult to believe the officers, CEOs, CFOs, and other higher-ranking officials of the institutions didn’t know exactly what was going on. But the pure profits were too difficult to ignore, obviously. By the way, not one of these men and women have been indicted or made to feel any effects for causing the biggest financial disaster since the Great Depression. Not one that I’m aware of by the way.
But the biggest insult came when Obama decided the thing to do was send truckloads of money to the very banks that initiated the crisis. Billions in bailout tax money, your money, was handed over to the banks that were most exposed to the credit default swap scandal, as its come to be known, with the understanding that these banks would start making loans again. But they didn’t, they sat on the money. Its your scandal, you paid for it, you enjoy it.
07/14/2013 § Leave a Comment
An example is worth a thousand words, that’s always been my motto, so when I needed to do some DBus digging I was stymied by the usual lack of examples. There is documentation, but like so much of it in the OSS world its pretty dry, obtuse, and difficult to follow. I looked at several examples around the web and most of them were non-working regurgitations of the examples in the sdk written for Qt. And of course the typical badly-written, broken english nonsense that pervades the web. The example I linked to just now is perported to have been written just 8 months ago! Also, what the hell is going on with Qt!?!?!?! I just installed Mint Linux in a new MacBook Pro Retina as described in my last article and one of the things I do is install my favorite IDEs; usually Qt Creator and Anjuta, but man, what the hell is going on? Anjuta works as it always did but there are these huge black spaces in the IDE as though some graphical component is missing, and moving from Qt 4 to 5 have been very painful. The cardinal rule in the development of user tools should be that certain files are sacrosanct and not to be messed with, or at least backwards-compatible. The Qt project file (*.pro) is one of these files. I spent hours last night and could not for the life of me get an older project up to v. 5 standards. I’m going to try to re-create the project from scratch and import the source files when I can but I shouldn’t have to do that.
So I took the echo example out of the DBus-c++ sdk and sort-of modified it for my own needs (all that means is I re-named some files and created my own Makefile.) Since I installed the sdk with Synaptic and I have no idea what I’m supposed to do with them since they are part of an automake package and I only want the one example I decided to extract them to my home directory, analyze their needs, and like Maslow or Freud, prescibe them long hours of therapy. The result is this archive that compiles on my Mint 15 (3.9 kernel) system and works, with a plain Makefile.
I’m really interested in exploring the DBus systems and probing its capabilities. Now that I have an example that I know works, at least in my context, I can do just that.
07/09/2013 § Leave a Comment
I’m so ashamed. I swore off Apple products for ever and here I am again with a new McBook Pro Retina 13″.
I love my Acer S3, but it has problems. Its got 4 Gigs ram, total. The keyboard is prone to spurious typing anomalies (broken words, typing errors, lots of them). The resolution is really low, even for an ultrabook in 2013. The battery lasts 2 hours on a full charge, 2 1/2 if you really pack it. In 2013 those stats are rediculous. Plus I’ve had a banner year so far so I had some spare bux burning a hole in my pocket.
First I went to the nearby Fry’s Electronics and took a look. What I look for in an ultrabook is light-weight and power. I look for the lighest book with the most Ghz I can get. Then I look for RAM, expandability would be nice but that’s REALLY hard to find in an ultra. So, given that the RAM will be static in size I try for the most I can get. That’s also hard. It was impossible to find an ultra with more than 4 Gigs two years ago, ALL the manufacterers were worried about price plus meeting the minimum specs for running Windows 7, so 4 Gigs was the most they were willing to fit the new, hot-selling ultrabook phenomenom with. Now that things are a little more relaxed its easier to find ultras with 6, and even 8 gigs. Another thing I crave is low weight. I know I ask a lot but as a consultant I travel a lot and weight is serious consideration. One thing I really don’t need is a book with a light drive (you know, a CD/DVD drive.) I needed to use one last year to install Windows XP on an old but tiny pc I wanted to use as a media server, but before and after, rarely. If you feel like you need to use plastic light media for anything you need to get aquainted with modern SD Multi Media memory devices. Ever breath on a CD and all of a sudden not be able to read it? I have) yet they were difficult to find, being larlgely relagated to the Japanese market. Lately however that hasn’t been as much of an issue and light-driveless books are easy to come by here in the states.
At the Fry’s nearest to my house I wandered about the notebook aisles until I spied a really great number that met all my criteria. It in fact looked a bit smaller than typical ultrabooks, but at 8 Gigs RAM it would have worked quite well, and I wanted it.
Is there anything worse than a retail store that won’t sell you something? I don’t think so. I found a sales droid and showed her the ultra I wanted to purchase. She spent the usual 10 minutes fumbling about doing who knows what and finally came back and told me should coudn’t sell it to me. I asked her for the display model. She said she couldn’t sell me that one either. Seeing red I left the store. I should have looked on-line for the model and probably would have gotten it cheaper but I was really pissed off. I was on a mission now.
If you’re familure with Fry’s you know its the one retail brick store that, like Mitt Romney’s “binders full of women” has aisles full of notebooks, there’s really no other place like it. The help is utterly worthless but the sheer number of models on display can’t be beat. The only other place better WAS CompUSA, may that establishment rest in peace. So my only other shot, though I was loathe to take it, was another Fry’s. So I decided to haul my butt to the next nearest one, which happens to be the Fry’s in Palo Alto. THE Fry’s. A Fry’s in San jose is certainly near the pulse of Silicon Valley, but the Fry’s in PA would be in the Valley’s heart beat. This is near Stanford University and Page Mill Road, the valley’s trail of venture capital repositories. THE Fry’s did indeed have a number of models available on display, but not the make/model of the one in San Jose that I wanted. But what it did have was a full selection of MacBook Pros with the Retina display. I took a look at the Retinas. Damn the display was pretty. They had both MacBook Airs and the “classic look” Pro models, the new ones. The smallest one caught my eye; it was just like my older MacBook Pro but considerably smaller, and with that increadible Retina display. I also knew that my keyboard issues with the Asus would be completely gone. The crisp MackBook Pro kb design is probably the best in the business. I also knew that I would have problems running the software that *I* wanted to run on it. The latest MacBooks use the new Intel boot process known as Unified Extensible Firmware Interface, or UEFI, and like anything unknown the human reaction is to fear it. Which I did, but its the replacement for BIOS, and not going away. It also complicates Linux installation. Thankfully it doesn’t prevent it, which I first feared, it simply complicates it.
In an effort to be both entertaining, relevant, AND useful let me breifly summerize the process of installing Linux on a Retina. And let me preface the process by explaining that I have absolutely NO use for MacOS, sorry mac fan boys. And I have a larger MacBook that runs Windows 7 when I need that, I also stuffed 16 Gigs of RAM in the thing so I use it for running virtual machines (usually other versions of Ubuntu, the embedded & thin client world is going nuts for Ubuntu for some reason). What I wanted was a small, light, powerful book for traveling with MORE RAM. Since most of my work is on Linux, that’s what I wanted to run.**
First thing you’ll want to do is install rEFInd, and use the “binary zip file”. Don’t get too caught up in the wordy web page that is the rEFInd home page; the author spends WAY too much time explaining the story of rEFInd in tangents. After resizing your disk execute the install.sh script as root. Then reboot with your Linux distribution ISO of choice written on a plugged-in USB dongle. There are some instructions on the net saying you need to write the ISO in a special way for MacOS, I didn’t find that to be true. You should see a new boot manager menu with an Apple logo and a generic USB symbol as button selections. This is the rEFInd boot manager. Select the USB option. Your choice of Linux should be a fairly recent so as to take advantage of the EFI boot process, if you insist on using an older distribution you’re on your own, I have no idea what BIOS-based distributions work on the EFI system of the MacBook Pro Retina. After the dry run system (if your distro has a test drive desktop, I think most do now) boots up go ahead and double click the install icon. Installation is the same as always, but be very aware of what you are doing during the disk editing part of the install; you’ll be presented with a gparted (or whatever they do with KDE based distros) dialog. Go ahead and partition the main slices however you want; BUT DO NOT DELETE THE EFI PARTITION. If you want to use the Linux as your sole OS on the Retina thats fine as long as you do not touch the ~200 Meg boot partition at sda1, or whatever device node your boot disk is (usually sda1 on Debian systems). This is the partiton that should clearly be labeled “EFI” in the gparted partition list. I wanted to use this book soley for linux, so when I got to this step I blithely deleted all partitions and created a main slice and a swap area, which normally would work fine. I installed Linux (Mint in my case) and when I re-booted: NOTHING. The machine wouldn’t load Mint.
After doing some research I learned about the newer EFI boot process, that rEFInd was needed to install a new boot loader, and that you don’t want to re-construct an EFI boot partition from scratch. After messing around with re-creating EFI boot partition structures for 3 days (They have to be a certain size, have a certain directory structure, have certain files…) I finally re-installed MacOS Mountain Goat* or whatever and re-tried my Linux installation, this time without messing with the EFI partition. It worked like a charm, my new Retina was running Mint 15.
Here’s some after install pointers, points; I had to install and open up the curses-based alsamixer app and unmute all the sound devices, simply uping the volume controls or messing with them in any way using the usual gnome controls didn’t give me my sound. I also edited /etc/modprobe.d/alsa-base.conf and added “options snd-hda-intel model=mbp101″ as the last line in that file. The HDMI port on the right side doesn’t appear to work unfortunately, and neither does a minidisplay port to HDMI adapter. I was really looking forward to having HDMI out. I don’t know if a miniport to VGA or DVI dapter will. Also this book appears to have two display adapters, one from Intel and one from nVidia; don’t install any of the many nVidia driver options available in the repositories, they don’t appear to work, while the Intel driver works great. Its kind of wierd getting a full 2560×1600 resolution on a 13″ notebook LCD. That resolution is so high that I had to step on it a bit to make everything readable. I re-compiled a mandelbrot generating X app I wrote that also prints the execution time in the shell if its launched from that and running it on the Asus took about 9 seconds; on the Retina it takes 5. I get the sense also that this thing has four full core i5 @2.5 GHz processors, not just two real and two virtual ones. I’ve also read reports of the Retina running very hot on Linux, but I’ve not noticed this.
The 13″ Retina is a very powerful ultrabook, a true “Ultra”. I love it. Its really the perfect size with the perfect power and RAM. It’ll run at least twice as long on a full battery charge as my trusty-but-slower Acer S3. I’m looking forward to doing a lot of work on it. I hope linux developers down the road get the ports working, but that’s not going to hold me back.
UPDATE: I spent the latter half of my yesterday building and installing the 3.9 kernel and some Intel support libraries and viola! The HDMI port works!!! I’m staring into the warm glow of my Vizio 26″ HDTV as I type this. Its funny, the Retina’s LCD is STILL higher rez than the Vizio, but its nice to have a “console” sized display. The MicroSD slot on the right works too! I LOVE THE RETINA!! Pricey, and locked down as far as RAM & SSD go, but I’ve come to live with that from Ultras. If you’re looking to run Linux on the 13″ Retina, follow the above directions and then grab the 3.9 kernel and install it. Also grab the intel graphics stack components here. After installing everything (yes, I went ahead and compiled everything from source, getting missing libraries from the baseline repositories when they popped up) I had control over my HDMI and SD ports.
* I have to say that Apple really saved my ass in this regard; the 13″ Retina (and I assume all the latest Pros) don’t come with much in the way of paperwork or media, almost none at all in fact. Just the usual worthless warranty “square”. There is no Mac OSX install disk, nothing. Just the MacBook and that funky, little white power supply. Scary, but in some ways refreshing for a faux minimalist such as myself. Re-installing Moutain Lion was a simple matter of hitting an option-R key combo during the boot process, using the disk utility to re-partition the drive the right way, and then selecting the Mac OS re-install option. Apparently, since I had already configured the book to use my wifi it simply retrived that configuration from *wherever* and went to town. After a warning that the re-install process would be slowed by my use of wifi (a hard ethernet connection would obviously be faster, but who cares?) it automagically just connected to an Apple server (I assume) and re-installed Mountain Lion. The whole thing was really kind of amazing from a geekly perspective and very easy.
** The Apple droids will say that MacOS is a version of Linux. No, its not. It resembles it in better then superficial ways, but its not.
06/09/2013 § Leave a Comment
I’ve been really curious about optimization options with GCC and how different options affected my code so I spent the better part of the weekend working with a simple mandelbrot projection displayer written in C. It projects the classic graphic representation of the set in an X window. Its a great test case as it uses floating point math, calculations with complex numbers, and OpenGL, so it sucks up some pretty heavy duty cpu cycles to draw the projection. The test case is here if you’re interested in benchmarking your own system similarly. Start it from a shell and after you close the display window the execution time will be displayed in seconds.
First, as a starting point I compiled the program without any options; the projection appeared on my desktop in about 15 seconds. Then I added an option I knew would make a difference, the “arch” option. The current form of the flag is “-march=”, this tells the compiler to target the specified cpu architecture. I knew I had a corei5 cpu, but to make sure of this I issued an “lscpu” in a shell and got this:
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
On-line CPU(s) list: 0-3
Thread(s) per core: 2
Core(s) per socket: 2
NUMA node(s): 1
Vendor ID: GenuineIntel
CPU family: 6
CPU MHz: 800.000
L1d cache: 32K
L1i cache: 32K
L2 cache: 256K
L3 cache: 3072K
NUMA node0 CPU(s): 0-3
Ok, good to know, but not what I was looking for- this is all stuff I know. Fortunately in my bag of tricks I have this:
gcc -c -Q -march=native --help=target | grep march. On my machine the grep returns this:
Thoughtful of gcc to provide exactly what I need to pass to it. So, plugging in my compile command:
gcc -Wall -lGL -lglut -lGLU -march=corei7-avx mand.c -o mand I got the execution time down to 13 seconds. Better, but… can we do better? Absolutely. We haven’t even told the compiler to optimize the code in its own way yet. The “-O” flag is the flag I’m talking about. According to the docs this flag takes a numeric parameter and a few alpha ones. The numeric params tell the compiler what “level” to optimize to, with the levels being 0 through 3, with 3 being the most.
So plugging “-O3″ into my command line I see the execution speed up to a little over 9 seconds. Pretty good. But is that the best? I see an alphabetic option to “-O”, “fast”, for fast math. That looks promising. Plugging it in I get an execution time of 10+ seconds. What? Not even helpful. Ok, I see one option left; “-Os”, or “optimize for size.” Ok, let’s check it out. I plug it in and notice a full 1 second performance boost over the command that only employed the arch option. Wow, quite a difference. It seems the less code this particular application uses means less for the compiler to do, and hence less execution time. Makes sense, but I really didn’t think it would make that much a difference. Wrong!
Ok, I have one last collection of options I’d like to try; everything. Or at least everything suggested by a gcc grep I found the other day:
echo "" | gcc -march=native -v -E - 2>&1 | grep cc1. This appears to actually be all the options supported by the compiler on the current platform, I really don’t think its a suggestion of what I should be using as appeared to be worded by the blogger who wrote it. And I’m right, using the string returned by this grep in my compile invocation the program runs as slowly as it did without any optimizations.
I played with many more options and variations on options than I have written about here, including the “mtune” option, which should be the same as whatever you’re passing to “march”, and it made no difference. Another option that didn’t seem to make a diffrence surprisingly was “-funroll-loops”, suprisingly to me becuase there are a number of loops in the program, especially in the init phase. Ultimately you need to use timing in your code and common sense in your brain to get the most out of gcc, like anything else.
Yeah, that’s right.
06/08/2013 § Leave a Comment
I liked Russell Brand, I liked is humor and his comedic timing is impeccable. He was also married to one of the hottest pop divas to come along since Patsy Cline (what the hell happened to that situation Russell?) But like so many pop icons before him he had to open his mouth and completely destroy his very marketable image.
No, we shouldn’t blame a group of people even though they continually kill our own. Wait- let’s analyze that statement: Using a simple anology; If Sally slugs you everytime you offer to give her a kiss, you need to stop offering Sally a kiss, yes? Ok. What if Sally slugs you everytime she walks by your house, though- you have a problem. Ok, say, Sally slugs you several times while your waiting around for the bus, and everytime she does Billy, your brother, says she did it becuase Spike, your friend, went over to HER house to steal her bike? You may or may not have sent Spike over there to do that. In fact, your parents may have, and they may have been wrong. Never the less, Sally swears to kill you for past wrongs YOU’VE done to her. You, however, have done nothing more than go to school every day. Spike, when confronted regarding past aggression against Sally says he did it for you. You’ve not asked for his support in anyway. Further, Spike delivers your family’s news paper, and your family pays him accordingly. Sally now uses that fact against you. In fact, Sally engages in a covert campaign to discredit you in every way possible to all your friends, teachers, and people your parents do business with.
Then, one dark day, Sally gets hold of a gun and shoots your mother dead, then goes into hiding. And occasionally, from time to time, people from Sally’s family do things to you, poison your dog, flatten your tires, generally fuck with you. Then Russell Brand says “Don’t blame Sally’s family.”
Really, Russell? You have nothing better to do than get on the media and say something controversial? That is entirely possible. Its easy for some one whose been in the media eye before but currently sort of on the “back warmer” to do just such a thing to get back in the public eye. Was Despical Me II the last thing on your plate last month?
Just like Viet Nam before it, America’s position in the middle east is like a ham-fisted puddin’ head stumbling about in a quagmire without end surrounded by quick-footed little stinging wasps with a mastery of PR. Its as if Hanoi’s PR playbook was given to Al Queda and they are following it verbatim. What if, and I’m just musing here; but WHAT IF the cultural bias toward Islam in the popular western media was orchestrated by them? As already mentioned, its not like its never been accomplished before. What if popular idiots like Brand are compliciate and willing tools to Al Queda’s program?
Religion is a powerful tool for human conditioning. Islam is also a dynamic religion; it asks its adherents to strongly commit to its precepts and moires. Christianty certainly has done as much as well, but Islam is a newer religion, and its militant philosophy with regard to the Shia/Sunni split is much more apprent than the orthadox schism of Christianity in 1054 A.D. Just like Jesus Muhammad is attributed to many miracles and wonders. Of course proof of these accounts is only found in the Quran, just as Jesus’ miracles are really only recorded in the Bible, once again, as many times before and in the future, making religious claims both proofless and irrefutable. Christianity is certainly not without its attrocities, to be sure. But its been a while since the last crusade. Who will now paint Islam in the light in which it deserves lately? Certainly not Russell Brand.
Brand is an Islamic appologist becuase our culture demands it, not due to any objective or critical look at the current state of Islam or Western Pop Culture. The former becuase its in vogue, and the latter bcuase it pays his bills. What if both were WRONG? Would make Brand and his ilk look pretty damn foolish, wouldn’t it? To be imperically correct (and that means absolutely correct, not correct as far as we’re concerned) we need to apply the same standard to all measures. Has Brand or his buddies every been apologists for Christianity? Or Hinduism? or Buddhism? Not as far as I know.
05/16/2013 § Leave a Comment
The above picture represents my opinion of PHP, everyone can use it, everyone can fuck up a project with. During the mid-2000′s I was picking up PHP gigs left and right and working ‘em as fast as could, becuase everytime I picked up a new gig I learned a new aspect of the language I really didn’t like, but I just bit my lip and moved on with the task at hand.
I am now seeing some new-ish discussion regarding Jeff Atwood’s post last year The PHP Singularity, or not, I don’t know how I landed on his post, it just seems to me that the old PHP Sucks debate seems to be gaining a little steam again.
The refutations seem to fall into a few camps; 1) PHP is used by so many people now it doesn’t matter (Jeff’s post), or out-and-out plain ignoring the facts that demonstrate why PHP is such a horrible language, as one commentor on Jeff’s post did. He actually posted in reply (and in support of PHP) that he came away from Alex Munroe’s famous blog post PHP: a fractal of bad design without gaining any insight into why PHP was a bad language. Really? That’s VERY MUCH like reading “See Dick and Jane” and coming away asking “…but what were Dick and Jane REALLY doing?” Come on, pal. A critic hands you examples, and not just a few, but COPIUS examples that support his opinion, and you say “…but he really didn’t explain what his problem with the tool was.” Your love of the shitty tool is showing.
I should clarify my opinion and the above picture. I do not for a second mean to say that programming, indeed, the entire genre of digital engineering, should be an elitist, members-only, club. However, that certainly in no way means that a liberal arts major or a basket weaver should walk in the door and start coding up critical infrastructures either. But IN MY OPINION, and its just that, MY OPINION, PHP has allowed exactly that. Middle managers coding up crap. And I know of one example; in a crunch and down a man this middle manager rolled up her sleeves and attempted to complete a project coding up some missing parts of a PHP page, completed the project herself. And it passed QA. Great. Then, believing she would be able to complete the next project all the while saving on some man-hour cash coded up the entire thing herself. it crashed, burned, and a fire had to be put out due to her incompetence. Chances are she never would have attempted that had the project been written in python, ruby, or perl.
But that’s hardly a reason for rejecting a language, becuase some one might do bad things with it. And I won’t go into all the reasons why PHP is a bad language, that’s been done to death by people more elegantly or crassly than me. If you google up terms like “php is a bad language” you’ll dig up just as many, or more, links to pages that defend PHP. I’d really like to study those folks. Were they mass-hypnotized by PHP minions? How can so many people have drunk the kool-aid? It led me to question my opinion on the language. So I got back into it. About two minutes in I came back to my firm belief that I was right and all these people had indeed drunk the kool-aid. PHP is a terrible language. But Jeff Atwood asks us to stop and consider: “We get it already. PHP is horrible, but it’s used everywhere.” I reject this argument out of hand. Everyone can walk around with a dead bird carcass pinned to their lapels. That doesn’t mean I should as well. He then goes on disparage his reader by pointing out how obvious it is that PHP is a bad language and if you don’t know it you’re stupid. Interesting comment to put to your readers. In a second point he says that if you don’t like something make something better. This of course dismisses the many alterntives as “not good enuough”, apparently. Of which there are many, I’m not even to going to bother naming them.
If a client wants something written in PHP, they certainly may have it. In my experience, however, they don’t particularly care about the implementation, just the results, quickly. Sometimes integration with an existing tool or infrastructure dictates the implementation, or sometimes the customer wants a hetrogenous implementation, but not usually. After the mid-2000′s PHP extravaganza people seem to have mellowed on its use, at least in my world. Thankfully, I’ve not had to pick up the double-clawed hammer in quite some time. Thankfully.