|
-
Sep 18th, 2003, 07:34 AM
#1
How long to learn .NET???
Ok, as some of you are aware I am not a beginner programmer, and some of you know the amount of VB I know. However, I know zero .NET. How long would it take for me to learn, if I was learning 9 till 5 every day, .NET to a standard when I can write apps like I write at the moment using VB6...?
Strange question I know. But people at work want time scales on development and .NET *sigh*
I said about 4-6 months of learning and training...would that be aboot right or is that WAYYYY to much?
Woka
-
Sep 18th, 2003, 07:50 AM
#2
If you have VB6 and a basic understanding of the Win32 API then 2 months of real world programming should be sufficient to be proficient.
I have 2 months now and I find it quicker to knock together applications in VB.Net than VB6 these days.
-
Sep 18th, 2003, 07:54 AM
#3
-
Sep 18th, 2003, 08:26 AM
#4
I think I must be the one who is thick.... what does knowing APIs have to do with learning .NET?
Woka - I think it would depend on how much time you invest in learning, if you woirk with it for 8hrs a day, every day (during the work week) then 4-6 months is probably a bit long.... So far this year, I've spent a total of 2 hours working with C#.NET.... I now understand how it works a bit .... I did the typical "Hello World" app, all w/o a tutorial (actually I was writting one... it can be found right here .... but I digress.... I imagine you are talking about VB.NET.... VBCity.net has some good resources....
-
Sep 18th, 2003, 08:36 AM
#5
Addicted Member
i would say your estimate of 4-6 months for a good grip of the OOP fundamentals is fair. I have been using .NET for just short of a year and i think i can get away with most (?!) of it
Lots of examples out there. I think MSDN is as good as the next. There have been a few recomendations for books in this forum, check them out - especially the ones which focus on design patterns, because in my humble opinion this is the biggest challenge in shifting from VB6 to .NET. The syntax is fairly straightforward and you will grasp this well under your 4-6 month learnming period. Maybe even pick up a book on UML if you feel keen!
As for destroying objects - you only need to worry about this if your object is hoggin' a resource (say a DB conenction), otherwise the garbage collector will take care of cleanup. In short an object will not just die when you set the reference to nothing - it needs a little help from you the programmer. Java developers have been doing this for years.
Cheers...
-
Sep 18th, 2003, 08:42 AM
#6
-
Sep 18th, 2003, 08:55 AM
#7
what does knowing APIs have to do with learning .NET?
Large sections of the framework are just wrappers on existing API functionality - particularily the threading/waitable timers type stuff.
I am not happy with things like "garbage collectors"...as I like to have 100% control of what is created and destroyed and when it happens.
If you have a class that does something when it is terminated then you should give it a Dispose method and make it implement IDisposable...e.g.
VB Code:
Public Class Woof
Implements IDisposable
Public Sub Dispose() Implements IDisposable.Dispose
'\\ Do your cleaning up here...
End Sub
End Class
This is how things like controls that have to dispose of windows resources are coded.
-
Sep 18th, 2003, 08:58 AM
#8
Addicted Member
perhaps the 'set to nothing' was a little misleading - VB6 will destroy an object when it's COM ref count reaches zero. Setting the object ref to nothing does just that - resets the counter.
There are techniques out there to kill an object dead like forcing a garbage collection (although even this is open to debate as to whether the memory is truly freed) The thing is the GC is there to manage memory for you. If you machine resources are tight the GC will be called more often. It's no biggie.
I largely would go along with your opinion on books. I never learned anything from making online camera shops or step by step chapers on buiding orders databases BUT there are a few good reference books available. They list the possibilities and leave the rest up to you.
Lastly everyone differs on how they rate themselves - for me a year using a technology like .NET is not long at all. I wouldn't rate myself as advanced, others with the same amount of time under their belt might.
Hmmm....perhaps thats why my wages are 5hite <cough> i am now an ADVANCED .NET developer everyone!!
-
Sep 18th, 2003, 09:23 AM
#9
if u don't mind me asking, how much you getting paid for .NET?
Woka
-
Sep 18th, 2003, 09:35 AM
#10
Addicted Member
Don't suppose i do...
I've had my ups and downs - right now iam on LESS wages than during the golden years but round about the 27-28k (sterling) mark (depends a lot on bonuses etc.)
But strictly speaking iam not a PURE .net developer by trade. I turn my hand to Java (long time ago though!), Oracle, MS stuff, UNIX the ARSystems Remedy product etc and of late a bit of .NET. I am a jack(ish) of all trades master of none sort.
-
Sep 18th, 2003, 09:42 AM
#11
That's 8k more than me 
I am trying to get an 8k payrise but it looks like managers arn't gonna budge...Booooooooooooooooooooooooooooo
AND they won't go to .NET...they say Feb - June 2005...but that is MILES away, and i doubt they will do it anyways 
Woka
-
Sep 18th, 2003, 10:00 AM
#12
Sleep mode
Two weeks I think is enought since you have good grasp of VB6 . You'll find it so easy after the first week . For the API part , yes you need it while working on advanced GDI because the current GDI+ is basic and sux .
-
Sep 18th, 2003, 10:10 AM
#13
I'd say working on it 8 hrs a day you could do the same kind of work you do now in .NET after 1-2 months or so. And after about 4-5 months you'd be doing them more in a .NET fashion. One thing that I think makes .NET easier to learn is that its all OOP driven so if you learn the key concepts they apply to everything. For instance your terminate issue, all objects use the same model for destruction so once you understand how dispose works then you know how ALL objects dispose and EVERYTHING in .NET is an object. Also the use of interfaces and things of that nature make a lot more sense in .NET (at least to me) since it has all of the other OOP features too. Then interfaces become kind of like roles that an object can play. I also think that you have done a lot of class work in VB6 which will help you learn .NET faster.
As for your terminate event issue try this:
VB Code:
Public Class Wolf
Implements IDisposable
Public Function Howl() As String
Return "Aaaaawwwwwwwhhhhhhhoooooooo"
End Function
Public Sub Dispose() Implements System.IDisposable.Dispose
'you would release things here and it works like the terminate event
MsgBox("I'm done for!")
End Sub
End Class
'it is no longer bad to use New when declaring your object
Dim bigbad As New Wolf
MsgBox(bigbad.Howl())
'instead of setting it to nothing you call the dispose method
bigbad.Dispose()
'or if you want to you can still use nothing and dispose
bigbad = Nothing
MsgBox(bigbad Is Nothing)
Last edited by Edneeis; Sep 18th, 2003 at 10:21 AM.
-
Sep 18th, 2003, 10:29 AM
#14
Addicted Member
After programming in vb6 for 3 years, I started working for my present company and we developed our initial proptotype in vb6 in late 2002. In Feb 2003 (on the day of the official release of .net) I started a 1 month investigation/self-training in .net, and we re-wrote the app in .net. I reckon it took me 2 months to grasp the basics and after 4 months could write an app faster in vb.net than vb6. Once youve spent a couple of weeks with .net, you just won't want to bother with vb6 anymore.
You will find the trasition much much easier if you had made proper use of class's in vb6 to encapsulate your code.
Last edited by PeteD; Sep 18th, 2003 at 10:32 AM.
-
Sep 18th, 2003, 10:30 AM
#15
Actually this may work more like you want:
VB Code:
Public Class Wolf
Public Function Howl() As String
Return "Aaaaawwwwwwwhhhhhhhoooooooo"
End Function
Protected Overrides Sub Finalize()
' clean up code goes here
MsgBox("I'm done for!")
End Sub
End Class
Dim bigbad As New Wolf
MsgBox(bigbad.Howl())
Run the code and when you close the app the 'terminate' event will fire. If you want to track it there as well as have the ability to fire it at will then use the Finalize method as your event like here but also implement IDisposable like I showed before. Then you can force the terminate with object.Dispose or catch it when something else causes it to be disposed.
http://www.developerfusion.com/show/1047/3/
-
Sep 18th, 2003, 10:30 AM
#16
Addicted Member
Originally posted by Wokawidget
if u don't mind me asking, how much you getting paid for .NET?
Woka
32
-
Sep 18th, 2003, 11:43 AM
#17
PowerPoster
Just a recommendation, if your whole team wants to switch over, and management doesn't want to foot the bill for training, maybe you can compromise. What I mean is you could hire a .net architect and a .net developer for a project your company wants in .net. The architect can design the app to be fully oo and take advantage of the .net framework and the developer can assist and train your team as they develop the project.
Of course, a week or two of your team playing around with .net before hand would help a lot.
Sure, the cost of the architect and the developer will be more money, but your company wouldn't lose 4-6 months on training for the whole team because they would learn as they go.
I don't think there is any better way to learn .net than to actually do a project.
Just my opinion.
-
Sep 18th, 2003, 11:44 AM
#18
PowerPoster
Originally posted by Wokawidget
if u don't mind me asking, how much you getting paid for .NET?
Woka
I am asking $30 US an hour for a contract I am bidding for.
-
Sep 18th, 2003, 01:13 PM
#19
PowerPoster
A few months back, me and about 6 other consultants were billing out at $65 per hour on a .NET project.
-
Sep 18th, 2003, 01:35 PM
#20
A badger is for christmas, not for life...goes well with apple sauce!
So, if I set to nothing then the Dispose method gets fired?
Does it have to be public? I don't like the idea of manually typing that code it just for an event...if I manually do it then when I set to nothing does it fire it again?
wolka
-
Sep 18th, 2003, 02:07 PM
#21
To start off most items will not need to handle anything in a terminate event. This is intended for things like a database connection or window handle or something that is a resource hog. For normal items you really don't need to use Nothing or dispose the GarbageCollector will handle all of that for you.
But in more detail when the GC does its collecting it calls the Finalize method of an object, which is a protected (protected is private to all but children of that class and the gc) method in Object, and all objects derive from Object so they all have a 'hidden' finalize method. Now if you want to fire this yourself the implementing IDisposable is the proper how of doing so. This creates a Dispose method that should can call finalize and then tell the GC not to worry about that object (GC.SuppressFinalize(Me)). Keep in mind that the object can call Finalize directly from within itself, dispose is to allow that functionality to be called from outside the object.
So basically Dispose is just a way for outter objects to call the objects finalize method and finalize is basically the new Terminate event.
I should probably shut up now because I think I'm making it worse.
-
Sep 18th, 2003, 02:10 PM
#22
Re: A badger is for christmas, not for life...goes well with apple sauce!
So, if I set to nothing then the Dispose method gets fired?
No nothing gets fired until the GC collects the object.
Does it have to be public?
No it doesn't but there is no need for it if its not.
if I manually do it then when I set to nothing does it fire it again?
If you manually call the Finalize method then yes it will fire again when the GC collects unless you add the following line also:
GC.SuppressFinalize(Me)
Which tells the GC not to worry about it anymore and prevents it from firing again.
-
Sep 18th, 2003, 03:39 PM
#23
-
Sep 18th, 2003, 04:03 PM
#24
I don't want to move to .NET...I am scared 
Woka
-
Sep 18th, 2003, 04:23 PM
#25
Sleep mode
-
Sep 18th, 2003, 04:25 PM
#26
yay gay
when i started .net i did know 0 about win api and i was bad at vb6
even then i catched it up pretty pretty fast with a book i bought(for c#)
\m/  \m/
-
Sep 19th, 2003, 04:30 AM
#27
Addicted Member
One good reason for moving to .net is that you DON'T have to to know about API's.
Another good reason is that you don't have to worry yourself so much about setting objects = nothing and using Dispose methods. "Dispose" is not like terminate, it will not get called automatically. Calling it "Dispose" is just a convention anyway, you could call the method "Woka" if you wanted, it wouldn't make any difference.
Don't be scared. The thing I enjoyed most about making the switch to .net was the fact that it was good to learn something new. I needed a change, and I was sick of the vb6 IDE.
-
Sep 19th, 2003, 04:47 AM
#28
Ok...right lets clear something up as I am well confused...
I have a class called Users and a class called User...
So, I have the code:
VB Code:
Option Explicit
Private mcolItems As Collection
Public Property Get Item() As User
Get(ByRef Index As Variant)
Return mcolItems.Item(Index)
End Get
Set
'nowt goes here
End Set
End Property
Public Property Get Count() As Long
Get
Return mcolItem.Count
End Get
Set
'Nowt here
End Set
End property
Public Function Add(ByVal Username As String) As User
Dim objUser As User
objUser = New User
objUser.Username = Username
mcolItems.Add objUser
Add = objUser
End Function
'Dunno the class initialise, so I'll use vb6 code :D
Private Sub Class_Initialise()
mcolItems = New Collection
End Sub
Ok, here's a class in VB .NET...excuse the syntax as I don't know .NET and was just typing from the top of my head from what I have seen.
Anyways...I have this class referenced in a form...
What u are saying is that I can never toast this class, or the collection object OR the items held in the collection object UNTIL my app closes?!
As setting to nothing would not destroy the collection...?
This, to be fair, sounds absolutely ****ing stupid! Doesn't that mean it will start hogging memory? It also means I have to write more code as on the terminate event I may want to write some DB stuff or to an ini file, but now I manually have to code this in...>?
Woka
-
Sep 19th, 2003, 05:03 AM
#29
Addicted Member
VB Code:
Public Class Users
Inherits Collections.CollectionBase
Implements IDisposable
Public Overridable Function Add(ByVal userObject As User) As User
Me.InnerList.Add(userObject)
Return userObject
End Function
Public Overridable Function Remove(ByVal index As Integer) As User
Remove = CType(Me.InnerList(index), User)
Me.InnerList.Remove(Me.InnerList(index))
End Function
Public Overridable Sub Remove(ByVal userObject As User)
Me.InnerList.Remove(userObject)
End Sub
Default Public Overridable ReadOnly Property Item(ByVal index As Integer) As User
Get
Return CType(Me.InnerList.Item(index), User)
End Get
End Property
Public Sub Dispose() Implements System.IDisposable.Dispose
'do any cleaning up here, but you don't have to bother removing all your items as memory management is handled automatically if you inherit from Collections.CollectionBase.
'all you would do is use something like yourUsersObject = Nothing
End Sub
End Class
-
Sep 19th, 2003, 05:08 AM
#30
errr...
Why for the remove function/sub does one return the value and one = the value...whats the difference???
What is I want 2 collections in my class???
What does overridable do?
How does VB.NET know when I want to toast that class and all it's items in it's collection?
Woka
-
Sep 19th, 2003, 06:14 AM
#31
Addicted Member
Why for the remove function/sub does one return the value and one = the value...whats the difference???
>> Doesn't really matter. Return a value only if its usefull. I just copied and pasted one of my own collection classes and chaged the type to 'User' for your example.
What is I want 2 collections in my class???
>> Why? You could do this if you want, but this would not really be a collection class. When you inherit from a collection, then Users is a collection. Better to create another class, and have (as property's) two different collections. Please explain what you are wanting to do.
What does overridable do?
>> If you inherit from the User class, (e.g. an AdvancedUsers collection class) you can have a different implentation of the method if you wish. Overridable is optional, but if you intend to inherit from your Users collection class, then overridable gives you that option. Any good book on .net will give you all the info on this stuff.
How does VB.NET know when I want to toast that class and all it's items in it's collection?
>> You will have a _users variable somewhere. When you want to toast it use:
_users.Clear
_users = Nothing
-
Sep 19th, 2003, 08:05 AM
#32
I want 2 collections as I have a collection for cureent items and a collection my deleted items....tranasctional and n-teir programming...
So
Return objUser
Is the same as
FunctionName = objUser
????
Woka
-
Sep 19th, 2003, 08:39 AM
#33
Addicted Member
So
Return objUser
Is the same as
FunctionName = objUser
Yes, although the former is the preferred way.
Take a quick look at this for a quick reference. It has a small section on .NET object lifetimes. But make it quick. Fridays are not for reading or learning.
Cheers...
-
Sep 19th, 2003, 08:43 AM
#34
Cheers.
No fridays are for me to get shouted at coz my app doesn't work because someone has change the network and DNS servers...also HUGE database ****-up Arrrggghhh...what's going wrong *sob* I hate fridays...
I need drooooogs
-
Sep 19th, 2003, 08:46 AM
#35
Addicted Member
-
Sep 19th, 2003, 08:47 AM
#36
Addicted Member
something like this:
VB Code:
Public Class Users
Inherits Collections.CollectionBase
Implements IDisposable
Private _deleted As Users
Sub New()
_deleted = New Users
End Sub
Public Overridable Function Add(ByVal userObject As User) As User
Me.InnerList.Add(userObject)
Return userObject
End Function
Public Overridable Function Remove(ByVal index As Integer)
Remove(CType(Me.InnerList(index), User))
End Function
Public Overridable Sub Remove(ByVal userObject As User)
Me.InnerList.Remove(userObject)
_deleted.Add(userObject)
End Sub
Default Public Overridable ReadOnly Property Item(ByVal index As Integer) As User
Get
Return CType(Me.InnerList.Item(index), User)
End Get
End Property
Public Sub Dispose() Implements System.IDisposable.Dispose
'do any cleaning up here, but you don't have to bother removing all your items as memory management is handled automatically if you inherit from Collections.CollectionBase.
'all you would do is use something like yourUsersObject = Nothing
End Sub
Public ReadOnly Property Deleted() As Users
Get
Return _deleted
End Get
End Property
End Class
Last edited by PeteD; Sep 19th, 2003 at 08:55 AM.
-
Sep 19th, 2003, 10:30 AM
#37
Originally posted by PeteD
One good reason for moving to .net is that you DON'T have to to know about API's.
Another good reason is that you don't have to worry yourself so much about setting objects = nothing and using Dispose methods. "Dispose" is not like terminate, it will not get called automatically. Calling it "Dispose" is just a convention anyway, you could call the method "Woka" if you wanted, it wouldn't make any difference.
Don't be scared. The thing I enjoyed most about making the switch to .net was the fact that it was good to learn something new. I needed a change, and I was sick of the vb6 IDE.
Thats correct, "Finalize" gets called automatically and is like terminate. Dispose is just a method of exposing the finalize method external to the object.
But you shouldn't have to worry about terminate or =Nothing anymore unless you want to do something specific at terminate.
-
Sep 22nd, 2003, 09:26 PM
#38
Hyperactive Member
I studied for 8 hours a day for 4 weeks, and was able to pass the 70-306 and 70-310 exams. And then with another week or so of playing, and I was an expert with VB.NET. If you know VB6 then deffinitely go to VB.NET.
That would be a total of about 5 weeks. If you weren't going to pass the Microsoft Exams, and just learn it for your job, then you could probably do it in about 3-4 weeks.
Learning it all that quickly, I felt like a machine. I fell in love with .NET, so I guess that helped alot. 
And if you know how to use Win32 API calls, it is basically the same to use them in .NET as it is in VB6. The exams do not cover API calls at all. API's are not managed (.NET) code and Microsoft does not recomend for you to use unmanaged code in .NET.
-
Sep 23rd, 2003, 03:31 AM
#39
Addicted Member
But of course you will never have competely learned the language after n weeks. You may have learned enough to be fairly competant at what you want to do at that time, but the language is so vast (like so many languages), that you never acually stop learning, even after many years.
-
Sep 23rd, 2003, 04:56 AM
#40
Sleep mode
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|