Slashdot Mirror


As Languages Evolve...

naph writes "It seems that as programming languages have developed there has been a steady increase in the level of abstraction they use. Early languages were all very low-level, but successive generations have become higher and higher. Is this trend going to continue, or do you think we've reached a kind of happy medium between power and abstraction? Would developers prefer higher level languages, or is the direct control of things good? I was just wondering what other developers out there thought of this."

2 of 81 comments (clear)

  1. Tools by Trusty+Penfold · · Score: 5, Insightful


    When it comes to languages, the answer is use the right tool for the job. Low level languages will always coexist with high level ones.

  2. Doesn't seem all that evolved to me... by vsync64 · · Score: 5, Insightful

    Early languages were all very low-level, but
    successive generations have become higher and
    higher.

    I don't buy this. Explain why Common Lisp lets
    me do this, for example:

    (defparameter *settings-file-location*
    (make-pathname :directory '(:absolute "etc" "monkey")
    :name "settings"
    :type "conf"))

    (defun save-settings ()
    (with-open-file (settings-file *settings-file-location*
    :if-does-not-exist :create
    :if-exists :rename
    :direction :output)
    (prin1 *settings*))

    Java, 18 years later, requires code like the
    following to approach the functionality of the
    previous snippet:

    /* We have to shove EVERYTHING into a class.
    A singly-inherited one, no less. */
    class Settings {
    static File settingsFile = new File("etc" + File.separator +
    "monkey" + File.separator +
    "settings.conf");
    // is static initialization order even guaranteed?
    static File settingsFileBackup = new File(settingsFile.getName() +
    ".bak");

    public void saveSettings() {
    boolean backedUpSettings = false;

    if (settingsFile.exists()) { // get the old one out of the way
    settingsFile.renameTo(settingsFileBackup);
    backedUpSettings = true;
    }

    FileOutputStream fow;
    BufferedOutputStream bow;
    try {
    fow = new FileOutputStream(settingsFile);
    bow = new BufferedOutputStream(fow);
    dumpSettings(bow);
    close(bow);
    } catch (Exception e) {
    if (bow && fow.getFD().valid()) {
    close(bow); // file descriptors aren't garbage collected
    }
    // now put back the old file
    if (backedUpSettings) {
    settingsFileBackup.renameTo(settingsFile);
    }
    }
    }
    }

    Note that this Java code loses on systems like
    Mac OS, which store the file type somewhere
    besides the filename.

    Or how about Common Lisp's condition system,
    which allows execution to actually continue
    where it left off once an error is corrected?
    What about MAPCAR, or DO and DO*? Heck, what
    about first-class function objects?

    Of course, try getting a job using Common Lisp,
    or any other decently abstracted general-purpose
    programming language today...

    BTW, Slashdot inserted the spurious semicolons
    in this post, not me.

    --
    TO BUY A NEW CAR WOULD MAKE YOU SEXUALLY ATTRACTIVE.