Question:

Why does C code look like an alien language?

by  |  earlier

0 LIKES UnLike

It just struck me as strange that C code is so unreadable where as Cobol and Fortran and Basic are easier to read. Why does C code look

so strange and why is it to cryptic?

 Tags:

   Report

5 ANSWERS


  1. Because C is a lower level language, and therefore more efficient.  Higher level languages are more easily understood by humans, but lower level languages are generally faster.  Take a look at assembler for an idea of how unintelligible code can get.


  2. Every programming language has its own way of doing things, but C is designed to get to the point with less words, especially since computer programming needs more and more complex lines of codes, and the long way isn't cutting it, although to shorten it might need more brains and training. To put it another way, C++'s:

    #include <iostream>

    int main()

    {std::cout << "Hello, world!";}

    is MUCH shorter than COBOL's:

    IDENTIFICATION DIVISION.

           PROGRAM-ID. HELLO-WORLD.

           ENVIRONMENT DIVISION.        

           DATA DIVISION.

           PROCEDURE DIVISION.

           MAIN.

               DISPLAY 'Hello, world.'.

               STOP RUN.

    I guess people in the 50s didn't think so far ahead =).

    If you still didn't quite understand, let's say if I were to turn on a light switch, which one would be quicker to type, at the expense of being a bit harder to read?

    LIGHT ON

    Consult brain

    If on, don't switch.

    If off, move hand > switch > turn on.

    OR

    ENVIRONMENT DIVISION

    See light.

    Data:

    Figure out if light is on or not.

    Determine if it is on.

    Procedures:

    Choice 1: Light is on. What should I do?

    keep it on or turn it off.

    GOTO data division, figure out if it's on.

    The light should stay on.

    Choice 2: Light is off. What should I do?

    keep it off or turn it on.

    GOTO data devision, should I turn it on?

    yes.

    How should I turn it on?

    Move your hands to the switch and turn it on.

    Same thing with Fortran. However, BASIC is a bit more user-friendly, but it uses almost the same code as C++ to get the job of more complicated stuff done.

  3. Cryptic? It isn't cryptic - also, scripting languages are supposed to look unreadable :)

  4. it doesnt.

    regular text editor cant read it becuase theyre commands.

    get yourself a c programmer and u will see all the codes instad of giberrish

  5. its not unreadable hehe

    just really hard to learn lol

    i think that c might aswell be a type of goldenburg machine it overcomplicates everything  ;)

Question Stats

Latest activity: earlier.
This question has 5 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.
Unanswered Questions