Detour tutorial?

Started by Lockdown, August 21, 2016, 11:11:49 AM

Previous topic - Next topic

milon

Quote from: JaxelT on August 22, 2016, 11:04:09 AM
Happily enough, now that I've taken the time to write out that little tutorial, I can just link it to anyone else who asks how detouring works, saving both my time in explaining it and their time in figuring out how it works from scratch and vague Internet pages. Go whinge about "help vampires" somewhere else, and stay out of our Help forum.

You should consider putting that up on the RimWorld wiki somewhere.  I'm pretty sure the modding section there is *sorely* outdated...

RawCode

Quote from: milon on August 22, 2016, 10:30:32 AM
Or better yet, post a link to an already existing online reference / tutorial / etc.
Well, is this more or less "offensive" and useless?
http://lmgtfy.com/?q=bindingflags

ps. there is documentation about everything on this planet, especially on framework existing over 20 years.

QuoteThis isn't your forum. You should expect questions from non-experts.
Current question is unrelated to CCL or RimWorld, it's generic C# question covered by MSDN documentation.
This forum is not place to learn C# and posting any tutorial about C# (especially with major parts ripped or "explained differently compared to official version" is harmful.
People must learn C# from official sources and books designed by actually skilled people, nobody here can explain anything better then official documentation.
No matter how many people will "like" tutorial and praise it helpfulness, it is inferior compared to official documentation.

This is not my forum, still, i want only good for users and forum, sadly, not everyone is able to understand it, probably i came wrong forum, or wrong time.

RemingtonRyder

The official documentation probably is better. I don't doubt that. However using examples which are in the context of RimWorld and illustrating how to overcome potential pitfalls makes it more interesting for people in this forum.

If you want to get people interested in reading the official documentation, you've got to get their interest first. :/

RawCode

Quote from: MarvinKosh on August 23, 2016, 09:59:41 AM
If you want to get people interested in reading the official documentation, you've got to get their interest first. :/

I got their interest by giving no direct answer and leaving only option - reading documentation...

CallMeDio

QuoteWell, is this more or less "offensive" and useless?
It is not offensive, but its still useless(not understandable or applicable) to who this thread might interest (beginners), it is like saying for someone detouring for the first time:
Quoteuse (BindingFlags)60 or 0x3F3C
they are probably going to spend 2 hours trying to figure why typing 0x3F3C is giving a error, how big of a help is this? this is a help forum.

QuoteCurrent question is unrelated to CCL or RimWorld, it's generic C# question covered by MSDN documentation.
Original post:
QuoteTrying to learn how to use detours using CCL.
It is related to CCL or Rimworld, even if the original question was about bindingflags, the game modding is done in C# of course is there going to be C# on the forums, what you said is like wanting to do a forum about plumbing without mentioning water.
I have seen several university teachers like you, they know so much and it is so easy that they completely erase of memory how it was when they knew nothing and think everybody understand what they say as easily as they see it.
QuoteYou may need a rubber duck.  Also, try some caveman debugging.

Released mods: No Mood Loss on Prisoner Sold or Died

RawCode

Quotethey are probably going to spend 2 hours trying to figure why typing 0x3F3C is giving a error, how big of a help is this? this is a help forum.

probably we are on completely different level of conscience, in my state people with problems related to abstract thinking are "non existent"...

Quoteuse (BindingFlags)60 or 0x3F3C

means that you should use (BindingFlags) statement with numeric (magic number) value of 60 or 0x3F3C ((BindingFlags)60 or (BindingFlags)0x3F3C)

well, this is sad, very very sad, there is no reason to continue this discussion at all

1000101

Actually, you should never use "magic numbers" and they are an example of bad programming techniques and being a piss-poor programmer.

The correct way is to always use named constants.

Instead of saying "use (BindingFlags) 60" (which is bad) one should direct them to make a proper constant and use that.

To wit:public constant BindingFlags UniversalBindingFlags = BindingFlags.Static | BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic;

The above is the proper way to do it.  That "UniversalBindingFlags" has the value of 60 is both irrelevant and assigning it directly to the value of 60 is dangerous as it introduces the potential for it to break should the API and libraries change which can and sometimes does happen.  That it hasn't for .Net is completely irrelevant.  If you want people to learn how to program and to direct them to "official sources" then it also helps to not teach them bad programming techniques when you do provide information yourself.
(2*b)||!(2*b) - That is the question.
There are 10 kinds of people in this world - those that understand binary and those that don't.

Powered By

JaxelT

Mods should probably lock this thread since Lockdown's question was answered, seeing as RawCode is just using it to have an egotistical meltdown.