Web Dev Notes

Blog about web development by Robert Dawson

A few advantages and/or disadvantages of PHP

 The biggest strength of PHP for me has always been that it's free, in contrast to a language like .NET. For example, I used ColdFusion and ActionScript both for years, but only because someone else, namely, my boss at the time, paid for the necessary software to use them!

Another strength of PHP for me has been its relative ease of use and learning curve. For example, for better or worse, I have rarely felt the need to write classes, whereas I have with a language like Java or Apple's dark underbelly, Objective-C.

Maybe I should blame my art background, but I have generally enjoyed the simplicity of loosely typed languages. At the 2013 SF HTML5 Developer Conference, for instance, I found myself nodding in agreement when Douglas Crockford reaffirmed his overall praise of JavaScript's loose typing, even at the expense of having a single "number" type.

However, I also found myself scratching my head a bit because I kept wondering if it might be better to better organize a loosely typed language like JavaScript, since, at least in JavaScript's case, it's not so good at counting. And I find that, as I continue to write code, whether PHP or CSS, I tend to want more structure, especially if it promises reusability.

So, I suppose I see PHP's loosely typed structure as both a strength and a weakness, for more speed and less stress, respectively.

One last weakness of PHP that I should mention, keeping in mind that this might simply reflect my ignorance of available options, is the ease of generating documentation for PHP code. I have used phpDocumentor, for example, but also found annoying problems, like when each of the generated HTML pages starts with an error about not specifying a default timezone. Is this really that hard to eliminate this error?

Here are some relevant discussions I found today:

What are some of the advantages of PHP over other programming languages?

What are the horrors of PHP?

Strengths and Weaknesses of various programming languages

But, however good or bad, by whatever measure, PHP seems to a given developer these days, it does remain a popular choice. 

Taking a swipe at swiping

I have to take a small swipe at the touch gesture of swiping on mobile devices. Below is a screenshot of an app I installed this morning called doable. It's good! But they use swiping in an in intuitive way, to complete tasks. Tapping on a task takes you to that task's details, where, to add annoyance, you have no option to complete the task.

What would I do? I would increase the size of the outer and inner circles to the left of each task name and let users tap either circles to indicate completion. I would also indicate completion by fading from an intense color to transparent before moving the task down to its next place in the frequency-based hierarchy.

Transient

Experience with Squarespace v5

Overall, I love my new Squarespace site. But here is the good with the bad.

The Good

  • Pretty!
  • Obviously took a lot of work to develop (and I can't wait for v6)
  • Very easy to maintain

The Bad and Ugly Underbelly

Only one problem: Painful customization

  • No server-side language support (or plans to provide it), which, to illustrate the problem with a personal example, prevented me from using PHP to parse an XML file from an API that doesn't support JSONP, meaning no cross-site allowance
  • No ability to insert JavaScript into the body (at least with my account), which means front-loading all JavaScript, causing needless delays until I have time to implement an asyncronous workaround like ControlJS
  • Drag-and-drop insanity, in that reordering a picture gallery via drag-and-drop is a great solution until you have over 100 images, at which point I started thinking about writing my own script to sort without so much scrolling
  • No FTP support, which is just silly from a developer's standpoint
  • Poor mobile support, since the iOS versions allow only basic blog editing, making WordPress a much better solution for those of us who want to add or edit content on the go

But, soapbox aside, despite there being more negatives than positives listed here (and that I bolded the negatives so that Squarespace staff will let me preview v6 already), I do really enjoy how I am able to create and centralize my own stuff here and plan to continue using it and finding ways to make my life easier (and pass it on, if I do)!