1

Hello fellow Programmers,

I am still a relatively new programmer and have recently gotten my first on-campus programming position. I am the sole dev responsible for 8 domains as well as 3 small sized PHP web apps.

The campus has its web environment divided into staging and live servers -- we develop on the staging via SFTP and then push the updates to the live server through a web GUI.

I use Sublime Text 2 and the Sublime SFTP plugin currently for all my dev work (its my preferred editor). If I am just making an edit to a page I'll open that individual file via the ftp browser. If I am working on the PHP web app projects, I have the app directory mapped to a local folder so that when I save locally the file is auto-uploaded through Sublime SFTP.

I feel like this workflow is slow and sub-optimal. How can I improve my workflow for working with remote content? I'd love to set up a local environment on my machine as that would eliminate the constant SFTP upload/download, but as I said there are many sites and the space required for a local copy of the entire domain would be quite large and complex; not to mention keeping it updated with whatever the latest on the staging server is would be a nightmare.

Anyone know how I can improve my general web dev workflow from what I've described? I'd really like to cut out constantly editing over FTP but I'm not sure where to start other than ripping the entire directory and dumping it into XAMP.

  • 2
    Have you looked at Version Control Software such as Git, mercurial or subversion? – James Nov 2 '13 at 12:45
  • @James: I've started learning Git. I understand the process of using git from the beginning of a project, but I'm not sure how I would adapt a live project (that hasn't used git to this point). tips? :) – Prefix Nov 5 '13 at 0:17
  • Just get an up to date copy of the code. git init a new repo, and prepare your first commit with lots of git adds. Note you generally want to commit code only, not config files. If a config file is going to be different on different machines (like the database name, host, user & password) don't add it. Now commit, and push to your chosen remote repository. Now start using that repository everywhere. All code changes now flow thru git for better code management! – James Nov 5 '13 at 20:21
1

keeping it updated with whatever the latest on the staging server is would be a nightmare.

It's shouldn't be a nightmare, it should be trivial. At a minimum you should be using version control to automate much of this. These days I would start with either git or mercurial.

Any professional programmer should run away screaming in horror from a job that does not use version control in some fashion. It's something you need in your toolbox "RIGHT NOW". Distributed version control makes it very easy to just set up on your own and even if you can't get buy in from the group at least you can keep yourself sane.

Mercurial (hg) is easier to get started with IMHO than git, but git is probably the defacto standard. Create a github account for yourself and play around with some simple boring stuff to get a feel for it. Or try hg at bitbucket.com.

You don't need either site to use these programs effectively, but they do make it easier to get started.

Once you have version control in your toolbox, the next thing is to have a portable development environment. If you have anything like a reasonably powered laptop or workstation you should be able to completely duplicate the production environment of most web applications.

Using a tool like Vagrant can make this a simple as a single command to get a complete test environment up and running. It does take a fair amount of work, but this is the world many people are working in these days. The more you can learn about these tools, the more employable you'll be in the future.

  • Thank you for your insightful reply! I am learning to use git and would love to use it for my job. You mentioned setting up a local dev environment - I've installed XAMP however the domains and webapps I am working with have many many files -- pdf's, images, documents, etc. as part of their structure in addition to html/css/js/php files. If I replicate the server in my local environment I doubt I'd have adequate space. How do you manage that? I do occasionally need to upload new images / overwrite old ones and such so having access to them is important. – Prefix Nov 5 '13 at 0:12
  • Also -- there are several huge databases; should those be downloaded locally as well? I guess I'm just worried about ripping a copy of everything off the live server and then having to go through and fix all the code that references the live server/databases. This code has gone through a lot of hands so a lot of things are hardcoded, unfortunately. thanks for your help. – Prefix Nov 5 '13 at 0:15
  • Well, you can only do so much on your own. Places that duplicate the test environment generally have a lot of automation in place to make that easy. It's just important to know what is possible and how close you can get to that. Changing a whole organization is a big job, but you can control what you do and do that in an organized way. Even if you can't use it immediately at work, learning new tools is part of the job. If you haven't read "The Pragmatic Programmer", that's a great place to start. Put a single directory you're working in git and figure out how to use that in your workflow. – Fred the Magic Wonder Dog Nov 5 '13 at 15:08
  • Thank you very much for your input -- as a newbie developer it's great to learn from more experienced devs as to what I should prioritize learning! I will definitely pick up a copy of The Pragmatic Programmer. I have been experimenting with Git the last few days and am incorporating it into my workflow, although I'm not sure how much I can incorporate it into my current part time job. Ultimately I'd like to get to a point where I can have automation to take care of the repetitive copy/download/uploading! – Prefix Nov 5 '13 at 15:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.