Selecting a Solid Code Editor


Hello guys, hope everyone is doing well. I’ll start this post by admitting that I absolutely love Sublime Text and already own a license for it. But, I’m a curious lad who likes to try new things and therefore I couldn’t help being interested in trying out the slew of new open source and also payware editors which are popping up.

As you also can tell, I primarily develop in Python but do a lot of frontend work too, so CSS and Javascript are of interest. In addition, there’s a little C, Bash, PHP and Perl thrown in for good measure (mostly for legacy reasons … I absolutely despise Perl).

I’ll be evaluating the current versions of GitHub’s Atom, Adobe’s Brackets, Microsoft’s Code and JetBrains’ PyCharm against the features that I’ve come to love in Sublime Text.

Please note that this post will continue to be updated as time goes on and features are added to the various editors. I’m happy to be corrected if I have missed anything here as I don’t yet know all the other editors intimately.

Features to be Evaluated

Text Manipulation

  • Multiple Cursors: The ability to type on multiple lines and also select instances of a search term and place multiple cursors there
  • Join Lines: Ability to join multiple lines together easily
  • Duplicate Lines: Make another copy of the current line
  • Moving Lines: Moving lines up and down
  • Changing Case: Switching to title case, uppercase and lowercase
  • Commenting Lines: Ability to easily comment out one or more lines
  • Line Endings: Being able to change the default line endings and also the line endings of the current file
  • Indentation Settings: Changing from tab to soft spaces and being able to change the width
  • Replace: Regular expression support and good highlighting of search terms as you type

General Editing & IDE Features

  • Appearance: An appealing visual design
  • Autocomplete (vars): Ability to autocomplete existing variables and class names with the tab key
  • Code Folding: Ability to fold a block of code
  • Spell Checking: Built-in spell checking (handy for comments)
  • Language Support: Reasonable language support (expected languages are Bash, Python, Ruby, C, C++, PHP, Perl, HTML, Jade, CSS, LESS, SASS, Javascript, Coffeescript, Puppet, Markdown, SQL, XML, JSON and YAML).
  • Autocomplete (IDE): Ability to autocomplete library imports and function definitions
  • Linting: Support for linters like flake8, JSHint and so forth
  • Project View: A good project browser which lets you open files using a keyboard shortcut
  • File Tabs & Switching: A neat tab implementation (like that of Chrome) with the ability to cycle through tabs easily
  • Split Editing: Ideally at least the ability to split horizontally or vertically for 2 files to be open at the same time (I never have more than that)
  • Snippets: Code snippets which you may insert by typing various keywords
  • Refactoring: The ability to easily rename variables and classes
  • Command Palette / Go To Anything: Ability to use the keyboard to select menu items
  • Minimap: The ability to see an overview of your code that you can scroll through
  • Indent Guides: Indent guides are very handy for languages like Python where spacing is critical and for other languages purely for clean coding
  • Rulers: I like to stick with PEP8 standards and generally stick to lines of a certain length to avoid long lines
  • Git Change Indicator: Ability to see what lines in a file have been modified since the last commit

Web Development

  • Emmet: We all know and love Emmet for HTML editing so it’s a must
  • CSS Colours: A colour picker for CSS colours and the ability to see the colour chosen at a glance

Miscellaneous Features

  • Cross-platform: We’ve come to expect that editors will work across Windows, OSX and Linux these days
  • Extensions: The ability to extend my editor to taste with 3rd party or open source extensions is something I’ve grown to love and now rely on
  • Performance: Memory usage, CPU usage, general responsiveness and start times
  • Scratch Pads: The ability to just exit Sublime Text without having to save everything that’s open is a huge advantage for me and something I rely on now
  • Zooming: Quick and easy zooming in and out with Ctrl+scrollwheel

Feature Comparison

Legend:

  • : feature exists and is fully functional
  • !: feature partially exists
  • x: feature doesn’t exist or is too limited to judge

The symbol will be repeated twice if an extension is required.

Text Manipulation Sublime PyCharm Atom Brackets Code
----------------------- --------- --------- --------- --------- ---------
* Multiple Cursors √ √ √ √ √
* Join Lines √ √ √ √√ x
* Duplicate Lines √ √ √ √ √
* Moving Lines √ √ √ √ √
* Changing Case √ ! √ √√ x
* Commenting Lines √ √ √ ! √
* Line Endings √ √ x x !
* Indentation Settings √ √ ! √ !
* Replace √ √ √ √ √ Editing & IDE Features Sublime PyCharm Atom Brackets Code
----------------------- --------- --------- --------- --------- ---------
* Appearance √ ! √ √ √
* Autocomplete (vars) √ √ √ √√ !
* Code Folding √ √ √ √ x
* Spell Checking √ √ √ x x
* Language Support √√ √√ √√ √√ !
* Autocomplete (IDE) !! √ x ! !
* Linting √√ √ √√ ! x
* Project View √ √ √ ! !
* File Tabs & Switching √ √ √ √√ x
* Split Editing √ √ √ √ !
* Snippets √ √ √ !! !
* Refactoring ! √ ! x x
* Command Palette √ x √ √√ √
* Minimap √ √√ √√ √√ x
* Indent Guides √ √ √ √√ x
* Rulers √ √ √ √√ x
* Git Change Indicator √√ √ √ ! √ Web Development Sublime PyCharm Atom Brackets Code
----------------------- --------- --------- --------- --------- ---------
* Emmet √√ √ √√ √√ √
* CSS Colours ! √ √√ √ √ Miscellaneous Features Sublime PyCharm Atom Brackets Code
----------------------- --------- --------- --------- --------- ---------
* Cross-platform √ √ √ √ √
* Extensions √ √ √ √ x
* Performance √ ! ! x !
* Scratch Pads √ √ x x x
* Zooming √ √ √ √√ x

Sublime Text

The following features require extensions:

The following features are limited or missing:

  • Autocomplete (IDE): Python autocomplete is implemented rather well by the Anaconda package but I’m not aware of equivalents for other languages. I have had nothing but drama using the popular SublimeCodeIntel package so I don’t consider that a good choice at this stage.
  • Refactoring: You may use Expand Selection to Word to rename variables (be sure to do this without a selection). Unfortunately, I’m not currently aware of how one could rename a variable for all files in the project.
  • CSS Colours: Although there are packages available such as Color Highlighter and ColorPicker, the experience is far less refined than editors like Atom or Code. The ColorPicker uses the rather crappy Windows color picker and the highlighter requires that you save the CSS file before seeing the changes.

It’s easy to see why Sublime Text is so popular, it’s an amazing editor. It mainly lacks in the area of IDE features like full autocompletion for libraries and refactoring.

PyCharm

The following features require plugins:

  • Language Support: PyCharm is clearly made for primarily for Python, so it sadly doesn’t include any support for PHP or Ruby which have their own respective products or are part of the flagship IntelliJ product. A Bash plugin and C/C++ plugin.
  • Minimap: Can be enabled through the CodeGlance plugin.

The following features are limited or missing:

  • Changing Case: PyCharm allows you to transform text to uppercase and lowercase, but not title case which may be needed from time to time.
  • Appearance: I’m not saying that PyCharm is ugly because it’s absolutely not. But because it’s built with Java, it doesn’t use native interface elements and therefore does clearly feel a tad different compared to native applications. The default shortcuts in the application are also rather non-standard and really need tweaking (e.g. Ctrl+N for new, Ctrl+W for close and so forth).
  • Command Palette: I can’t seem to find an equivalent of Sublime Text’s command palette.
  • Performance: JetBrains is reasonably fast when being used, but it is a beast, taking close to 1 GB of memory when running and having a rather long startup time. You will need a moderately powerful machine to run and use this IDE.

Atom

The following features require packages:

The following features are limited or missing:

  • Line Endings: The line-ending-converter helps a little here, but still, Atom doesn’t allow one to specify the default line ending or even see what line endings the current file has.
  • Indentation Settings: Atom is decent in this regard, it lets you set defaults but it doesn’t make them easy to change specifically for the current file nor does it make it apparent what the current settings are.
  • Autocomplete (IDE): No autocomplete for imports or libraries that I could find across any language.
  • Refactoring: Atom actually does an impressive job with this. Atom’s Select Next feature will cleverly only select the variable that you’ve chosen neglecting other words which contain the variable name. The only reason it didn’t get a tick here is that it doesn’t cleverly do this across an entire project sadly.
  • Performance: Atom works pretty well but does take a while to start and seems to lock up completely from time to time when using the Settings page and installing packages.
  • Scratch Pads: Sadly, Atom doesn’t offer this feature, you must always save files when exiting the application.
  • Other: Atom doesn’t allow you to use a single key to select Save, Cancel or Don’t Save when closing a file.

Atom is very impressive and would be the closest alternative to Sublime Text. The editor does lack in a few areas such as IDE features, scratch pads, line ending support and has various other relatively minor usability problems. The performance problems while in Settings and lack of line endings for me are the biggest issues with the editor at the moment.

Brackets

The following features require extensions:

The following features are limited or missing:

  • Commenting Lines: Brackets lets you comment lines but it doesn’t do it neatly like Atom and Sublime do.

e.g. let’s comment out the print statement here

if name == 'Fotis': print 'Hello there' name = None

Sublime Text

if name == 'Fotis': # print 'Hello there' name = None

Atom

if name == 'Fotis': # print 'Hello there' name = None

Brackets

if name == 'Fotis':
# print 'Hello there' name = None
  • Line Endings: I can’t find a way to view, set or change the default line endings in Brackets at all.
  • Spell Checking: An extension exists which attempts to implement this but it’s not realtime and suggestions are not available via right click (only via Ctrl+Space).
  • Git Change Indicator: This is partially supported via the Brackets Git extension but changes are only visible upon save.
  • Autocomplete (IDE): Brackets includes IDE-like features for several languages and it does it rather well, but the list of languages is not extensive and doesn’t include Python.
  • Linting: Although Brackets does have some linting plugins, they don’t seem to be uniform or of good quality like those offered in Atom and Sublime Text. As an example, the flake8 plugin appears not to be realtime and I couldn’t get it working when I tried.
  • Project View: Works well but only allows you to view one project at a time.
  • Snippets: Several extensions exist which attempt to bring this into Brackets but they seem to offer limited language support.
  • Refactoring: Partially possible but suffers the same problem as Sublime Text using the Add Next Match to Selection operation.
  • Git Change Indicator: There’s a Brackets Git extension but it forces you to save the file before updated Git indicators are shown.
  • Performance: I’m sorry to say that Brackets felt very slow, even on my specced out system. File switching is painfully slow when the minimap, ruler and indent guide extensions are activated (but rather good without them). The editor takes a little to start up. The entire editor feels slow in general compared to the rest.
  • Scratch Pads: Sadly, Brackets doesn’t offer this feature, you must always save files when exiting the application.

Brackets has an extremely limited core and requires loads of plugins to become useful. Thankfully, there is a great community behind the editor who has contributed many extensions which improve the editor. However, with the exception of the excellent IDE-style features provided for CSS, Javascript and HTML, Brackets generally falls short as an editor.

Code

The following features are limited or missing:

  • Join Lines: There’s no way to join lines in this editor.
  • Changing Case: Surprisingly, there’s no way to change case!
  • Line Endings: You may change line endings for the current file but there doesn’t seem to be a way to set default line endings.
  • Indentation Settings: Code allows you to set a default tab size but doesn’t seem to provide a way to view or change the setting for the current file and for various languages.
  • Autocomplete (vars): This only works in certain languages.
  • Code Folding: No code folding support is provided.
  • Spell Checking: No spell checker appears to be included out of the box.
  • Language Support: There’s limited language support out of the box, languages such as Puppet and C are missing for example.
  • Autocomplete (IDE): Code really shines here, it has an amazing autocomplete (what they call IntelliSense) experience, but it only works on a limited set of languages sadly, and Python isn’t one of them.
  • Linting: No linting support appears to exist out of the box.
  • Project View: The project view is great but only allows for one project to be open at a time.
  • File Tabs & Switching: Switching files is quite painful in this editor, there’s no tab bar, and there doesn’t seem to be a way to move to the next and previous file accurately. In fact, half the time, I don’t know what files are even open.
  • Split Editing: Code only allows you to split the screen horizontally ( above and below) but not vertically (left and right).
  • Snippets: The editor offers snippets for a limited set of languages.
  • Refactoring: No refactoring support appears to exist.
  • Minimap: No minimap is available.
  • Indent Guides: No option to enable indent guides.
  • Rulers: No option to enable rulers.
  • Extensions: No extension support yet, but it seems to be coming
  • Performance: Code performs extremely well compared to the other Javascript-script based editors and overall is very snappy. But compared to Sublime Text, it is a little less responsive which is why it didn’t quite get the tick.
  • Scratch Pads: Sadly, Code doesn’t offer this feature, you must always save files when exiting the application.
  • Zooming: No ability to zoom with Ctrl+scrollwheel. You can however use Ctrl and + to zoom in. You can’t zoom out beyond the original font size though.
  • Other: Code doesn’t allow you to use a single key to select Save, Cancel or Don’t Save when closing a file.

Conclusion

Overall, we have many great choices here. Personally, I feel that Brackets probably fell shortest of the bunch when considering it’s been around for a little while. Code shows great promise but is still rather young and lacks some basic functionality and extension support.

My picks as of June 2015 are as follows:

  • IDE: PyCharm (but you’ll need a beefy machine)
  • Editor: Sublime Text
  • Alternative Editor: Atom (open source and free)

Page 2

Good ol’ plist files. They are at the core of OS X for storing application settings and they work really well.

If you have ever automated part of your OS X build or changed some cool hidden feature, you have probably used the defaults command to do so. The defaults command is great and is still recommended for simple things, but if you want to edit complex plist structures like arrays, dicts and nested structures, you’ll inevitably come across PlistBuddy.

The tool is extremely simple to use and powerful, but due to the lack of tutorials and guides, I thought I’d write one in my own words.

Start by installing rlwrap to get readline support:

And now start Plistbuddy wrapped in readline glory:

rlwrap /usr/libexec/PlistBuddy testing.plist

This creates a fresh plist file with a dict as its top-level structure. At any point, you may type Print to view the entire structure:

Command: Print
Dict {
}

Let’s create a regular item at the top level:

Command: Add :Version string 1.0
Command: Print
Dict { Version = 1.0
}

And now change it’s value:

Command: Set :Version 1.1
Command: Print
Dict { Version = 1.1
}

Next up, we’ll create an array and push a few items onto it:

Command: Add :Applications array
Command: Add :Applications: string app1
Command: Add :Applications: string app2
Command: Add :Applications: string app3
Command: Print
Dict { Version = 1.1 Applications = Array { app1 app2 app3 }
}

We may also add items to the beginning of the array by inserting at index 0:

Command: Add :Applications:0 string app0a
Command: Add :Applications:0 string app0b
Command: Add :Applications:0 string app0c
Command: Print
Dict { Version = 1.1 Applications = Array { app0c app0b app0a app1 app2 app3 }
}

And now, we’ll delete an entry:

Command: Delete :Applications
Command: Print
Dict { Version = 1.1
}

Now let’s create a more complex data structure:

Command: Add :BrainCells integer 5
Command: Add ":Favourite Random Number" real 3.9234
Command: Add :Intelligent bool false
Command: Add :Today date "Sat Jun 27 18:51:00 AEST 2015"
Command: Add :Person dict
Command: Add :Person:Name string "Fotis Gimian"
Command: Add :Person:Occupation string "Geek"
Command: Add :Person:Likes array
Command: Add :Person:Likes: string Potatoes
Command: Add :Person:Likes: string Apple
Command: Add :Person:Likes: string Bouncing
Command: Print
Dict { Favourite Random Number = 3.923400 Version = 1.1 Person = Dict { Likes = Array { Potatoes Apple Bouncing } Name = Fotis Gimian Occupation = Geek } Intelligent = false BrainCells = 5 Today = Sat Jun 27 18:51:00 AEST 2015
}

Now let me be a little evil and replace my Apple like with Microsoft:

Command: Set :Person:Likes:1 Microsoft
Command: Print
Dict { Favourite Random Number = 3.923400 Version = 1.1 Person = Dict { Likes = Array { Potatoes Microsoft Bouncing } Name = Fotis Gimian Occupation = Geek } Intelligent = false BrainCells = 5 Today = Sat Jun 27 18:51:00 AEST 2015
}

We may also print a subset of a structure by using colons to move further in:

Command: Print :Person:Likes
Array { Potatoes Microsoft Bouncing
}

You may use an index to move into an array:

Command: Print :Person:Likes:1
Microsoft

And naturally, you can delete items at any level using colons to get inside:

Command: Delete :Person:Likes
Command: Print
Dict { Favourite Random Number = 3.923400 Version = 1.1 Person = Dict { Name = Fotis Gimian Occupation = Geek } Intelligent = false BrainCells = 5 Today = Sat Jun 27 18:51:00 AEST 2015
}

You may save all your hard work when done:

Command: Save
Saving...
Command: Exit

These commands may be invoked from the CLI directly using the -c option:

➔ /usr/libexec/PlistBuddy -c "Print" testing.plist
Dict { Person = Dict { Name = Fotis Gimian Occupation = Geek } Intelligent = false BrainCells = 5 Version = 1.1 Today = Sat Jun 27 18:51:00 AEST 2015 Favourite Random Number = 3.923400
}

If you would like to modify plist files provided by applications, you’ll need to provide PlistBuddy the full path name to the file (unlike the defaults command):

➔ /usr/libexec/PlistBuddy -c "Print :magnification" ~/Library/Preferences/com.apple.dock.plist
true
➔ /usr/libexec/PlistBuddy -c "Set :magnification bool false" ~/Library/Preferences/com.apple.dock.plist
➔ /usr/libexec/PlistBuddy -c "Print :magnification" ~/Library/Preferences/com.apple.dock.plist
false

Oh and a little tip (after you stretched for that shift key on each command). The commands (i.e. Print, Set, Add and so on) are case insensitive, so you can just type them in lowercase.

Hope this helps someone out there. Have a good one! :)


Page 3

Streaming music services are very mainstream now and really a great step forward in allowing us all to have exposure to an infinite amount of material that ultimately allows us to discover and enjoy more music.

With Apple Music being released just the other day, I wanted to throw my 2 cents in about the main players, Google Play Music All Access (such a long name), Spotify and Apple Music.

In my personal opinion (and I completely respect that this a subjective matter), Google Play Music All Access lacks the polish of the other two services.

Here are some of the reasons that I personally ruled it out rather quickly after starting my trial. It primarily relates to the exprience on desktops (Windows and OS X).

On desktops, there are no official native clients and having the service in a browser simply isn’t the same for me, and here’s why:

  • The online version of Google Play All Access Music doesn’t appear to support gapless playback (especially useful for live albums or continous mixes).
  • The online version doesn’t allow you to store music for offline listening, so desktop users must stream.
  • Having Google Play Music All Access in a browser makes it harder to deal with on the desktop, it forces you to have a browser open at all times and just quitting your browser after browsing (a very common practice) means that you will stop the tunes too.

The music selection seemed rather decent to me but these limitations were a good reason to rule out Google Play Music All Access. I primarily listen to music on my desktop and so this was a rather big deal.

I’ll start by saying that both these services are awesome and I don’t think you can go wrong with either (unless you’re currently an Android user, in which case you may wish to hold out on Apple Music until the app comes out).

So let’s just get to the pros of Apple Music over Spotify first:

  • Music videos! (something I find myself watching often now).
  • Update videos directly from artists (nice touch).
  • Much easier ability to make contents available offline on desktops (Spotify bizzarly only allows playlists to be made available offline on desktops, not Your Music). With Apple Music, I can make my entire music library available offline in a second.
  • Works much more reliably behind a proxy (which many of us are stick with at work on corporate networks).
  • A very generously priced family plan.
  • Ability to view items in your library based on Genre.
  • iTunes has an awesome mini player which Spotify lacks.

And on the Spotify end, there are some pros over Apple Music in my opinion:

  • Gorgeous dark interface on all platforms (love dark UIs).
  • An Android app (with Apple Music coming later this year).
  • A more polished collection of music (Apple Music is strangely missing certain albums and singles from artists, but it seems to be expanding the list daily).

Overall, I’m really liking Apple Music so far and favour it a over Spotify. If Apple can get the music collection to match what’s on Spotify and the Android app is good, then I think it will be my choice going forward.

What are your thoughts? Are there any other important factors that make you choose one over the other?