Boning up on VB.net


  • kills Dumbledore

    So I applied for a job which will consist of supporting a legacy VB.net product for 1-2 years until the web based replacement is fully up and running. I may have bigged up my VB knowledge a bit to secure an interview, when my .net experience is much more on the C# side.

    I know it all compiles to the same IL, and that it's mostly different syntax, but are there resources for getting up to speed on VB specific concepts and syntax?



  • There's always msdn? All their stuff shows vb next to the c#.



  • @Jaloopa said:

    but are there resources for getting up to speed on VB specific concepts and syntax

    Would be nice to know if it's VB.NET written like old VB or if it's VB.NET written like shittier C# ...


  • kills Dumbledore

    Yes, that is something I'll try to get to the bottom of in the interview. What should I be looking out for?



  • If you're good at C#, you should be able to pick up VB.Net rather quickly. The most common pitfall I encountered was wanting to terminate my statements with a semicolon and using braces rather than If / End If.

    You could suggest that you'd partly join the replacement programme, so you can get to write some modern C# as well?


  • kills Dumbledore

    @AlexMedia said:

    If you're good at C#, you should be able to pick up VB.Net rather quickly

    That's what I'm banking on, but I need to look competent enough to get in the door.

    @AlexMedia said:

    You could suggest that you'd partly join the replacement programme, so you can get to write some modern C# as well?

    The replacement is web technology, which I'm not too experienced in. I've been promised that cross training will be available, and once the VB product is phased out I would be moved to the new solution.



  • @Jaloopa said:

    That's what I'm banking on, but I need to look competent enough to get in the door.

    I hired a C# guy for a VB.Net job five years ago. Him not ever using VB.Net in the past didn't factor against him at all. My biggest concern was that he wouldn't want to work for me. He worked out fine (he's still there, I'm not).



  • Some of the system methods are surprisingly different, for no apparent reason.

    But intellisense and google guides you through that.



  • They're cross compatible.

    I'm not sure why it has to remain VB even?



  • @xaade said:

    for no apparent reason

    History. For example, VB.Net's for loop looks just like VB6's and C#'s for loop looks just like C's


  • kills Dumbledore

    @Jaime said:

    My biggest concern was that he wouldn't want to work for me

    I get the impression this is a concern here. The recruiter has hinted that the position has been open for some time, and the advert seemed quite apologetic about the fact that it's VB. My interpretation is that they've had trouble getting anyone good enough at .net to apply, because VB has a stigma around it. This works for me since the perceived lack of desirability makes the pay and benefits better, and I'm not scared of learning a new language.



  • If the position has been open for that long they've had a hard time finding anyone who is willing to support VB.Net - so you've got the upper hand here. Just be upfront about not being a master in VB.Net (you aren't) but that you are good at C#, know the .NET Framework, and that you're willing to learn.

    VB.Net is not hard. Picking up on someone else's codebase is much, much harder.



  • @AlexMedia said:

    Picking up on someone else's codebase is much, much harder.

    I know it's VB, but I don't trust for loops or if blocks. I use goto instead.


  • kills Dumbledore

    @AlexMedia said:

    Just be upfront about not being a master in VB.Net (you aren't) but that you are good at C#, know the .NET Framework, and that you're willing to learn

    That's pretty much what I'm going for, but there's a technical test and I don't want to be completely rusty on any gotchas between the two languages.

    Guess I'll run through some codeacademy stuff to reacquaint myself with the syntax.



  • The thing that always catches me out when switching between VB and C (as I'm often working on embedded devices then doing the support app on the PC in VB) is the arrays. Its a bit of a legacy of ANCIENT Visual Basic. In C you define an array with 16 elements, you get 16 elements, in old old VB if you defined an array with 16 elements you got 16 elements.... Difference was that VB being BASIC was trying to be nice and non-confusing by numbering them 1 to 16.

    Nowadays VB does have a 0th element but as a legacy of old VB, Dim thing(16) actually gives you 17 elements numbered 0-16 because shifting everything to 0 referenced would have broken legacy code.

    So if you want 16 elements numbered 0-15, you actually declare Dim thing(15).... this often catches me out when switching between the two as sometimes I will declare one less element than I actually need in C and obviously end up with some odd side effects as a result.

    Easiest way to think about it is in VB, you define the index of the final element rather than the number of elements you actually want.



  • @Encore_Spod said:

    Difference was that VB being BASIC was trying to be nice and non-confusing by numbering them 1 to 16.

    It (probably, unless you changed an option) gave you 0 through 16... you just ignored one of the elements.

    My favorite confusing line of VB:

    Dim myArray(-1)
    

    Yes, it compiles to a zero element array.



  • This isn't what you asked, but since it's marked as "solved" I'm going to run my mouth anyway.

    @Jaloopa said:

    So I applied for a job which will consist of supporting a legacy VB.net product for 1-2 years until the web based replacement is fully up and running.

    I hope you realize that:

    1. Promises employers make to candidates (and usually their own employees as well) are almost always reneged on.
    2. Getting the web based replacement fully up and running (and switching all clients to it!) could take decades, not months.


  • So, has the interview taken place yet? If so, how did it go?


  • kills Dumbledore

    It's on Friday. Tonight I shall be making a basic VB application that pulls in data from a database and manipulates it with Linq or something, to get a taste for any differences.

    Updates will be forthcoming


  • kills Dumbledore

    Went well. They're looking for a C# guy who's willing to work in vb for a while, and there's a good roadmap for transitioning so I shouldn't be stuck on the legacy product. I should get feedback by monday



  • Sounds good, so far.


Log in to reply