Timeline for Is it a good idea to "#define me (*this)"?
Current License: CC BY-SA 3.0
27 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jun 16, 2015 at 12:03 | comment | added | Piotr Dobrogost | (...) tell me if you know about other advantages and use cases for explicit this everywhere. – see What is the advantage of having this/self pointer mandatory explicit? | |
Jul 16, 2014 at 13:12 | comment | added | Ian | @cup, But C/C++ gives the coder so much more power to redefine the language, at least in Java/C# when I see what looks like the “while” keyword, I know it is. | |
Jul 16, 2014 at 11:38 | comment | added | cup | @Ian guess you've never seen unmaintainable Java/C# code. I have and it is no different from unmaintainable code in any language. The language doesn't make the code unmaintainable: the coder does. | |
Jul 16, 2014 at 7:20 | history | edited | user3123061 | CC BY-SA 3.0 |
added 1689 characters in body
|
Jul 16, 2014 at 2:51 | comment | added | congusbongus | Depends. Are you a pirate? | |
Jul 16, 2014 at 0:17 | comment | added | Kaz |
@StevenBurnap Uh, if you call attributes me_ then you have the problem of me_foo = other_object.me_foo .
|
|
Jul 15, 2014 at 20:57 | comment | added | Bill K | As an alternative comment--I think the pattern of identifying members with this. is pretty bad. I really don't even like using m_, the reason is that it can be wrong. One refactor where you forget to change the name can cause a LOT more work than just letting your tools do their job. (I don't know about C++ IDEs, but in Java/Eclipse members, statics and locals can easily be differentiated at least 3 ways--by color/font, hovering and ctrl-clicking. Perhaps your team would be better served if you spent time looking into more appropriate tools? | |
Jul 15, 2014 at 19:04 | answer | added | Larry Gritz | timeline score: 6 | |
Jul 15, 2014 at 15:09 | comment | added | Manu343726 | The problem with language aliasing is that, it could start with one or two "reasonable" aliases, but could lead to this: stackoverflow.com/a/1466303/1609356 | |
Jul 15, 2014 at 14:32 | comment | added | Ian | And people still wish to know way so many programmers felt the need to move to Java/C# to escape from the world of unmaintainable C++ cope..... | |
Jul 14, 2014 at 23:08 | comment | added | Ben Voigt |
@StevenBurnap: Exactly. And then the compiler will even point out places you forgot the me_ (or m_ as is more widely seen)
|
|
Jul 14, 2014 at 18:39 | comment | added | user53141 |
Oh please, just no. You could save yourself some trouble by just declaring attributes as me_x .
|
|
S Jul 14, 2014 at 18:30 | history | suggested | glampert | CC BY-SA 3.0 |
Corrected typos and misspelled words; fixed the title; simplified some sentences.
|
Jul 14, 2014 at 18:26 | comment | added | glampert |
Objective-C and Python coders would unanimously prefer self instead of me .
|
|
Jul 14, 2014 at 18:22 | review | Suggested edits | |||
S Jul 14, 2014 at 18:30 | |||||
Jul 14, 2014 at 16:15 | answer | added | truschival | timeline score: 18 | |
Jul 14, 2014 at 15:10 | comment | added | Dan Is Fiddling By Firelight |
Why not just go all out, and do: #include "vb.h" , #Include pascal.h , or #include FOTRAN.h and have the next person to touch your code submit it to TDWTF.
|
|
Jul 14, 2014 at 13:38 | comment | added | logc |
It is a wonderful idea! And for those who come from a Python background, why not #define self (*this) ? You can even mix both macros and have some files imitating VB and others Python. :)
|
|
Jul 14, 2014 at 12:25 | vote | accept | user3123061 | ||
Jul 14, 2014 at 12:05 | comment | added | MetalMikester | Reminds me of my boss' VB code. Me Me Me everywhere. Sounds selfish. :p Anyway, the answers so far say it all. | |
Jul 14, 2014 at 9:32 | comment | added | pjc50 | You should avoid having function arguments and members with the same name, as well as avoiding explicit "this". | |
Jul 14, 2014 at 8:45 | history | tweeted | twitter.com/#!/StackProgrammer/status/488605328393920512 | ||
Jul 14, 2014 at 6:38 | answer | added | Jan Hudec | timeline score: 89 | |
Jul 14, 2014 at 6:37 | answer | added | BЈовић | timeline score: 42 | |
Jul 14, 2014 at 6:36 | answer | added | Doc Brown | timeline score: 25 | |
Jul 14, 2014 at 6:26 | history | edited | user3123061 | CC BY-SA 3.0 |
added 2 characters in body
|
Jul 14, 2014 at 6:18 | history | asked | user3123061 | CC BY-SA 3.0 |