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="TheGeneral" data-source="post: 471641" data-attributes="member: 73182"><p>Technically there is no difference. With a scoped using you've got a more control over when the object is disposed. With an non scoped using statement its at the end of the method. If thats supposed to be the lifetime of your disosable object then go with the new style.</p><p></p><p>Non scoped using statements also save on horizontal space as there is one less indentation per scoped using. Imaging having 3 scoped usings, it saves 12 characters (depending on your indentation settings) in width.</p><p>[automerge]1637502725[/automerge]</p><p>Also your message parsing could be simplified to something like:</p><p></p><p>[CODE=csharp]TargetIds = Enumerable.Range(0, message.ReadUint()).Select(_ => message.ReadUint()).ToList();[/CODE]</p><p>[automerge]1637502796[/automerge]</p><p>Why are you using a dedicated [ICODE]Parse(IClientMessage)[/ICODE] method while initializing the object from its constructor is pointless atm? How about passing the [ICODE]IClientMessage[/ICODE] object to the constructor instead?</p></blockquote><p></p>
[QUOTE="TheGeneral, post: 471641, member: 73182"] Technically there is no difference. With a scoped using you've got a more control over when the object is disposed. With an non scoped using statement its at the end of the method. If thats supposed to be the lifetime of your disosable object then go with the new style. Non scoped using statements also save on horizontal space as there is one less indentation per scoped using. Imaging having 3 scoped usings, it saves 12 characters (depending on your indentation settings) in width. [automerge]1637502725[/automerge] Also your message parsing could be simplified to something like: [CODE=csharp]TargetIds = Enumerable.Range(0, message.ReadUint()).Select(_ => message.ReadUint()).ToList();[/CODE] [automerge]1637502796[/automerge] Why are you using a dedicated [ICODE]Parse(IClientMessage)[/ICODE] method while initializing the object from its constructor is pointless atm? How about passing the [ICODE]IClientMessage[/ICODE] object to the constructor instead? [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Server Development
Habbo Retros
Habbo Development
Starlight [C#/.NET Core/Dapper]
Top