#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.
Buying options
View on Amazon.comor
- 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
Features:
Specs:
Height | 9 Inches |
Length | 7.375 Inches |
Number of items | 1 |
Weight | 2.20462262 Pounds |
Width | 2 Inches |
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:
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;
}
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!