Text Editing

From CSE330 Wiki
Jump to navigationJump to search

This article contains workflow recommendations from previous semesters of CSE 330. You should now instead refer to the Workflow guide.

Okay, so you've set up your server and are ready to start writing HTML, CSS, PHP, Python, and Ruby. How can you do it?

It is essential that you set up a workflow that suits your needs. Reading this article will make your life 10× easier for the rest of the semester.

Step 1: Choose Your Interface

You first need to choose how you want to approach file editing. You have a few choices:

  1. You can use a command-line text editor, like emacs, vi, or nano.
  2. You can use a GUI text editor, like Notepad++ or TextWrangler.
  3. You can use a full-scale integrated development environment (IDE), like Aptana Studio -- Eclipse (open source) or PHPStorm (paid, but highly recommended).

The most important aspect to consider is what you are most comfortable using. In particular, you do NOT need to use command-line text editors as your primary development environment in this class. The graphical user interface was invented for a reason. Don't feel like using vi or emacs will make you a good programmer, because I promise: it doesn't. If you like emacs or vi, that's fine, but know that there are other equally powerful options.

Step 2: Set Up Your Editor

This section covers how to configure your editor of choice to be most efficient at web development.

Command Line Text Editors

The communities behind command-line text editors are strong, and so there are plugins available to make your editor of choice more well suited to programming in HTML, CSS, PHP, and other web languages. Here are some links to tutorials that will show you how to set up your command line text editor of choice:

Graphical Text Editors

Notepad++ and TextWrangler are free GUI text editors for Windows and Mac OS X, respectively. You can download them from here:

There are tools available for both to speed up your web development routine. Here are some helpful web sites:

Integrated Development Environment

Aptana is a web development toolkit that can be installed as a plugin to Eclipse or as a separate application. Web site: http://www.aptana.com/

Follow these instructions to install Aptana as a plugin to Eclipse.

  1. In Eclipse, go to Install New Software...
  2. Add the following URL: http://update.aptana.com/update/studio/
  3. Load the packages and install Aptana Studio.
  4. Restart Eclipse.
  5. In the Aptana Studio welcome screen, go to Plugins
  6. Install the Aptana Studio PHP plugin
  7. Restart Eclipse again.

Step 3: Saving Your Project

If you edit your files directly on the server using a command-line text editor, you can use them right away. However, if you do, you are in danger of accidentally losing your code because you don't have it backed up anywhere. It is easy to destroy your entire project by pressing the wrong key in vim/emacs/nano! CSE330 students in past semesters have lost days worth of work because they used vim/emacs/nano to edit their files but didn't commit them to SVN.

If you edit your files on your desktop, you will always have a second copy, so this is less of an issue. However, since SVN is a version control system, you should still backup your files to SVN at the end of the day.

Uploading Files to Your Server

If you edit files on your desktop, there are several ways to upload those files to your server.

If you need help setting up an SSH filesystem or an SFTP client, you may ask a TA. Once everything is up and running, you will be able to easily upload files to your server for the remainder of this course.

To reiterate: It is highly recommended, albeit not required, to backup files using SVN no matter how you edit and save them. If you accidentally terminate your instance but didn't save your files to your SVN, don't expect a large amount of sympathy. ;-)