Jump to content
  • Advertisement
Sign in to follow this  
Seroja

[.net] VS.Net 2005 Beta 1 -- Beta 2

This topic is 4871 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I've just installed the Beta 2 that I got today. Now I was wandering what's the real difference? From what I noticed, they added some system to check the way you code. I got about 40 warnings, which include: Sign your assembly as strict typed (or something similiar) - I've read it's somewhat better, but then you can't consume non-strict typed dlls, so why do it? Select a permission level - now what is that really? Use SafeHandle/CriticalHandle instead of IntPtr - is that what is gonna be used from now on for different pointers? Use jagged arrays instead of 2 dimensional - have no idea what is that. And the weirdest of all: they didn't like me name my main form frmMain! It produced 2 warnings, one about frm not being a word and one about it being lowcase. Now how am I supposed to name it? I've been used to such naming since VB6. Do you all just hide those warnings? Or should I follow them? Are there any other significant changes? Also, what changed between VS2003 and VS2005? (My reason for preferring VS2005 is only the IDE, VB.Net 2003 IDE was horrible IMHO).

Share this post


Link to post
Share on other sites
Advertisement
Which language(s) do you get these in? I have yet to try out Beta 2, so I have not experienced any of these warnings, but here's a couple thoughts...

Quote:
Use jagged arrays instead of 2 dimensional - have no idea what is that.


I read somewhere that jagged arrays are significantly faster than 2-dimensional arrays (though I have no idea why that would be). Maybe this has something to do with the warning.

Quote:
they didn't like me name my main form frmMain! It produced 2 warnings, one about frm not being a word and one about it being lowcase. Now how am I supposed to name it? I've been used to such naming since VB6.


The convention for naming classes in .Net is to use upper-case letters. Maybe it's complaining that you're breaking convention?

Share this post


Link to post
Share on other sites

well, MS has really good products (visual studio, directx, and a few more), but i dont like the way they are improving them..

more and more, we have to do like they want, instead of how we want! if i want to call my damn Form of frmMain, ill do it! and it isnt going to be an IDE that is going to forbid me.

i too have the vs.net 2005 beta, but i returned to 2003, still the best one out there. 2005 is still to buggy, and at least the 2003 one doesnt give me "advices" of how to write MY code.

Share this post


Link to post
Share on other sites
None of those warnings show up or even seem to exist in VB .Net 2005 - are you coding in C#?

In any case, they're warnings and probably configurable - if you don't want to follow the suggested naming convention just turn them off.

As for why?

Naming convention is mostly, well, a convention - I guess that since it's a lot easier nowadays to check the type of any element it doesn't make as much sense to place it in the element's name

The signing part is a matter of security - if you sign your assemblies, people who you distribute the assemblies to have a way to know that you're the origin from the assembly, and adjust trust levels for it if necessary.
The permission level has to do with what your application is allowed to do - you should restrict it to what you actually need, since that way users are more likely to trust your app, and it's less likely to be used to exploit some security issue.

The safehandle/critical handle probably control pinning/unpinning implicitly, which is probably why they are recommended - if you know what you're doing pointer wise, just turn the warning off. That is assuming you know what you're doing pointer wise. Which to be frank, I wouldn't trust myself to know what I'm doing pointer wise :)

I have no clue why the jagged arrays(arrays of arrays) vs 2 dimensional arrays - I would have assumed that the jagged arrays would actually be slower, since they imply a redirection and an extra bound check vs a multiplication

E deus nos livre de alguem nos dar conselhos sobre como escrever os nossos programas...</sarcarmo> Ainda se fossem erros ou nao fossem configuraveis, eu entendia a queixa :)

[Edited by - alexmoura on June 15, 2005 8:17:21 PM]

Share this post


Link to post
Share on other sites
Try checking the Code Analysis tab in project properties. I see naming rules there that might be causing your warnings.

Share this post


Link to post
Share on other sites
VB.Net 2005 Beta 2:
Produce warnings: Build -- Run Code Analysis
Configure warnings: Project Properties -- Code Analysis

The naming conventions: it wrote that certain stuff must have first word low-case, and certain high-case.I do this actually by myself, but I chose where to use what differently.

VB.Net 2003 IDE is really buggy, no edit-and-continue, debugging exceptions almost impossible, and other trouble as well. From what I've heard, the bugs in .Net 2005 are because of the framework, not the IDE.

More warnings: all units and assemblies should be marked CLSCompliant. But what if they are not? And I haven't found how can I mark the whole assmebly.

If those handles make it easier to use pointers, I'll use them. Didn't really like IntPtr.

Signing: What is that ClickOnce manifests? And strong name - will that prevent me from using outside DLLs which aren't strong-named?

Now, what are the most serious changes except that code analysis? And what are the main differences between Framework 1.1 and 2.0 (related to VB)?

Share this post


Link to post
Share on other sites
The page below has information on what's new in the "Visual Basic 2005 Information" section
VB page
And in particular for the language

I've never played with those particular warnings, just the vb language specifics - I'll take a look, but are you saying that you set a rule allowing lower case for classes but you still got a warning?

If I recall correctly, the CLS compliant is a sub set of the frameworks types and some rules that all .net languages strive to support - not having your assembly being cls compliant implies that some .net languages might not be able to reference it - if you're not building a dll, or if it's just for internal use you don't have to worry about it.
More on CLS compliance
As to how to mark it, I'm sure there is some configuration in the project properties - if not, you can use the CLSCompliant attribute, I think: <assembly: CLSCompliant(True)>.

I don't remember if it will start giving you warnings/errors if you're exposing (making public) non cls compliant types.

As for signing: Click once is a deployment technology - it basically allows you to publish your project as a web link.
I think the strong name part is basically the signing part, I've heard both names used interchangeably - your assembly is hashed, that hash is encripted and inserted into the assembly, which allows you to identify that the assembly wasn't modified by anyone other than the owner of the private key.
Not sure if signing will stop you from referencing non signed assemblies - I would suppose (hope) so, since it would be very easy to replace one of those assemblies with a hacked one, thus breaking the whole security story.

Mind you, signing is basically an extra security advantage - if you can live with the current state of native binaries, not having your assembly signed basically gives the standard fare of issues as distributing native binaries.

I hope that helps - and remember kids, msdn is your friend :)

Share this post


Link to post
Share on other sites
The only reason to use jagged arrays over multidimensional arrays is memory usage, a multidim array uses more memory than a jagged array if each row of the array is not completely full.


|0 1 2 3
-|---------
0|0 - - -
1|1 2 - -
2|3 4 5 -
3|6 7 8 9

this array would be a bad multidim array, all the dashes are wasted memory.

jagged arrays suffer from extra bounds checking over multidim arrays.

Share this post


Link to post
Share on other sites
I think I read that the reason for jagged arrays being faster is that there are specific IL instructions for 1D array access. I'll try to find the articles for you.

'I don't remember if it will start giving you warnings/errors if you're exposing (making public) non cls compliant types.'
I think it does, but I think you can still make them public if you mark them with <CLSCompliant(False)> or [CLSCompliant(false)]

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!