MacTech Network:   MacTech Forums  |  MacForge.net  |  Computer Memory  |  Register Domains  |  Cables  |  iPod Deals  | Mac Deals  | Mac Book Shelf


  MacTech Magazine

The journal of Macintosh technology

 
 

Magazine In Print
  About MacTech  
  Home Page  
  Subscribe  
  Archives DVD  
  Submit News  
  MacTech Forums  
  Get a copy of MacTech RISK FREE  
MacTech Only Search:
Community Search:
MacTech Central
  by Category  
  by Company  
  by Product  
MacTech News
  MacTech News  
  Previous News  
  MacTech RSS  
Article Archives
  Show Indices  
  by Volume  
  by Author  
  Source Code FTP  
Inside MacTech
  Writer's Kit  
  Editorial Staff  
  Editorial Calendar  
  Back Issues  
  Advertising  
Contact Us
  Customer Service  
  MacTech Store  
  Legal/Disclaimers  
  Webmaster Feedback  
 Get Netflix

 October 2001 Programmer's Challenge

Programmer’s Assistant

Mail solutions to: progchallenge@mactech.com
Due Date: 11:59pm ET, Sunday, 7 October 2001

How often has this happened to you? You’re working on a piece of code, perhaps even a piece of Challenge code, you add a couple of lines, you compile, and you get some bizarre error. Something nothing near where you were editing. Perhaps an "Illegal function definition …" in a routine you weren’t even working on. And then you realize, eventually if you are slow, or immediately if you are less slow, that you added an "if (condition) {" statement and omitted the closing brace. Or some other simple syntax error.

Well, I happen to think that computers ought to be able to help us with this. My editor ought to do more to help me avoid mistakes. Yes, I know that some editors will balance parentheses for you, assuming you remembered to type the closing paren. But I want more. And this month’s Challenge asks you to write such an editor for C/C++.

The first required feature is auto-completion of key words and user-defined names. For example, if I have defined variables "loop_index" and "loop_counter", then, after I type enough characters to uniquely identify a variable name (e.g., "loop_i"), my programmer’s assistant should supply the remaining letters "ndex". The automatically supplied characters should be selected so that they are replaced in the event I continue typing. As a highly desirable optional feature, the assistant should offer me an auto-completion key (e.g., the option key, or a menu item with a keyboard equivalent), which, when pressed, offers me a popup menu of possible completions for the word currently being typed, even when the completion is not uniquely identified.

The second required feature is auto-completion of syntactic elements. If I start a conditional by typing "if", my programmer’s assistant should, when prompted by an auto-completion key, complete the conditional by inserting parentheses, braces, and an "else" clause, leaving something like this:

if () {
} else {
}

In this example, the cursor ought to be left between the parentheses, so that I can insert the conditional. You ought to provide some convenient way for me to move the cursor from the conditional (between the parentheses) to the TRUE branch (between the first pair of braces) to the FALSE branch (between the second pair of braces).

You would provide similar auto-completion for while loops, do loops, for loops:

while () {
}

for ( ; ; ) {
}

do {
} while ();

Other required auto-completions include case statements, struct declarations, enum declarations, and function declarations. Additional auto-completion features may be incorporated at your option. Other options (e.g., indentation styles) will also earn extra feature points.

A significant amount of extra consideration will be given to any solution that allow support for other languages, through use of a configuration file, provided such a configuration file is provided for C/C++ and at least one other language.

This will be a native PowerPC Challenge, using any of the following environments: CodeWarrior, REALbasic (version 3.2.1 or earlier), MetaCard (version 2.3.2 or earlier), Revolution (version 1.0), or Project Builder. You may use another development environment if I can arrange to obtain a copy — email progchallenge@mactech.com to check before you use something else. You can develop for Mac OS 9 or Mac OS X. This will be another Challenge based on a subjective evaluation of which entry best satisfies the required features, provides the most attractive set of optional features, and provides the best general usability and look-and-feel. Your solution should be a complete Macintosh application, so there is no prototype and no test code for this Challenge. Your submission should provide everything needed to build your application, as well as documentation of the features you have implemented, to ensure that I don’t overlook anything.


There is no test code needed for this Challenge. You are to build a complete application.


You can get a head start on the Challenge by reading the Programmer's Challenge mailing list. It will be posted to the list on or before the 12th of the preceding month. To join, send an email to listserv@listmail.xplain.com with the subject "subscribe challenge-A". You can also join the discussion list by sending a message with the subject "subscribe challenge-D".





Generate a short URL for this page:


Click on the cover to
see this month's issue!

TRIAL SUBSCRIPTION
Get a RISK-FREE subscription to the only technical Mac magazine!

Today's Deal


Apple Special

Order
Snow Leopard,
Mac Box Set, Family Pack,
and Snow Leopard Server
at a discount.
 


MacTech Magazine. www.mactech.com
Toll Free 877-MACTECH, Outside US/Canada: 805-494-9797

Register Low Cost (ok dirt cheap!) Domain Names in the MacTech Domain Store. As low as $1.99!
Save on long distance * Upgrade your Computer. See local info about Westlake Village
appleexpo.com | bathjot.com | bathroomjot.com | bettersupplies.com | comclothing.com | computerlunatics.com | dotcomclothing.com | explainit.com | exposinternational.com | homeismycastle.com | hoodcards.com | intlexpo.com | keyinfocard.com | kosheru.com | learnmorsels.com | localdealcards.com | lvschools.com | macjobsearch.com | mactechjobs.com | mactechmonitor.com | mactechsupplies.com | macwishbook.com | movie-depot.com | netprofessional.com | nibblelearning.com | notesintheshower.com | officejot.com | onlinebigbox.com | palmosdepot.com | peopleslineitemveto.com | showerjot.com | snapestore.com | snapishop.com | snapistore.com | snaptradingpost.com | stimulusmap.com | stimulusroadmap.com | triunfoguides.com | video-depot.com
Staff Site Links



All contents are Copyright 1984-2008 by Xplain Corporation. All rights reserved.

MacTech is a registered trademark of Xplain Corporation. Xplain, Video Depot, Movie Depot, Palm OS Depot, Explain It, MacDev, MacDev-1, THINK Reference, NetProfessional, NetProLive, JavaTech, WebTech, BeTech, LinuxTech, Apple Expo, MacTech Central and the MacTutorMan are trademarks or service marks of Xplain Corporation. Sprocket is a registered trademark of eSprocket Corporation. Other trademarks and copyrights appearing in this printing or software remain the property of their respective holders.