Suggestions for learning JSON?

Yesterday a reader asked me a question about one of my blog posts. In the blog post, I described a Cordova application that would retrieve a list of URLs from a server. It would then fetch each URL and download the resource to the device. I casually described the data as “an array of URLs in JSON” and assumed everyone would know what that meant. Of course, not everyone does know what JSON means.
Continue reading

Front-End Interview Questions – Part 3

This post is part of a series I’m writing where I attempt to answer, to the best of my ability, a set of Front-End developer questions. I expect/hope my readers will disagree, augment, and generally hash out my answers in the comments below.

Talk about your preferred development environment. (OS, Editor or IDE, Browsers, Tools, etc.)
I covered this pretty deeply in a blog post from late last year (My Cordova/PhoneGap Developer Setup (Fall 2014)). While that post was focused on Cordova development, it pretty much covers my development setup in general. I don’t think I have anything to add to that list so I’ll carry on.

Which version control systems are you familiar with?
Git, although I suck at branches and merging. I’ve made a note in Evernote that lists different types of Git commands based on what I’m trying to achieve. I’d like to be a bit better at Git, but my current level of skill hasn’t really hurt me so far. When I have some free time, I plan on taking the Code School Git course as I absolutely love Code School.

I can use SVN as well, but since I use it so rarely I keep a note around to help me remember the basics.

I have some experience with Perforce. I’ll use it if you put a gun to my head.

And yes – you will all laugh at me – but I used to love Visual Source Safe. It was simple, easy to use, and I never had data corruption with it.

Can you describe your workflow when you create a web page?
That’s a bit open ended. In my editor, I use snippets so I can quickly lay out a simple HTML page, quickly add jQuery if I need it, etc. Most of my demos are JavaScript-based so I’ll normally:

  • Make a new folder for my test.
  • Make an index.html file and drop in the snippet.
  • Make an app.js and start coding.

That’s it. I don’t use Yeoman as I find it super heavy for quick one offs. Ditto for Bower. My issue with these tools is that they tend to add a huge amount of files. If I were building a proper “project”, ie something I’d be working on for a month, it may make sense, but for my blog posts, presentations, etc, they are way overkill. I actually built my own tool for Brackets to quickly download JavaScript frameworks with a simple right click. It only downloads the core files needed to use them because – that’s allI want to do – use them. (Maybe I’m crazy that way. ;)

If you have 5 different stylesheets, how would you best integrate them into the site?
Oh, this is a good one. Keeping in mind I try to avoid CSS and just use a library (like Bootstrap), it seems to be I’d do the following:

If the 5 style sheets were all application specific, I’d combine them into one file. If they were a combination of application specific style sheets and libraries (like Bootstrap), I’d only combine the application specific ones. I’d want Bootstrap (or whatever) separate to ensure it is easy to update in the future.

I never really thought much about “organization” of my CSS because I rarely write much of it. I’d run CSSLint against it, but I don’t think CSSLint deals with “organization” of a large sheet. I’d also run a tool to find unused css, like uncss.

An example of application specific scheduled tasks in ColdFusion

Yesterday I blogged about my migration of ColdFusion Bloggers from ColdFusion to Node. During that conversion, I was impressed by how easy it was to set up a scheduled task. (Once I got past the vagaries of the CRON syntax.) I remembered that ColdFusion 10 had added some dramatic improvements to scheduled tasks. You can read a high level review of that here: Using Scheduler. While I knew about these improvements, I never actually got around to playing with them. Last night I did – and here’s what I found.

Continue reading

Front-End Interview Questions – Part 2

This post is part of a series I’m writing where I attempt to answer, to the best of my ability, a set of Front-End developer questions. I expect/hope my readers will disagree, augment, and generally hash out my answers in the comments below.

What did you learn yesterday/this week?
Not that it is terribly important per se, but I learned that in some browsers, you can drag and drop a file onto an input/file field. I thought that was cool. It also got me thinking about what other browser features I may be missing out on. I tend to focus on what the browser supports in terms of HTML/JS/CSS, but in regards to UX like this (that’s how I’d classify it), I wonder how much stuff I’m missing (and how much “casual” users are aware of).

What excites or interests you about coding?
Mainly figuring things out – although a lot of times it is simply seeing my input converted into actions on the computer. That sounds lame, or, well, what all programming does, but it is honest as well. I remember my first experience with coding and the joy I felt when I actually got the computer (Apple 2e FTW!) to do what I wanted. That joy was like a drug I’ve not been able to shake off since then.

I’d say I get more excitement though from sharing with others. That’s why I write on this blog and do presentations.

What is a recent technical challenge you experienced and how did you solve it?
I wish it were more exciting, but, I’m dealing with moving a large Mongo database from my local machine to a remote server. I had to learn how to make backups and how to restore. I also had to deal with timeout issues. How did I solve it? I Googled. But in order to be sure I could get to the answers easier next time, I stored the command line calls in Evernote. I tend to have pretty crappy memory, especially with CLIs, so I use Evernote as a reference for things like this.

What UI, Security, Performance, SEO, Maintainability or Technology considerations do you make while building a web application or site?
Ah, a big one. :) Let me try to break this down a bit.

In terms of UI, as I’m mostly doing small POCs (proof of concepts), I try to keep things as simple as possible. If I need things to look nice quickly, I’ll use Bootstrap. If I’m building something in Cordova and it will be a medium to large demo, I’ll use Ionic.

In terms of security, it really depends. Almost all of my work is client-side so now, and I know that you can’t trust anything from the client when speaking to a server. So I know, for example, that if I’ve built a mobile app that stores data on the server, I have to employ authentication/authorization rules on the client and on the server, and I damn well better get it right on the server. One of the things I do when playing with a cool front end web app is open up the dev tools and look at the network requests being made. I’ll then – sometimes – open up those requests in other tabs and see how well things are locked down. I’ll combine this with curl in the terminal if I really feel like testing out an API.

In terms of performance, guess what – it depends. :) I’ll be honest and say that performance of client-side code is not something I’ve got into deep yet. I’m certainly aware of the tools browser vendors provide in this area and I know where to begin if I’m seeing “jank” in my front-end code. Maybe I’m biased, but this is exactly the kind of answer I’d hope from someone about this. I.e., “I don’t know, but I know the tools exist, where to find it, and how to start Googling to dig deeper.”

SEO – nope – I don’t care. :) Ok, I guess I do care, but, it isn’t something I think about. (Maybe I need to more. There is a SEO plugin for WordPress that a friend recommended to me.)

Maintainability – I suppose this falls into basic things I’ve been aware of since I started my career. Proper documentation, clean code, source control to help keep track of what’s changed, using a bug tracker to help manage requests versus email, etc. I’m not sure how well this is taught now. I don’t remember it being taught back when I was in comp sci, but that was decades ago. I think I just found something to blog deeper about later on.

Technology – This part of the question is a bit open ended. At the end of the day, whether I use ColdFusion or Node or – heck – Perl CGI – I want to ensure my technology stack performs well, can be secured, and is generally stable. I’d think most of the common stacks out there match that criteria so it comes down to what is best for the team developing the project. On the client-side, the biggest thing that comes to mind here is progressive enhancement. Given technology X that may only be supported on 10% of browsers, you can add it to your project in such a way that the other 90% are not impacted by the lack of said technology.

ColdFusion Builder 3 Updated (the right way)

About two weeks ago I blogged about how Adobe had updated ColdFusion Builder but had – oddly – not used the regular Eclipse update mechnism to distribute the update. Instead the expectation was that users should redownload the entire product again.

While I was happy as heck to see installers updated (that makes your post-installation experience a bit nicer imo), I couldn’t understand why they didn’t release an updater.

Well I’m happy to say Adobe released the update the right way. You can now update your Builder directly in the editor itself. To be honest, none of the bug fixes were things that impacted me, but you should check the blog post to see if they impact you.

On the off chance you may not know how to check for updates in Eclipse (come on, Eclipse is simple, right?), just go to the Help menu and select Check for Updates.

ColdFusion Bloggers migrated to Node.js

Yes, I did it again. If Adobe ever kills ColdFusion you can blame me. ;) This is just an FYI to let folks know I’ve rewritten ColdFusion Bloggers as a Node.js site running on the AppFog platform. To be clear, no, I’m not trying to kill ColdFusion! I’m migrated off my old ColdFusion server and setting up my old sites in a simpler form because – well – I want my life to be simpler. My only real “server” will be this blog, and as I’m still adjusting the settings a bit and tuning WordPress, I want every other thing I run to be as simple and low-maintenance as possible. Plus – I also kinda want to get better at Node.js!

Continue reading

6751047205_2df88f2ddc_z

Front-End Interview Questions

A few days ago, either someone tweeted or someone shared with me an interesting document: Front-end Developer Interview Questions. This document (well, Git repo really) is a large set of questions that could be appropriate for interviewing someone for the role of a front-end developer. While this was new to me, apparently this document started way back in 2009 (did we even have browsers then?) and has had contributions from quite a few people.

Continue reading

Drag and Drop on File Inputs in HTML

A big thank you to Sara Soueidan for sharing this on Twitter. I’ve worked with a few web apps that allow for drag and drop file uploads and when it works well, it is really handy. In fact, being able to drag and drop an image onto my WordPress editor is one of the things I’m most happy about since my migration. But did you know that you can drag and drop a file onto a regular HTML input file field?

Continue reading

PhoneGap/Cordova Tip: Working with files under www and Android

This is a topic that has come up a few times in comments recently but I wanted to post something a bit more explicit. First and foremost, you cannot use the File system APIs to work with files under the www folder. The docs for the File plugin incorrectly states that you have Read access to the application directory (which would contain www) but that is incorrect.

You can use XHR to read in files from under www. For text files this is rather trivial. For binary data you want to be careful before reading in large amounts of data. Remember that you can work with binary data via Ajax using XHR2 (spec and support levels).

Finally – one problem you may run into is supporting a dynamic list of files. Since you can’t read the directory, if you want to support a random set of assets under www then you would need to ship a file that contains a list of those resources. You would then do an XHR to that file, get the list, and process as you see it.

Alt-History on TV – The Man in the High Castle

As readers know, I am a huge fan of alt-history. It has been a while since we’ve had any on TV (earlier seasons of Fringe), but I was stoked to discover this week that Amazon Prime has created a new adaptation of Philip K Dick’s famous story, “The Man in the High Castle.” While one of the more common alt-history types (Nazi Germany wins WWII), the story is quite fascinating and well worth a read. If you have Amazon Prime, you can watch the premier now.

Continue reading