about code tags

This is a discussion on about code tags within the C++ Programming forums, part of the General Programming Boards category; here's my opinion...: (in other words, don't sue if anything bad happens resulting from my birth and onward) i understand ...

  1. #1
    Just because ygfperson's Avatar
    Join Date
    Jan 2002
    Posts
    2,493

    about code tags

    here's my opinion...: (in other words, don't sue if anything bad happens resulting from my birth and onward)

    i understand the concern over this. but is it really gonna do anything? most fairly anonymous users (or those that have >20 post counts) don't read the sticky posts. or they may read it afterwords after they post the code. or they may not care anyway. some don't even make an effort to spell correctly.

    i would suggest some kind of automatic code tagging system which works sorta-like the bad-language filter. but that's prone to errors because of the many ways people post code. ie:
    Code:
    #include <iostream>
    
    int main() {
    cout << blah << endl;
    }
    ignoring the include statement, there's the main function. maybe a script could isolate something starting with a bracket until it ends the bracket. but this would ignore the fact that there are many other functions, all which would be enclosed in these tags seperately. most of the time when people post code, it has errors which are meant to be proofread. if the brackets are one of those errors, the code tags act weirdly.

    solution? i would suggest putting a code button up with the other vb code buttons. maybe make it bold font, color it brightly and offensively. add a few exclaimation points, maybe a %$%@! symbol. i know there's already a code button, but it's disguised as #. that leaves its meaning wide open.

    better yet, just enclose everything in code tags. it'd look sorta neat (in a weird sorta way). it wouldn't distinguish between code and non-code well, but at least the text would be indented.

  2. #2
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,796
    How did I solve this problem? I haven't yet, but if I get really bored one night I'll probably write an indention utility that indents C and C++ code with any of the most common bracing styles.

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

  3. #3
    I am the worst best coder Quantrizi's Avatar
    Join Date
    Mar 2002
    Posts
    644
    I doubt that this idea is even possible for a few reasons:

    I. The censor filter works for reasons everyone better know, but this code filter idea, people's codes are different. Everyone writes their codes different, there are different code languages(duh!!), so that's one reason.

    II. Another reason is because if someone writes this:

    #include <iostream>

    int main()
    {
    cout << "Hi Ya'll!";
    system("PAUSE");
    return 0;
    }

    Then the code filter could sensor everything. This isn't the same as C, C#, Java, Perl, CGI, or anything except C++(but Java is close to this I think). Anyways, it'll also just be a waste, becasue if someone actually could code this and did, he/she have to modify it everytime a library comes out or something. So inconclusion, no. This idea can't happen. If this is codable, I don't think anyone will do it anyways.

    **NOTE: I didn't use the code tags on purpose**

  4. #4
    Just because ygfperson's Avatar
    Join Date
    Jan 2002
    Posts
    2,493
    at least change the # button in the vB code bar to "code" or something...

  5. #5
    I am the worst best coder Quantrizi's Avatar
    Join Date
    Mar 2002
    Posts
    644
    Or....try doing this......just put the little mouse cusor over the button, and then read the little text box where all of the options are......mmmmm......maybe that'll work[/sarcasm]

  6. #6
    Just because ygfperson's Avatar
    Join Date
    Jan 2002
    Posts
    2,493
    people are too lazy to do that. if they would do that they would type in the [ code] tags. if they would that i wouldn't be complaining. if i wasn't complaining i'd have more free time.

    it's a simple '#' to 'code' change...

  7. #7
    Registered User blight2c's Avatar
    Join Date
    Mar 2002
    Posts
    266
    what about a seperate window for code only--one window for text, one for code. is that hard to do?

  8. #8
    Registered User C_Coder's Avatar
    Join Date
    Oct 2001
    Posts
    523
    what about a seperate window for code only
    It's not exactly hard, all they gotta do is type [ code ] [ /code ]

    [rant]
    How lazy are some people, they type 50 lines of code but they can't type 2 extra words. Then they expect someone to read all their left justified code, if i read a post and there are more than a couple of lines of unformated code I don't bother reading any of it.
    [/rant]
    Last edited by C_Coder; 04-06-2002 at 04:00 PM.
    All spelling mistakes, syntatical errors and stupid comments are intentional.

  9. #9
    Registered User blight2c's Avatar
    Join Date
    Mar 2002
    Posts
    266
    ccoder, i'm with/u 100%. i was responding to ygfperson's complaint that those who post for the first time (or many times there after) don't know what code tags are or how to use them. they eventually get flamed (sometimes after just their first post) and leave the board irked without ever having a chance to find out how to tag (
    i saw this a few days ago ).

    of course it's not hard, but did you know how to use them the first time?

  10. #10
    Registered User C_Coder's Avatar
    Join Date
    Oct 2001
    Posts
    523
    but did you know how to use them the first time?
    No, but having seen other peoples nice, easy to read code I found out how to do it. It seems some people here post again and again without using tags. I don't want to flame someone for not using them but your trying to help them and they're just making it hard for you. I'm willing to bet a lot don't preview their posts either.
    Last edited by C_Coder; 04-06-2002 at 04:10 PM.
    All spelling mistakes, syntatical errors and stupid comments are intentional.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Code tags bug
    By VirtualAce in forum A Brief History of Cprogramming.com
    Replies: 13
    Last Post: 06-05-2006, 08:25 PM
  2. don't know to use code tags
    By giovs in forum C Programming
    Replies: 1
    Last Post: 10-12-2004, 06:51 AM
  3. << !! Posting Code? Read this First !! >>
    By kermi3 in forum Windows Programming
    Replies: 0
    Last Post: 10-14-2002, 01:29 PM
  4. code tags
    By muttski in forum A Brief History of Cprogramming.com
    Replies: 5
    Last Post: 04-18-2002, 06:24 PM

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