Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hi,

 

I am wondering, whether I should compact my code more in general.

 

Will the first block run faster than the second? or will the compiler create speedequivalent code?

 

codeblock 1

int i = 3

int j = 6

point d = new point(i,j)

SomeMethod(d)

 

Or should I sacrifice some readability and compact this to

 

codeblock2

 

SomeMethod( new Point(3,6)

  • Moderators
Posted

Oh yeah of course, these local vars are destroyed soon after they go out of scope.

 

I don't care much for readability... we use overloaded methods that have 5 or so args then readability is already lost.

Visit...Bassic Software

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...