This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Keil: Code detection in posts

How about adding a little filter that scans for the use of braces or nested parentheses in peoples post and very explicitly complains if matching posts does not contain the required formatting tags.

A huge majority of new posters are clearly completely unable to read a few lines of posting instructions and don't seem to look at the preview and notice something strange about their code.

Since garbled source code is so hard to read, it wastes a lot of time for all people on this board and it is hard not to be rude after reading the 10th thread with unformatted code.

Parents
  • No, it would not be possible to automatically insert the tags. It is too hard to detect the switch between running text and code blocks. But since the Keil tools only supports assembler, C and C++ to my knowledge - and most problems are with C/C++ code - it should be quite easy for a trivial code piece to make an educated guess if the post contains C/C++ code or not. That would probably be enough.

    Extending the concept to detect C51 assembly should also be quite easy. It would probably be enough to check if several lines starts with white space followed by one of a couple of common mnemonics.

    But it wouldn't need to be perfect. It would be enough if the filter could catch 80% of all incorrect posts.

Reply
  • No, it would not be possible to automatically insert the tags. It is too hard to detect the switch between running text and code blocks. But since the Keil tools only supports assembler, C and C++ to my knowledge - and most problems are with C/C++ code - it should be quite easy for a trivial code piece to make an educated guess if the post contains C/C++ code or not. That would probably be enough.

    Extending the concept to detect C51 assembly should also be quite easy. It would probably be enough to check if several lines starts with white space followed by one of a couple of common mnemonics.

    But it wouldn't need to be perfect. It would be enough if the filter could catch 80% of all incorrect posts.

Children
No data