Slashdot Mirror


User: Finagle's+Friend

Finagle's+Friend's activity in the archive.

Stories
0
Comments
4
First seen
Last seen
Profile
(view on slashdot.org)

Comments · 4

  1. Re:Braces on What is Well-Commented Code? · · Score: 1
    If your programming in C++ why aren't you searching for "::function_name" or "class_name::function_name" instead of "^function_name"?
    Personally I put a single space between the function name and '(' when declaring it (source and header) but not when calling it. This works for methods as well as static functions - it also works with class headers and template declarations where good indentation will typically mean there are leading whitespaces that blow away your technique anyway.

    Also if the return type is on the same line then the pattern "[A-Za-z0-9_] function_name" will only find the declaration - unless you do strange things with macros.

    I agree with "four spaces good, two spaces bad" though (and eight are a waste).

  2. Re:Tools matter on What is Well-Commented Code? · · Score: 1

    One thing I've done in both Emacs and DevStudio in the past is set the comment text to display in grey, this causes the actual code to stand out more, while leaving the comments readable. (I use black text on a white background)

    Another advantage of DOxygen is that it can show you which classes are derived from a class, this helps when maintaining code as you can check that some planned changes won't break one of these classes. Not something you can easily see from the code.

    If your using a version control system (you probably should be!), don't mix changes together - If your fixing 2 bugs in the same file, checkin the changes for one bug, then checkin the changes for the second bug. Later on it will be easier to see what changes were made for each bug and to spot any mistakes.
    (I used to work with a guy who would change variable and function names in existing code while making other changes. When you tried to 'diff' versions of the file to see what he'd done, it was obscured by lines that had changed because of renaming)

    Your "comment compressor" has been done in the past, I think it was called a "folding editor" because it let you "fold up" blocks of text - never used one though, but surely emacs has a mode for this?

    Other 'tools' I've used in the past were the function menu (func-menu.el ?) in emacs/xemacs which lets you jump quickly between functions within a file. Also some home grown lisp that could take class name and open either the header or source file. Both of these things reduced the time it took to get to grips with other peoples code.
    DevStudio and KDevelop have these features built in.

  3. Re:Space sex probably overrated on China Plans Moonbase · · Score: 1

    Furthermore, you'd have to use some sort of straps to hold you on to your mate

    Some people do that already - you could probably use it as a selling point!

  4. Surely the Vikings were first? on China Plans Moonbase · · Score: 1

    Didn't I read something about that somewhere? :-)