#2,761 in Computers & technology books
Use arrows to jump to the previous/next product

Reddit mentions of Microsoft Visual Basic .NET Programmer's Cookbook (Developer Reference)

Sentiment score: 1
Reddit mentions: 1

We found 1 Reddit mentions of Microsoft Visual Basic .NET Programmer's Cookbook (Developer Reference). Here are the top ones.

Microsoft  Visual Basic  .NET Programmer's Cookbook (Developer Reference)
Buying options
View on Amazon.com
or
    Features:
  • Stain & water resistant leather upper
  • 360ΒΊ lacing system with gold-plated eyelets
  • Contoured EVA midsole provides superior cushioning & shock absorption
  • Non-marking rubber outsole w/ Wave-Siping technology for ultimate wet/dry traction
Specs:
Height9 Inches
Length7.375 Inches
Number of items1
Weight2.20462262 Pounds
Width2 Inches

idea-bulb Interested in what Redditors like? Check out our Shuffle feature

Shuffle: random products popular on Reddit

Found 1 comment on Microsoft Visual Basic .NET Programmer's Cookbook (Developer Reference):

u/SKZCartoons Β· 1 pointr/unitedkingdom

Have a butchers at this sample code. It is pretty simple, and you should be able to see how is simplifies the writing process. You don't have to worry about < or > or escaping characters.

A seasoned dev will cringe at the hardcoded element names like this:

writer.WriteStartElement("Employee")

because as good practice you should always, always use a constant there. One day, an analyst is going to tell you that a downstream system now has to have it was "Emp" and it's a 3rd party system and they cannot change theirs so you have to change yours. If it's a constant in a source file that all your projects share, it's one change and some recompiles (then a shitload of testing). If it's hardcoded everywhere, you have a job that takes weeks before you can start testing.

Anyway: the internet is your friend. Google will get you solutions to most simple things.

A lot of people go from VBA to VB, and it's a good route in. I would suggest that you invest in a good book with sample code. The O'Relly "Cookbook" series are excellent. I couldn't find one for recent VB, but Microsoft have one which looks OK. Though I couldn't see any advanced examples, the simple stuff looked well explained.

Cookbooks from good sources are great. Want to know how to do file handling? There's a chapter on that, with well-structured sample code and comments and descriptions. Likewise for XML.

It becomes very easy to dig into, and it is perfect material for reading on the bog. Just pick a topic you have never read up on and spend ten minutes having a butchers.

I would also invest some time in learning the basics of software design. I can't help with a book here, because it's 25 years since I was at university and a lot has changed since then.

But how to write good code, well-structured code, test-focussed code is vitally important to pick up. Many departments are filled with code written by people who came from Excel - and experienced devs shudder when they are told the history. You're going to do fine for a few years but then suddenly there will be a jungle of code and you have no idea how it got there.

If you follow good design principles, you will rarely write code that you are scared to touch.

So I will give you just a few tips:

  1. If a method is so long it doesn't all fit on your screen, you probably need to split it into several methods. The Visual Studio "refactor" functionality and "extract method" is brilliant at helping with this.

  2. Always name your methods and variables in a meaningful way.

  3. Use constants or pass in variables instead of hardcoding values and strings.

  4. Comments should be used when there is business logic that is not obvious from the code. If you cannot infer the business logic just from the code alone, then it needs a comment. A Business Analyst ought to be able to read your code and have a good idea what is going on. That way, a new developer (or you, in 6 months) will also be able to understand it.


    So.. this code is bad code:

    public float Calc(object object1, object object2, float r)
    {
    float a;

    a = object2.Value - object1.Value;
    if a<=0
    {
    return 0;
    }

    return a r;
    }

    This is better:

    public float CalculateProfitCommission(Holding initialHolding, Holding currentHolding, float CommissionRate)
    {
    float profit;
    float commission;

    profit = currentHolding.MarketValue - initialHolding.MarketValue;

    // only charge commission on profits - losses get no commission
    if(profit<=0)
    {
    return 0;
    }

    commission = profit
    commissionRate;

    return commission;
    }


  5. Learn "test-driven development". Visual Studio makes this easy. If you develop in such a way that every public method has a set of tests, then you can check any changes (even refactoring) and be fairly confident that you've not introduces major bugs.

    Lastly: VB is an OK language. I spent 20 years working in it. But I would advise you to look at c# too. Form c# it is way easier to pick up Java, Javascript, php, and a bunch of other languages.

    Good luck out there!