Difference between revisions of "Text Editing"

From CSE330 Wiki
Jump to navigationJump to search
Line 68: Line 68:
'''To reiterate:''' It is highly recommended, although not required, to backup files using SVN no matter how you edit and save them.
'''To reiterate:''' It is highly recommended, although not required, to backup files using SVN no matter how you edit and save them.
[[Category:Module 2]]

Revision as of 05:29, 26 September 2012

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 Eclipse.

The most important aspect to consider is what you are most comfortable using. In particular, you don't have to keep using command-line text editors for 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 great, 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, although not required, to backup files using SVN no matter how you edit and save them.