Thread: How long do I have to.............

  1. #1
    www.entropysink.com
    Join Date
    Feb 2002
    Posts
    603

    How long do I have to.............

    Just out of interest (and partly to encourage / discourage me) how long does it take before C syntax becomes second nature. What I mean by this is that I have problems getting my ideas into a program 'cos the syntax gets in the way. It's difficult to get things to flow when you have to keep looking back at old source to remember where you put the #defines or {}'s or ;'s last time!

    I've been programming in C for 20 years and it's still a problem (only kidding, it's been around 6 months, but not solidly).
    Visit entropysink.com - It's what your PC is made for!

  2. #2
    the hat of redundancy hat nvoigt's Avatar
    Join Date
    Aug 2001
    Location
    Hannover, Germany
    Posts
    3,130
    Depends on you, but for me it took 2 to 3 years for it not to matter anymore. It just flows now...
    hth
    -nv

    She was so Blonde, she spent 20 minutes looking at the orange juice can because it said "Concentrate."

    When in doubt, read the FAQ.
    Then ask a smart question.

  3. #3
    www.entropysink.com
    Join Date
    Feb 2002
    Posts
    603
    Hmmmmm...... 2 1/2 years to go then!

    Did you find it equally frustrating? If I had any hair, I'd tear it out.

    (BTW, Thx for the reply)
    Last edited by RobR; 03-19-2002 at 01:56 PM.
    Visit entropysink.com - It's what your PC is made for!

  4. #4
    Registered User
    Join Date
    Jan 2002
    Location
    Vancouver
    Posts
    2,212
    I've been programming C on and off for about 5 years. That is, I started 5 years ago, but probably one or two of those years I skipped programming altogether. I still have trouble.

    Here are some common mistakes I make:

    Code:
    /* incorrect */
    if(a = 1)
    /* correct */
    if(a == 1)
    
    /* incorrect */
    int main(void);
    {
     ...
    }
    /* correct */
    int main(void)
    {
     ...
    }
    
    /* incorrect */
    int a == 1;
    /* correct */
    int a = 1;
    
    /* incorrect */
    if(a == 1);
    /* correct */
    if(a == 1)
    
    /* incorrect */
    printf("hey")
    /* correct */
    printf("hey");

    Semicolons are evil.

  5. #5
    www.entropysink.com
    Join Date
    Feb 2002
    Posts
    603
    Semicolons are evil.
    LOL - I've lost count of the number of times I've "thrown a few extra ones in" and let the compiler find them!
    Visit entropysink.com - It's what your PC is made for!

  6. #6
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    It took me about 2 years. There are still some C++ syntax issues that get confusing for me every now and then, but not often.

  7. #7
    Just one more wrong move. -KEN-'s Avatar
    Join Date
    Aug 2001
    Posts
    3,227
    With C it took me less than a year, but even now every once in a while I get syntax errors (barely ever) but even the most experienced coders can't avoid them.

  8. #8
    the hat of redundancy hat nvoigt's Avatar
    Join Date
    Aug 2001
    Location
    Hannover, Germany
    Posts
    3,130
    Well, it's not like I don't make mistakes anymore. But after some years, syntax itself is something that just happens to be the means to make the computer do what you want. Errors happen, but after a while, you spot them easier, and if you find them, it's more like "D'oh, how could I do that" instead of wondering why the compiler complains.

    Real knowledge about syntax comes when you think about building a compiler or interpreter. This is the time when you can predict syntax of things totally unknown to you. To some it may seem weird when you stand beside them looking at their screen, telling them that their script won't work that way without even knowing what language it is. And all you can explain about this is that "well... i don't know this language, but if I had build that syntax, you would get an error for that statement, because it would be a pain in the a## to implement the compiler if this were correct".
    hth
    -nv

    She was so Blonde, she spent 20 minutes looking at the orange juice can because it said "Concentrate."

    When in doubt, read the FAQ.
    Then ask a smart question.

  9. #9
    Registered User
    Join Date
    Feb 2002
    Posts
    589
    I Been doing this for two years on and off and I stil do the syntax blunders but it's not really because i don't know how to do it but more that they just slips buy. My biggest thing is that I have a hard time to remeberwhat all the getchar() printf() cin<< toupper and all that stuff do and what are there arguments. I always have atleast one book open when I am coding.

  10. #10
    l'Anziano DavidP's Avatar
    Join Date
    Aug 2001
    Location
    Plano, Texas, United States
    Posts
    2,743
    When I started learning C++ several years ago I had just come from a BASIC background, so the idea of semicolons was just plain weird to me.

    It took me a little bit to get used to them, but I'd say after a year, maybe a year and a half, semicolons were second nature.

    Of course all of us, whether of 5, 15, or 40 years, still miss the occasionall semicolon.
    My Website

    "Circular logic is good because it is."

  11. #11
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    It took me about two weeks to understand the usage of the syntax and about 6 or 7 months to get a real feel for the structure of the language. However, as nvoigt said, understanding how compilers break down syntax into machine language helps a great deal.

    -Prelude
    My best code is written with the delete key.

  12. #12
    Registered User
    Join Date
    Mar 2002
    Posts
    30

    BASIC

    > When I started learning C++ several years ago I had just come >from a BASIC background, so the idea of semicolons was just >plain weird to me.

    To me too: I couldn't understand why they want me to do only one statement in a line!? Now I know.
    BTW, does't not seem that ; approaches to : ? Its 'basic', anyway. More, they stay in the same position.

    The only problem with semicolon is when they are far right, so not visible in the editor.

    Does anyone know what 'a:=7' ?
    My first manual was Pascal. I read first two chapters before I got my first C++ DOS compiler. I forgot the book, and later, donated. Never reopened.


    >A horse is a horse. There is no excuse for Hungarian notation.

    Perfectly agree. I understand that a C++ compiler is case sensitive and there a less and less words for you to pick (they all gone for TradeMarks and domain names, so they protected :-) ), but to choose such a language that aliens won't waste time to learn, is pure ego(geocentr)ism. Maibe we are not alone in the universe, but we can sleep in tranquillity. They won't upgrade us to their OS, they'd wipe and repartition.
    Me, for myself, don't use sleeping pills, but Borland C++ Builder.

    Nice dreams and happy coding.
    Now I C.

  13. #13
    S­énior Member
    Join Date
    Jan 2002
    Posts
    982
    >Me, for myself, don't use sleeping pills, but Borland C++ Builder.

    Yeah, but possessing Borland products in my country carries a five year prison sentence. 12 if they can prove intent to supply.

  14. #14
    Registered User
    Join Date
    Mar 2002
    Posts
    30

    How come?!

    >Yeah, but possessing Borland products in my country carries a >five year prison sentence. 12 if they can prove intent to supply.

    What you mean?! What country do you live and what's da reason for it?


    Hoping you're joking
    Robert
    Now I C.

  15. #15
    S­énior Member
    Join Date
    Jan 2002
    Posts
    982
    >what's da reason for it?

    The lawmakers say Borland destroys the fabric of society and cause brain damage. However, there's an active underground market.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 15
    Last Post: 09-30-2008, 02:12 AM
  2. Having Buffer Problems With Overlapped I/O --
    By Sargera in forum C++ Programming
    Replies: 0
    Last Post: 02-07-2006, 04:46 PM
  3. Problem in Converting Unsigned long to String
    By cprogrammer_18 in forum C Programming
    Replies: 8
    Last Post: 01-14-2006, 08:57 AM
  4. Merge and Heap..which is really faster
    By silicon in forum C++ Programming
    Replies: 2
    Last Post: 05-10-2005, 04:06 PM
  5. Insertion Sort Problem
    By silicon in forum C++ Programming
    Replies: 1
    Last Post: 05-08-2005, 12:30 PM