Menu
Forums
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Trending
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
Upgrades
Log in
Register
What's new
Search
Search
Search titles only
By:
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Server Development
Habbo Retros
Habbo Development
Starlight [C#/.NET Core/Dapper]
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Joopie" data-source="post: 471664" data-attributes="member: 7030"><p>No, because it would violate a few characteristics of the <a href="https://docs.microsoft.com/en-us/dotnet/standard/design-guidelines/choosing-between-class-and-struct?redirectedfrom=MSDN" target="_blank">design guidelines</a> when to use a struct or not.</p><p></p><p></p><p></p><p>In theory yes, but malformed packets can still cause unexpected behavior.</p><p></p><p></p><p></p><p>The [ICODE]Invoke()[/ICODE] method is <a href="https://andrewlock.net/benchmarking-4-reflection-methods-for-calling-a-constructor-in-dotnet/" target="_blank">slow</a>. It does not gain the same speed as by directly calling the constructor. It never will. The closest thing to get to that same speed is using compiled expressions. The invoke method still performs validation to check given parameters.</p><p></p><p></p><p></p><p>I wouldn't say worried. Just something to think about when using reflection. I also wouldn't say reflection is the right answer here. It would just have as much of an impact on refactoring/replacing code.</p><p>Refactoring the code to avoid having the hard required method is just as simple as extracting the method into it's own class, name it something something deserialiser and we basically solved the argument.</p><p></p><p>Speaking about code should be done more anyway. Hiding it away doesn't make it better either. When arguing about code, better solutions follow and knowledge is shared.</p><p></p><p></p><p></p><p>Yes, I think he's using the Activator. Speedblood is given credit for helping with the "core". My 3+ years old code base might be of influence. The latter would have been fun to see tho.</p><p></p><p></p><p></p><p>I think I don't have a clue on what you actually mean here.</p></blockquote><p></p>
[QUOTE="Joopie, post: 471664, member: 7030"] No, because it would violate a few characteristics of the [URL='https://docs.microsoft.com/en-us/dotnet/standard/design-guidelines/choosing-between-class-and-struct?redirectedfrom=MSDN']design guidelines[/URL] when to use a struct or not. In theory yes, but malformed packets can still cause unexpected behavior. The [ICODE]Invoke()[/ICODE] method is [URL='https://andrewlock.net/benchmarking-4-reflection-methods-for-calling-a-constructor-in-dotnet/']slow[/URL]. It does not gain the same speed as by directly calling the constructor. It never will. The closest thing to get to that same speed is using compiled expressions. The invoke method still performs validation to check given parameters. I wouldn't say worried. Just something to think about when using reflection. I also wouldn't say reflection is the right answer here. It would just have as much of an impact on refactoring/replacing code. Refactoring the code to avoid having the hard required method is just as simple as extracting the method into it's own class, name it something something deserialiser and we basically solved the argument. Speaking about code should be done more anyway. Hiding it away doesn't make it better either. When arguing about code, better solutions follow and knowledge is shared. Yes, I think he's using the Activator. Speedblood is given credit for helping with the "core". My 3+ years old code base might be of influence. The latter would have been fun to see tho. I think I don't have a clue on what you actually mean here. [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Server Development
Habbo Retros
Habbo Development
Starlight [C#/.NET Core/Dapper]
Top