On Saturday, 24 December 2022 at 04:40:15 UTC+11 bfrg wrote:
> > No, I prefer 'this' over 'self'. I was considering if its possible to > go without any keyword for it. For example, these days we also have > syntax highlighting which can give a different color for member variables > and arguments. > > In order to give different colors for member variables and function > arguments you need a very sophisticated parser. Otherwise you cannot > distinguish the two in code. For the same reason C++ developers often > prefix member variables with `m_`, like `m_age`, others use a postfix > underscore like `age_` etc. I don't like it because it's not consistent > All good points. After exploring the idea from different angles, I now think "this." prefix is the best choice. Interesting, it effectively acts the same as the "m_" prefix but enforced to be consistent - and I do like that. > Personally, I would prefer `this` (or `self` etc.) for member variables. > It makes the syntax script a lot simpler and the syntax highlighting will > work 100%. It will also be easier to `:grep` for all usages of a member > variable since every reference of a member variable will contain `this` > Yes, indeed consistency, clarity, readability, simplicity, maintainability... These are all more desirable than saving a few keystrokes. -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/vim_dev/c3b219ab-470d-4098-9c51-d26b979ce3fcn%40googlegroups.com.