error C2106: '=' : left operand must be l-value

This is a discussion on error C2106: '=' : left operand must be l-value within the C Programming forums, part of the General Programming Boards category; Originally Posted by brewbuck Indentation should be taught. I object to the idea of "failing" students for bad indentation at ...

  1. #16
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Posts
    22,915
    Quote Originally Posted by brewbuck View Post
    Indentation should be taught. I object to the idea of "failing" students for bad indentation at beginning levels. Are we deliberately trying to discourage people from persevering?
    I approve to this idea. However, this is in regards to that indentation is taught as a part of class. If a student doesn't indent at all, and indentation was indeed a part of the class, then I would fail that one.
    I wouldn't fail someone for having bad indentation, but for someone lacking it completely and utterly, I certainly would.

    But this calls for another "indent automatically" features available in IDEs such as Visual Studio. Default indentation is better than nothing.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  2. #17
    Registered User
    Join Date
    Sep 2006
    Posts
    835
    > And some people played the piano at age 2.

    I seriously doubt that anyone who takes years to figure out that when writing code with several nesting levels, it helps to keep track of where one is, is ever going to be good at programming. Being sloppy like that is going to prevent success at any kind of complicated detail-oriented work.

    > I object to the idea of "failing" students for bad indentation at beginning levels.

    I agree with this. But for the reason above, I think if the students can't figure it out for themselves in a fairly short time, they'll do badly anyway.

  3. #18
    and the hat of sweating
    Join Date
    Aug 2007
    Location
    Toronto, ON
    Posts
    3,545
    I don't know if I'd straight out fail a student for bad (or no) indenting, but I'd definitely take a lot of marks off. I have to wonder though... if students don't indent at all, wouldn't that indicate a lack of proper indenting being taught in class?

    I know different people have different personalities. Some people are very meticulous and precise about everything they do (which I think makes for really good QA and Developers), while others have the attention span of a turnip and do everything in a half ass way; and no amount of lecturing is going to change their core personality traits. The best we can do is teach them all the best practices, and explain why they should do something a certain way; then hope that the message sticks with most of the students.

  4. #19
    Registered User
    Join Date
    Sep 2006
    Posts
    835
    I don't think a professor should take marks off for indenting, unless the student was being required to demonstrate a particular style of indenting as part of an assignment (and the most common styles should be taught at some point). But I think a prospective employer could reasonably assume that poorly indented code showed a lack of aptitude, and make a quick no-hire decision for that reason - similar to having a resume full of spelling and grammatical errors.

  5. #20
    and the hat of sweating
    Join Date
    Aug 2007
    Location
    Toronto, ON
    Posts
    3,545
    Quote Originally Posted by robatino View Post
    I don't think a professor should take marks off for indenting, unless the student was being required to demonstrate a particular style of indenting as part of an assignment (and the most common styles should be taught at some point). But I think a prospective employer could reasonably assume that poorly indented code showed a lack of aptitude, and make a quick no-hire decision for that reason - similar to having a resume full of spelling and grammatical errors.
    That's assuming the employer asks to see some code they've written before hiring them.
    Why not teach them proper indenting sooner rather than later? Then they have less time to pick up bad habits. Code readability is just as important as functionality and therefore I would definitely take marks off for bad indenting; and if they're using a proper IDE, there's absolutely no excuse for incorrect indenting.

  6. #21
    Captain Crash brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,263
    Quote Originally Posted by robatino View Post
    > And some people played the piano at age 2.

    I seriously doubt that anyone who takes years to figure out that when writing code with several nesting levels, it helps to keep track of where one is, is ever going to be good at programming. Being sloppy like that is going to prevent success at any kind of complicated detail-oriented work.
    It didn't take me years to learn to indent. But it took over a decade to decide on a complete style, as well as a complete rationale for that style.

    I agree with this. But for the reason above, I think if the students can't figure it out for themselves in a fairly short time, they'll do badly anyway.
    This assumes that computer programming and computer science are somehow inextricably linked to indentation. There are plenty of languages where indentation is meaningless. It's a property of specific languages, not the concept of programming in general.

  7. #22
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Posts
    22,915
    Quote Originally Posted by cpjust View Post
    That's assuming the employer asks to see some code they've written before hiring them.
    Why not teach them proper indenting sooner rather than later? Then they have less time to pick up bad habits. Code readability is just as important as functionality and therefore I would definitely take marks off for bad indenting; and if they're using a proper IDE, there's absolutely no excuse for incorrect indenting.
    Indeed. I couldn't have phrased it better.
    Code readability is absolutely important in today's market, so indentation should really be taught as a part of class. I mean, if you submit absolutely unindented code, how the heck is the professor supposed to read it!? If you've been taught indentation, there's absolutely no excuse for ignoring it and being part of the course, of course it will points of your final degree if you fail at it. And if there's no indentation at all, then you fail a part of the course completely and that hurts your degree a lot.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  8. #23
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Quote Originally Posted by robatino View Post
    I don't think a professor should take marks off for indenting, unless the student was being required to demonstrate a particular style of indenting as part of an assignment (and the most common styles should be taught at some point). But I think a prospective employer could reasonably assume that poorly indented code showed a lack of aptitude, and make a quick no-hire decision for that reason - similar to having a resume full of spelling and grammatical errors.
    Actually, when I studied C in a Univerisity course some 15 or more years back, part of the lab-work score was based on proper style - it didn't HAVE to be as it was described in the university style guide, but it had to be consistently styled.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  9. #24
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    22,165
    This assumes that computer programming and computer science are somehow inextricably linked to indentation. There are plenty of languages where indentation is meaningless. It's a property of specific languages, not the concept of programming in general.
    I think that it is true that indentation is a property of specific languages (e.g., Python), a convention in others (e.g., C), and meaningless in yet others. On the other hand, whether as feature or as convention, indentation is linked to the idea of scope, and scope is an important concept in computer programming.
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  10. #25
    Registered User
    Join Date
    Sep 2006
    Posts
    835
    Quote Originally Posted by Elysia View Post
    Indeed. I couldn't have phrased it better.
    Code readability is absolutely important in today's market, so indentation should really be taught as a part of class. I mean, if you submit absolutely unindented code, how the heck is the professor supposed to read it!? If you've been taught indentation, there's absolutely no excuse for ignoring it and being part of the course, of course it will points of your final degree if you fail at it. And if there's no indentation at all, then you fail a part of the course completely and that hurts your degree a lot.
    I think assignment code should always be submitted as actual source files, not as a printout. That way, the teacher can automatically indent the code in any desired style, not to mention being able to immediately compile and run it.

  11. #26
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Posts
    22,915
    Of course it should be submitted as source files, but would you want to sit there indenting all the code from your students because they didn't indent at all?
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  12. #27
    Registered User
    Join Date
    Feb 2008
    Posts
    2
    Thank you all for the replies and good advices.They have been very useful.

  13. #28
    and the hat of sweating
    Join Date
    Aug 2007
    Location
    Toronto, ON
    Posts
    3,545
    Quote Originally Posted by Elysia View Post
    Of course it should be submitted as source files, but would you want to sit there indenting all the code from your students because they didn't indent at all?
    That's one of the reasons I'd take marks off. If I have to fix their indenting, they're wasting my time, and considering most teachers have dozens or possibly hundreds of students in all their classes, they can't afford to waste too much time when grading assignments.

  14. #29
    Registered User
    Join Date
    Nov 2006
    Location
    japan
    Posts
    126

    manually?

    I understand the importance of indentation. And completely agree with Laserlight.
    but...
    Quote Originally Posted by Elysia View Post
    Of course it should be submitted as source files, but would you want to sit there indenting all the code from your students because they didn't indent at all?
    As far as I know ... now a days the program does it for you. just with one click!. (for example XCode )
    lol.
    Mac OS 10.6 Snow Leopard : Darwin

  15. #30
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Posts
    22,915
    Quote Originally Posted by nacho4d View Post
    As far as I know ... now a days the program does it for you. just with one click!. (for example XCode )
    lol.
    And thank goodness for that! We don't have to manually indent poor indented source
    But that doesn't mean you should get away with not indenting properly... especially since it causes bugs!
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

Page 2 of 3 FirstFirst 123 LastLast
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Odd 3D Invis Objects?
    By Zeusbwr in forum Game Programming
    Replies: 4
    Last Post: 12-07-2004, 07:01 PM
  2. Binary Search Trees Part III
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 10-02-2004, 04:00 PM
  3. pointer to array of objects of struct
    By undisputed007 in forum C++ Programming
    Replies: 12
    Last Post: 03-02-2004, 04:49 AM
  4. Request for comments
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 15
    Last Post: 01-02-2004, 10:33 AM
  5. Please help me
    By teedee46 in forum C++ Programming
    Replies: 9
    Last Post: 05-07-2002, 12:28 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21