views:

308

answers:

7

I’ve been professionally writing VB.NET software for seven years. However, I don’t have a strong computer science background – four courses while studying education at university in the 90s that gave me some CS basics and exposure to Pascal, C and Lisp. Anyway, there are a whole bunch of practices that I’m missing – testing, patterns, “real” object-oriented design, etc and I’m trying to pick them up. If you look at most of my applications, you find blocks of fairly old-school procedural code being triggered by form events. Where I write my own classes, I’m mostly using them as data-structures with overloaded New() methods and maybe a custom output method. I consider myself quite proficient at this kind of work and none of my employers has had any problems with it. But it's not really right and I'd like to learn more of the craft of my trade.

Since the early 90s, I've looked at several different intro to objects kind of documents -- books, tutorials, etc. They seem to all use dogs and cars as analogies and examples with tons of responsibilities per object. And they've never stuck with me even as I wanted to learn from them.

Lately, I’ve been reading “Uncle” Bob Martin’s notions of OOD and I like what I see. But it's hard for me to follow the C/Java syntax and I get hung up on that difficulty rather than just ingesting it smoothly. So I’m looking for good sources with VB examples because that is (by far!) the syntax with which I am most comfortable. There’s not much around. The stuff that I find doesn't seem to advocate or exemplify e.g. the Single Responsibility Principle.

I've been looking for books, but they mostly seem like they're either OOP and not in VB or VB and not (really) OOP. I've checked out the following topics here: 1, 2 and 3 -- among others. I've scrutinized the Amazon reviews of most of the books listed in those threads and keep coming up with reasons to suspect that they aren't really what I'm looking for.

So, any ideas? If you're going to suggest a book, I'd like to hear how well it fits the needs that I've outlined. If you think I'm on the wrong track, I guess I'd be interested to hear why. If you have other suggestions on how to pursue this avenue of improvement, that too would be great.

A: 

Probably not exactly what you're looking for (since it's not specifically about OOP) but I found this book really helpful:

Practical Guidelines and Best Practices for Microsoft® Visual Basic® and Visual C#® Developers

It shows aspects of good coding for VB.net alongside C# so you can see the similarities and the differences, and covers a broad range of subjects. It's not that up-to-date anymore, but still worth a look.

davek
It's a good book, but I don't think it's what `clweeks` is looking for. It's a list of short guidelines with a terse explanation of their benefits - it rather assumes you know the basics of OOP already.
MarkJ
+1  A: 

I think the Head First books are awesome to understand OOP.

This one could help you with OOP concepts

and this one may help with C#...

Good luck!

Rulas
A: 

couple of example code bases you can look at: search for "petshop vb" and "ibuyspy" Both are sample websites that purport best practices. If nothing else, you can get a good idea of what some folks at msft thought was "right" at various stages of .net/CLR development.

No Refunds No Returns
Petshop is actually one of the examples used for worst practices.
Lamar
A: 

CodeProject makes it easy Follow the tutorial below and you know all the principles. CodeProject OOP Example <-> Tutorial

Good luck!

NicoJuicy
Thanks for trying, Nico. However it isn't really what I need. I was pretty sure that it wasn't what I'm looking for when I read "a Class is a definition of a real life object" -- which is just wrong. Also, it's basically a distillation of the fruitless kinds of OOP tutorials that I've already spent time with. E.g. there was no discussion of the OCP or the SRP.
clweeks
A: 

Honestly I think the best way is to just learn how to read the C#/Java syntax. There isn't much out there for VB.NET because, and please don't take offense since I certainly don't mean you, the vast majority of VB programmers out there aren't concerned with the SOLID principles, let alone more advanced software design techniques. That's not to say there aren't VB.NET developers out there who care about quality (and I am replying to one right now), but most developers who do care about quality use C#.

It might be more difficult to have to be able to on-the-fly convert C# to VB.NET but sadly I don't think you're going to find much out there that talks about "software craftsmanship" with examples in VB.NET, because the truth of the matter is only a minority of VB.NET developers care about software craftsmanship.

Wayne M
I've been kind of wondering if that wasn't the case.
clweeks
A: 

Try Bertrand Meyer's "Object-Oriented Software Construction" 2nd edition. It's probably the best book on OO ever.

Meyer has a solid academic background, and he doesn't mistake class for object and other little silly things like that, which you can often found in more business-oriented books.

He also has plenty of business experience, which shows in the book.

CesarGon
+1  A: 

My first .net language was vb.net - so I know your pain and a few years ago I went through exactly what you're experiencing now. At the end of the day all the best books and online materials are in c style languages (C#, Java etc) - you will always have mental hurdles to leap whilst you stay with vb.net and do the extra translation in your head.

For SOLID principles, to be honest if you are familiar with C then translating them into VB.Net shouldn't be difficult as the only differences will be how variables are defined, extra semicolons, etc - all very superficial differences.

As soon as you move from that into more complex areas the syntax in VB.Net and C# starts getting further and further apart until eventually you start hitting features in C# that just aren't in VB.Net. Working out what's possible, or what's the best way to do it in each language (just because it's done one way in C# doesn't mean there isn't a better way to do it in VB) is extra effort that is best avoided.

My advice - save yourself time and effort and switch to C#. If that's not possible then you'll have to come to grips with C# and Java much more than you have done so far so that it's easier to cross apply what you're learning. If you don't do that then you should be prepared for swimming upstream for the rest of your programming career (or at least for as long as you can predict, which might only be a couple of years by when we'll all be using LISP or FORTRAN again).

FinnNk