Archive for the ‘Frameworks’ Category

Programming Frameworks have always been popular. They claim to provide extended functionality and features, and improved development speed/decrease development time. These claims often turn out to be false, misconstrued, or exaggerated.

Some Frameworks take a very controlling approach, and tackle all aspects of a website/web application. In other words, they make you “assimilate” into their framework for all of your features. This can be good if the Framework is well designed and requires almost no integration or settings, however for every little bit of integration, and for every additional setting you need to alter to work, the more integrated you are and the less freedom you have.

Other Frameworks take a very open approach, and act more like a code library. These Frameworks tend to be under-documented and under-featured so you end up building more basic features. Some good basic frameworks exist in this category, but it varies depending on what kind of development you are doing.

Many programmers refuse to use frameworks and instead do all the programming by hand, with occasional use of manual, personal code libraries.

jQuery: AJAX File Uploads made easy

jQuery is an incredible Javascript library. It allows programmers, as well as other web developers with less programming experience, to develop high-end Javascript and AJAX features on their websites. Many situations require or benefit from software written from scratch, but other situations do not. For most Javascript functionality, writing your code from scratch isn’t worth it or necessary, and that’s where jQuery comes in. jQuery isn’t necessarily easy. The more customization you want, the more specific your requirements, the longer it will take you to get it right. But even if you have the time and experience, jQuery doesn’t do everything for you.

Many people are curious about how to perform a full AJAX file upload using jQuery. Some users have noted that HTML 5 supports AJAX file uploads, however most websites aren’t written in fully support HTML 5. Other users have also shown exactly how to do this using methods such as hidden iframes, and a Javascript XMLHttpRequest() object.
(more…)

jQuery: Tips for Beginners

jQuery is an incredible Javascript framework, but it can also be a bear to learn, and a bear to write even for an experienced user.

Writing Javascript and AJAX code from scratch can be extremely time consuming, and it’s important to keep inn mind that Javascript only accounts for 1/5th of your web application, maybe less, and wasting too much time on your Javascript should be avoided. In addition to Javascript, you’ve got CSS and HTML to write, as well as your server side language and DB language (ie. PHP and MySQL). That’s 5 language to manage, 5 languages to incorporate, and that’s without even considering mobile apps.

On top of that, you’ve got 4 major browsers to test your code in (IE, Firefox, Chrome, Safari), and it all becomes a bit of a blur when you’ve been working on a project for some time. (more…)

jQuery .load() complete callback function doesn’t work properly

jQuery’s .load() method supports an optional callback function called when the request is complete. However, you might find that the complete callback function doesn’t work properly.

The jQuery .load() documentation shows 2 optional arguments to the .load() method.

The first optional argument is “data”, which is described as “A plain object or string that is sent to the server with the request.”

The second optional argument is “complete”, which is described as “A callback function that is executed when the request completes.”.

The examples on that page present some confusion, by showing this example:


$('#result').load('ajax/test.html', function() {
alert('Load was performed.');
});

The problem with that example is that the “complete” callback function is shown as the 2nd argument, not the 3rd. (more…)

jQuery: XML Errors in Firefox when using load() and other functions

If you are using jQuery, and you’ve noticed some errors appearing in Firefox, it might be a very simple fix.

The errors resemble the following:

  • “not well-formed” (maybe referring to a specific piece of returned HTML)
  • “mismatched tag. expected </input>” (or “expected </option>”, “expected </td>”, “expected </br>” etc)

Chances are you are using jQuery’s load() or get() or ajax() functions and sending a response back to jQuery via PHP or another server-side langauge. (more…)

jQuery: show hidden layer not working using show() or fadeIn() functions

Q: Using jQuery, I cannot get a hidden layer to show or hide using the $(“#layerID”).show() or #(“#layerID”).fadeIn() functions.

A: Although there could be several reasons for this, one common problem is that you have set your DIV’s style attribute to specifically hide the layer using “visibility:hidden;” and “display:none;”. In many Javascript implementations, in order to change that value, both of these attributes must be set explicitly in the “style” attribute. For example:

  • <div id=”layerID” style=”visibility:hidden;display:none;”>text</div>

Traditionally, you would use javascript to modify the style attribute in order to show the layer.

However jQuery is slightly different. If you explicitly set the style attribute to “visibility:hidden;display:none;” then jQuery will not be able to show the layer. The solution is to remove the visibility attribute from your style tag, so only the “display:none;” attribute is left. For example:

  • <div id=”layerID” style=”display:none;”>text</div>

An alternative would be to use jQuery to hide the layer upon page load. For example, here is your DIV: (more…)

PHP Frameworks: What not to use

Types of PHP Frameworks

Frameworks existing for many purposes and are written in many languages. PHP frameworks come in many shapes and sizes, so it’s important to match your requirements and your development capabilities with the framework.

If you are very picky, you’ll need a framework that easy to customize. If you don’t have any development resources, you’ll need to choose a framework that provides all the functionality you will need.

Frameworks can be “large” or “small”, “light” or “heavy” and everywhere in between. For example, Joomla and Drupal are “large” and “heavy”. They contain lots and lots of code, lots and lots of built-in logic, and accordingly have lots and lots of problems. On the other hand, frameworks such as CodeIgniter are “small” and “lightweight”. CodeIgniter is minimalistic, and some would consider it more of a code organization tool. WordPress isn’t strictly a framework, but works great as a framework and isn’t as “small” or “lightweight” as CodeIgniter, but it isn’t “heavy” either. (more…)

BuddyPress Bug: After De-Activating BuddyPress, my website is blank and broken. What do I do?

BuddyPress is a fantastic addition to WordPress, but as with any software it comes with some caveats. We recommend you install BuddyPress on it’s own WordPress installation, separate from your primary website, not only to protect your primary website, but because it’s safer to give BuddyPress full reign over it’s own installation.

If you need to De-Activate BuddyPress, be sure to Activate a different Theme prior to De-Activating BuddyPress.

If you don’t do this, you might notice your site goes blank – and is completely broken after you De-Activated BuddyPress. This is obviously a big problem, and a terrible bug. But it’s one that can be easily fixed by switching to a different Theme, and then switching back. (more…)

Programming Analogies : Auto Service and Repair

Finding analogies for programming is very important for training programmers, for communicating to other programmers, to communication to customers and end-users, and to help a programmer’s understanding of their own code and goals for their code.

One thing to remember about analogies: They always brake down. An analogy is a “comparison” – and all comparisons will fall apart eventually, unless the things being compared are identical. In other words, at some point the comparison falls apart because the two subjects are different. This is okay, because we are just using this “comparison” mechanism for learning and understanding, we are not using this comparison to make the plans for the next space shuttle.

Example: A car needs new wiper blades, brake pads, and tires. And just the same, a web application or other application needs some basic maintenance.

davismotorservice.com (more…)

Glossary: Fragmentation

Fragmentation, in our context, is when an application splits into many different versions or branches.

As an example, Google’s Android is constantly accused if being heavily fragmented, which detracts from the user experience. Android, and many different versions of it, are installed on literally hundreds of different devices. The large number of variations does present problems for development, carrier software releases, Android developers, and to a small extent end-users. (more…)

Android: Freedoms, Truths, and Myths

Since the introduction of the Android OS by Google, there has been tons of hoopla about what Android is, what Android does, and what sets it apart. These aspects of Android have been manipulated and misconstrued by the media, and subsequently by the public, resulting in a poor understanding of what Android is. (more…)