C Syntax

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • C# Learner

    C Syntax

    Why is C syntax so uneasy on the eye?

    In its day, was it _really_ designed by snobby programmers to scare away
    potential "n00bs"? If so, and after 50+ years of programming research,
    why are programming languages still being designed with C's syntax?

    These questions drive me insane. Every waking minute...
  • Alex Moskalyuk

    #2
    Chinese Syntax

    Why is Chinese syntax so uneasy on the eye?

    In its day, was it _really_ designed by snobby linguists to scare away
    potential "n00bs"? If so, and after 5000+ years of civilization,
    why do Chinese people still using that funny syntax?

    These questions drive me insane. Every waking minute...


    Comment

    • Eric Sosman

      #3
      Re: C Syntax

      C# Learner wrote:[color=blue]
      > Why is C syntax so uneasy on the eye?
      >
      > In its day, was it _really_ designed by snobby programmers to scare away
      > potential "n00bs"? If so, and after 50+ years of programming research,
      > why are programming languages still being designed with C's syntax?
      >
      > These questions drive me insane. Every waking minute...[/color]

      If you want COBOL, you know where to find it.

      --
      Eric.Sosman@sun .com

      Comment

      • Mark A. Odell

        #4
        Re: C Syntax

        C# Learner <csharp@learner .here> wrote in
        news:uLRM6T2QEH A.3732@TK2MSFTN GP11.phx.gbl:
        [color=blue]
        > These questions drive me insane. Every waking minute...[/color]

        I would sleep more often then.



        --
        - Mark ->
        --

        Comment

        • Martin Ambuhl

          #5
          Re: C Syntax

          C# Learner wrote:
          [color=blue]
          > Why is C syntax so uneasy on the eye?[/color]

          Because it's so pretty. That it is "uneasy on [your] eye" is your
          problem. Not to worry; there's a solution for your problem. Jesus said
          it, and it appears three times in the Gospels:

          Matthew 5:29 And if thy right eye offend thee, pluck it out, and cast
          it from thee: for it is profitable for thee that one of thy members
          should perish, and not that thy whole body should be cast into hell.

          Matthew 18:9 And if thine eye offend thee, pluck it out, and cast it
          from thee: it is better for thee to enter into life with one eye, rather
          than having two eyes to be cast into hell fire.

          Mark 9:47 And if thine eye offend thee, pluck it out: it is better for
          thee to enter into the kingdom of God with one eye, than having two eyes
          to be cast into hell fire:

          Comment

          • Default User

            #6
            Re: C Syntax

            C# Learner wrote:[color=blue]
            >
            > Why is C syntax so uneasy on the eye?
            >
            > In its day, was it _really_ designed by snobby programmers to scare away
            > potential "n00bs"? If so, and after 50+ years of programming research,
            > why are programming languages still being designed with C's syntax?
            >
            > These questions drive me insane. Every waking minute...[/color]

            Go troll somebody else.

            *plonk*




            Brian Rodenborn

            Comment

            • C# Learner

              #7
              Re: Chinese Syntax

              Alex Moskalyuk wrote:
              [color=blue]
              > Why is Chinese syntax so uneasy on the eye?[/color]

              <snip>

              You make a perfectly valid counter-argument.

              I think we can conclude, then, that humans, in general, are a pretty
              /stupid/ species. Note that this is /not/ a shallow thought.

              Another example showing human stupidity, which is also related to
              natural languages, is the fact that there are /so many/ natural
              languages spoken by humans. Of cource, more than one natural language
              is redundant, and causes problems involved with translation.

              By the way, it's nice to see someone actually being able to provide a
              decent counter-argument on a newsgroup without having to resort to
              name-calling.

              Comment

              • Alex Moskalyuk

                #8
                Re: Chinese Syntax

                Have you ever looked into Perl or Lisp code?

                C suddenly starts making perfect sense.

                What's uneasy to you? Curly braces, parentheses, keywords, or something
                else?


                --
                Alex Moskalyuk
                _______________ ______________


                "C# Learner" <csharp@learner .here> wrote in message
                news:O2Jgg82QEH A.3728@TK2MSFTN GP10.phx.gbl...[color=blue]
                > Alex Moskalyuk wrote:
                >[color=green]
                > > Why is Chinese syntax so uneasy on the eye?[/color]
                >
                > <snip>
                >
                > You make a perfectly valid counter-argument.
                >
                > I think we can conclude, then, that humans, in general, are a pretty
                > /stupid/ species. Note that this is /not/ a shallow thought.
                >
                > Another example showing human stupidity, which is also related to
                > natural languages, is the fact that there are /so many/ natural
                > languages spoken by humans. Of cource, more than one natural language
                > is redundant, and causes problems involved with translation.
                >
                > By the way, it's nice to see someone actually being able to provide a
                > decent counter-argument on a newsgroup without having to resort to
                > name-calling.[/color]


                Comment

                • Martin Dickopp

                  #9
                  [OT] Re: Chinese Syntax

                  C# Learner <csharp@learner .here> writes:
                  [color=blue]
                  > By the way, it's nice to see someone actually being able to provide a
                  > decent counter-argument on a newsgroup without having to resort to
                  > name-calling.[/color]

                  While your original flamebait wasn't particularly an example of decency
                  on your part, at least have the decency to stop posting off-topic *now*,
                  please.

                  If you really believe that the intention of Alex' reply was to start
                  an elaborate discussion about the Chinese language in comp.lang.c,
                  I recommend that you stay off Usenet until you have learned to pick up
                  hints.

                  Off-topic, therefore Followup-To: poster.

                  Martin


                  --
                  ,--. Martin Dickopp, Dresden, Germany ,= ,-_-. =.
                  / ,- ) http://www.zero-based.org/ ((_/)o o(\_))
                  \ `-' `-'(. .)`-'
                  `-. Debian, a variant of the GNU operating system. \_/

                  Comment

                  • C# Learner

                    #10
                    Re: Chinese Syntax

                    Alex Moskalyuk wrote:
                    [color=blue]
                    > Have you ever looked into Perl or Lisp code?
                    >
                    > C suddenly starts making perfect sense.
                    >
                    > What's uneasy to you? Curly braces, parentheses, keywords, or something
                    > else?[/color]

                    One of the biggest flaws in C syntax, in my opinion, is the required
                    parentheses for test conditions.

                    Here's a very simple example:

                    void Foo
                    {
                    if (FooBar(Parse(P rocess(GetInput ())))
                    DoSomething();
                    }

                    Imagine if, instead, we could write the following:

                    void Foo
                    {
                    if FooBar(Parse(Pr ocess(GetInput( ))):
                    DoSomething();
                    }

                    Python uses such a construct for test conditions.

                    Another nicety about Python is the fact that whitespace is used for
                    defining code blocks. This makes code much clearer than the equivalent
                    C code, which requires block being/end markers.

                    Here's a very simple Python code sample:
                    http://www.kernelthread.com/hanoi/html/py.html .

                    Try staring at it for one minute.

                    After having done so, take a look at this:
                    http://www.kernelthread.com/hanoi/html/c.html .

                    Even if one's accustomed to C syntax, the former is still clearer and
                    easier-to-read, don't you think?

                    Every time I see code that conforms to C's basic syntax, I cringe; yet I
                    write such code every day.

                    Why C? Why?!

                    Comment

                    • Lew Pitcher

                      #11
                      Re: C Syntax

                      -----BEGIN PGP SIGNED MESSAGE-----
                      Hash: SHA1

                      Eric Sosman wrote:
                      | C# Learner wrote:
                      |
                      |> Why is C syntax so uneasy on the eye?
                      |>
                      |> In its day, was it _really_ designed by snobby programmers to scare
                      |> away potential "n00bs"? If so, and after 50+ years of programming
                      |> research, why are programming languages still being designed with C's
                      |> syntax?
                      |>
                      |> These questions drive me insane. Every waking minute...
                      |
                      |
                      | If you want COBOL, you know where to find it.
                      |

                      I resemble that remark! :-)

                      FWIW, if you want a computer language that's really "uneasy on the eye", try
                      APL or RPG2. Even Lisp isn't very easy to read.

                      OTOH, I've had to read through pages of Java recently (analysis and design of
                      a new web component for my corporate masters, requiring review of our current
                      j2ee web apps), and if Java is the new "readabilit y", then give me C any day.
                      Worse spaghetti code than you could find in any assembly program. I have no
                      doubt that C# and C++ are just as bad.




                      - --
                      Lew Pitcher

                      Master Codewright & JOAT-in-training | GPG public key available on request
                      Registered Linux User #112576 (http://counter.li.org/)
                      Slackware - Because I know what I'm doing.
                      -----BEGIN PGP SIGNATURE-----
                      Version: GnuPG v1.2.4 (GNU/Linux)
                      Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

                      iD8DBQFAtS6VagV FX4UWr64RAi+RAK CnP8xUHTt6WJpuc gZ6Aq6E1fmMoQCg ndgX
                      eofd4o3IJyR9thm ZlRXZwPg=
                      =PX6r
                      -----END PGP SIGNATURE-----

                      Comment

                      • Justin Rogers

                        #12
                        Re: Chinese Syntax

                        As a long time programmer of many languages I've always found the explicit
                        statement bounding in C to be quite nice. For me it improves readability as
                        my seasoned internal tokenizer is capable of finding code blocks more quickly
                        by using the braces and parenthesis than by scanning whitespace. Whitespace
                        also breaks down quite fast when you start using non fixed width fonts and
                        mixing tabs and spaces. Arguably you could say, don't do that, but at least
                        with something of the nature of C and it's explit block scoping you can easily
                        write a pretty printer and avoid any ambiguity that would otherwise exist.

                        Take the following excerpt from a Python tutorial:
                        Tuple syntax

                        From a syntax viewpoint, you create a tuple by placing a sequence of items
                        inside a pair of enclosing parentheses and separating them by commas. Note that
                        the parentheses can be omitted when such omission will not lead to ambiguity.

                        Note that they point out you can leave out parens only when it won't lead to
                        ambiguity. C doesn't make that mistake. They make sure there is no ambiguity,
                        and if you leave out a parens it doesn't make the statement ambiguous, it makes
                        it
                        a different or erroneous statement altogether.


                        --
                        Justin Rogers
                        DigiTec Web Consultants, LLC.
                        Blog: http://weblogs.asp.net/justin_rogers


                        "C# Learner" <csharp@learner .here> wrote in message
                        news:euOxH13QEH A.3744@TK2MSFTN GP10.phx.gbl...[color=blue]
                        > Alex Moskalyuk wrote:
                        >[color=green]
                        > > Have you ever looked into Perl or Lisp code?
                        > >
                        > > C suddenly starts making perfect sense.
                        > >
                        > > What's uneasy to you? Curly braces, parentheses, keywords, or something
                        > > else?[/color]
                        >
                        > One of the biggest flaws in C syntax, in my opinion, is the required
                        > parentheses for test conditions.
                        >
                        > Here's a very simple example:
                        >
                        > void Foo
                        > {
                        > if (FooBar(Parse(P rocess(GetInput ())))
                        > DoSomething();
                        > }
                        >
                        > Imagine if, instead, we could write the following:
                        >
                        > void Foo
                        > {
                        > if FooBar(Parse(Pr ocess(GetInput( ))):
                        > DoSomething();
                        > }
                        >
                        > Python uses such a construct for test conditions.
                        >
                        > Another nicety about Python is the fact that whitespace is used for
                        > defining code blocks. This makes code much clearer than the equivalent
                        > C code, which requires block being/end markers.
                        >
                        > Here's a very simple Python code sample:
                        > http://www.kernelthread.com/hanoi/html/py.html .
                        >
                        > Try staring at it for one minute.
                        >
                        > After having done so, take a look at this:
                        > http://www.kernelthread.com/hanoi/html/c.html .
                        >
                        > Even if one's accustomed to C syntax, the former is still clearer and
                        > easier-to-read, don't you think?
                        >
                        > Every time I see code that conforms to C's basic syntax, I cringe; yet I
                        > write such code every day.
                        >
                        > Why C? Why?![/color]


                        Comment

                        • C# Learner

                          #13
                          Re: [OT] Re: Chinese Syntax

                          ["Followup-To:" to to microsoft.publi c.dotnet.langua ges.csharp]

                          Martin Dickopp wrote:
                          [color=blue]
                          > C# Learner <csharp@learner .here> writes:
                          >[color=green]
                          >>By the way, it's nice to see someone actually being able to provide a
                          >>decent counter-argument on a newsgroup without having to resort to
                          >>name-calling.[/color]
                          >
                          > While your original flamebait[/color]

                          My intention was /not/ to start a flame war, but to start a healthy
                          discussion on the subject of C and why its basic syntax is present in so
                          many modern programming languages.

                          If I had asked that question simply and directly, I doubt that many
                          would've given it a second thought. This is unfortunate detail to keep
                          in mind when posting to USENET, or other such Internet forums. There
                          needs to be a little spice to get a discussion going. This is what was
                          provided by myself in my thread-starter.
                          [color=blue]
                          > wasn't particularly an example of decency
                          > on your part, at least have the decency to stop posting off-topic *now*,
                          > please.[/color]

                          Oh, now that Martin's joined the fray, we're no longer allowed to
                          continue a discussion which has a sub-thread which is /ever so slightly/
                          off-topic. Hmph.
                          [color=blue]
                          > If you really believe that the intention of Alex' reply was to start
                          > an elaborate discussion about the Chinese language in comp.lang.c,[/color]

                          Please take the time to /read/ the messages you're replying to. My
                          reply only just touches on the subject of the Chinese language. My
                          intention was /not/ to start an elaborate discussion about the Chinese
                          language.
                          [color=blue]
                          > I recommend that you stay off Usenet until you have learned to pick up
                          > hints.[/color]


                          [color=blue]
                          > Off-topic, therefore Followup-To: poster.[/color]

                          I have no intention to e-mail my reply directly to you, so I disregarded
                          that follow-up. From the tone of your reply, it seems that had I given
                          you my e-mail address, I'd be harassed!

                          I've set follow-ups to microsoft.publi c.dotnet.langua ges.csharp, since
                          people in there are cool. However, my experience has shown that the
                          people in comp.lang.c, on the other hand, are a bunch of snobby a*******s!

                          I've posted in that group before and I got flamed in reply almost every
                          time. I also lurk in that group and notice that even regulars get
                          /regularly/ flamed there, for little or no reason.

                          Yeah, yeah, call me a troll. Whatever. This is my opinion, and you
                          asked for it by /flaming/ me.

                          Anyway, as I said, I'm not going to e-mail you, and may well proceed to
                          plonk you due to your heavy-handedness and your apparent snobby attitude.

                          Goodbye.

                          Comment

                          • Lew Pitcher

                            #14
                            [OT] Re: C Syntax

                            -----BEGIN PGP SIGNED MESSAGE-----
                            Hash: SHA1

                            C# Learner wrote:
                            | Why is C syntax so uneasy on the eye?

                            I would disagree with that assertion; I do not find C syntax "uneasy on the eye".

                            | In its day, was it _really_ designed by snobby programmers to scare away
                            | potential "n00bs"?

                            "It's day" is hardly over, and the designers of C had other things on their
                            minds than attempting to scare away neophytes.

                            | If so, and after 50+ years of programming research,
                            | why are programming languages still being designed with C's syntax?

                            Perhaps because it works?

                            | These questions drive me insane. Every waking minute...

                            These are trivialities. Learn five or six computer languages (or three or four
                            that are entirely unrelated to each other), /then/ formulate your opinion.

                            Just remember, the computer doesn't care what language the program is written
                            in; it's all machine language to the CPU. Computer 'language' is for /human/
                            consumption, and is designed to meet the needs of the programmer and his/her
                            environment. Some languages are exceedingly suscinct (i.e. APL or RPG), and
                            some are very verbose (i.e. COBOL, SNOBOL, PL/I, Assembly (any processor)).
                            Some languages are procedural, some are OO, some are list processors, some are
                            macro languages. Learn a few, see what they do and where they are used.

                            Only then can you conduct a reasonable conversation on the topic.

                            - --
                            Lew Pitcher

                            Master Codewright & JOAT-in-training | GPG public key available on request
                            Registered Linux User #112576 (http://counter.li.org/)
                            Slackware - Because I know what I'm doing.
                            -----BEGIN PGP SIGNATURE-----
                            Version: GnuPG v1.2.4 (GNU/Linux)
                            Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

                            iD8DBQFAtTl+agV FX4UWr64RAntoAJ 9pk9dL4gzdc9Vk5 6pcIDMtV7yj4gCf Y7k0
                            sTaxl6obapbLPdS 7z9Hy6HI=
                            =jJJD
                            -----END PGP SIGNATURE-----

                            Comment

                            • C# Learner

                              #15
                              Re: [OT] Re: C Syntax

                              Lew Pitcher wrote:

                              [...]
                              [color=blue]
                              > | In its day, was it _really_ designed by snobby programmers to scare away
                              > | potential "n00bs"?
                              >
                              > "It's day" is hardly over, and the designers of C had other things on their
                              > minds than attempting to scare away neophytes.[/color]

                              By "its day" ("it's day" is grammatically incorrect, by the way), I
                              actually meant the days around which it was designed. I phrased it
                              incorrectly -- my mistake.

                              [...]
                              [color=blue]
                              > | These questions drive me insane. Every waking minute...
                              >
                              > These are trivialities. Learn five or six computer languages (or three
                              > or four
                              > that are entirely unrelated to each other), /then/ formulate your opinion.[/color]

                              Well, I have learned BASIC, C-like languages (C and C++), Delphi
                              (formerly named 'Object Pascal') and Smalltalk.

                              So, basically, I've learned a couple of procedural languages, and a
                              couple of OO ones.
                              [color=blue]
                              > Just remember, the computer doesn't care what language the program is
                              > written
                              > in; it's all machine language to the CPU. Computer 'language' is for
                              > /human/
                              > consumption, and is designed to meet the needs of the programmer and
                              > his/her
                              > environment.[/color]

                              Exactly -- and this is why I see high-level language syntax to be so
                              important.

                              I feel that popular, modern-day high-level languages are tainted by a
                              specific syntax that has carried over through decades, one which I feel
                              is somewhat inhibitive. I feel it's inhibitive in the sense that code
                              written in it needs to conform to a syntax that could be nicer, and make
                              for easier-to-read source code.
                              [color=blue]
                              > Some languages are exceedingly suscinct (i.e. APL or RPG), and
                              > some are very verbose (i.e. COBOL, SNOBOL, PL/I, Assembly (any processor)).
                              > Some languages are procedural, some are OO, some are list processors,
                              > some are
                              > macro languages. Learn a few, see what they do and where they are used.
                              >
                              > Only then can you conduct a reasonable conversation on the topic.[/color]

                              I don't understand why I'd need to learn a few more languages to
                              understand that C's basic syntax could be nicer.

                              Comment

                              Working...