A huge collection of VB6 WTF's (Warning: Long post!)



  • I'm a VB6 programmer, but I'm not too experienced, so I tend to make many WTFs :P I joined just to post this. Here are some from one of my most recent projects.

    A little background: it's a proxy server for an MMO (Furcadia- anyone heard of it here? Probably not..) which adds various features. However, being my first proxy (and one of my biggest programming projects yet) it's rather badly written. I'll list all the WTFs I found here.

    • Multiple characters were done by having a tabbed control and all character-specific stuff in a UserControl instance. Not very user-friendly..

    • The online list feature (which allows you to check when other people are online) worked this way:
      Every # seconds (could be changed), it would poll the server on instance 1. When instance 1 received the "player is offline" or "player is offline" message, it would trigger an event. The event would then use a For loop to send a message to the client informing it that the player was online, by triggering a method on every instance.

    • The code was untidily written. No indentation, and full of global variables.

    • This line alone describes the WTFness of the away mode: wskServer.SendData "desc " & Replace(Replace(Replace(Replace(AFKDesc, "#desc", desk), "#d", AFKDays), "#h", AFKHours), "#m", AFKMinutes) & vbLf (For some reason, it was indented. I lost track of all the If blocks in that timer event, and gave in and indented it.)

    • Else blocks seemed to have been unknown to me at the time: (Complete with stupid variable names! :))
      If cArray(temp) = Chr(34) & ".flip" Then
      If Flipzored = False And ScreenFlipd = True Then
      Flipzored = True
      ScreenFlipd = False
      wskClient.SendData TPTag & "Screen flipped." & vbLf
      wskClient.SendData "]|0" & vbLf
      List1.AddItem "Screen flipped."
      End If
      If Flipzored = False And ScreenFlipd = False Then
      Flipzored = True
      ScreenFlipd = True
      wskClient.SendData TPTag & "Screen flipped." & vbLf
      wskClient.SendData "]|1" & vbLf
      List1.AddItem "Screen flipped."
      End If
      Flipzored = False
      cArray(temp) = ""
      End If

    • Weird message parsing:
      If AFKSet = True Then
      If InStr(1, sArray(temp), "<font color='whisper'>[ <name shortname='") > 0 Then
      afkwhifind = InStr(1, sArray(temp), "shortname='") + 11
      afkwhifind2 = InStr(afkwhifind, sArray(temp), "'")
      afkwhishortname = Mid(sArray(temp), afkwhifind, afkwhifind2 - afkwhifind)
      afkwhifind = InStr(afkwhifind2, sArray(temp), ">") + 1
      afkwhifind2 = InStr(afkwhifind, sArray(temp), "</name>")
      afkwhiname = Mid(sArray(temp), afkwhifind, afkwhifind2 - afkwhifind)
      wskServer.SendData "wh " & afkwhishortname & " " & Replace(Replace(Replace(Replace(Replace(AFKWhisper, "#player", afkwhiname), "#d", AFKDays), "#h", AFKHours), "#m", AFKMinutes), "#s", AFKSeconds) & vbLf
      End If
      End If

    While I gave up on this mass of code, I decided to rewrite it.

    A few WTFs from the new version: (I had to work hard to find them)

    • To store Boolean values easier in settings files and Boolean variables without using a pile of IIf functions, I created these:
      Public Function GetBool(FakeBool As String) As Boolean
        If FakeBool = " " Then GetBool = True Else GetBool = False
      End Function

      Public Function SetBool(RealBool As Boolean) As String
        If RealBool = True Then SetBool = " " Else SetBool = " "
      End Function

      Public Function GetNumBool(FakeBool As Integer) As Boolean
        If FakeBool = 1 Then GetNumBool = True Else GetNumBool = False
      End Function

      Public Function SetNumBool(RealBool As Boolean) As Integer
        If RealBool = True Then SetNumBool = 1 Else SetNumBool = 0
      End Function


      The GetBool function turns a value destined for the settings file (Alt+0160 = true, space = false) into a Boolean variable. SetBool does the reverse.
      The GetNumBool function turns a value from a CheckBox's value property into a Boolean variable. SetNumBool does the reverse.

    • A rather inefficient INI parsing engine.
          Open App.Path & "\Goom2.dat" For Input As #TempInt
          'Here comes the INI parsing engine.. Yes, it's not good. :X

          Do Until EOF(TempInt)
            'Read in data lines...
            Input #TempInt, TempStr
            FileData = FileData & TempStr & vbLf
          Loop
          FileArr = Split(FileData, vbLf)
          For TempInt2 = LBound(FileArr) To UBound(FileArr)
            'Now parse it!
            If Left(FileArr(TempInt2), 1) = "[" And Right(FileArr(TempInt2), 1) = "]" Then
              'It's a section..
              SectionName = Mid(FileArr(TempInt2), 2, Len(FileArr(TempInt2)) - 2)
            ElseIf FileArr(TempInt2) = "" Then
              DoNothing "Obvious reason :)"
            ElseIf InStr(1, FileArr(TempInt2), "=") = 0 Then
              DoNothing "MALFORMED INI FILES FTL"
            Else
              'It was fine..
              TagStart = Mid(FileArr(TempInt2), 1, InStr(1, FileArr(TempInt2), "=") - 1)
              TagData = Mid(FileArr(TempInt2), InStr(1, FileArr(TempInt2), "=") + 1)
             
              'Now let's parse what we got..
       (insert huge Select Case block here to load all the values)
                  End If
              End Select
            End If
          Next TempInt2
        Close #TempInt

    I haven't anonymised these, since I don't need to. They're all my own code, so why? ;)
    I'll probably post more soon..



  • wait... you posted your own list of WTFs?



  • Yes. I thought it was allowed?



  • It is, as far as I know, it's just that most people don't.  Not a bad idea, though, since you can explain them better than if they were someone else's WTFs.



  • Well, admission is the first step to recovery as they say.
    Most of your "WTF"s look like a simple lack of knowledge/experience for me though. Two things you should do IMO are:

    1. Learn to structure your program. Start with giving your variables meaningful names avoiding things like "sArray" and "TempInt2". Yes, I know it's hard to think of good ones but take the tike, it's worth it. Naming conventions can also help. For example, the counter variable in (for) loops is traditionally called i (j, k... if you have nested loops).
      You already did well dividing your code salad above into several subroutines. Continue this and go further: Try to divide your program into seperate logical units and put them into seperate modules. Finally, learn about Object Oriented Programming (if you haven't already) and organize your program in class modules. It may seem as a hassle, but it will greatly help you to keep track of everything.
    2. Avoid the Not Invented Here syndrome: Check if there are existing functions that do what you want to do before writing your own. VB has builtin conversion functions CBool and CString for example that mostly do what your GetBool and SetBool functions do. As for your ini reader, well, thanks to VB's total lack of regexps, it's not even that bad for an implementation. (Aside from first storing the whole file in memory and then looping over it again for each char... ahem). But you don't need an implementation at all, since the Windows API already has the general purpose INI functions <font size="-1">ReadPrivateProfileString and </font><font size="-1">WritePrivateProfileString that do exactly what you need. Google them.</font>

    <font size="-1">I think there is no one here who didn't produce things like this when he started. This is completely normal though, don't get yourself upset about this.</font>
    As for Furcadia, btw, never played it but I heard about it "indirectly" via DMFA. Sounded fun. 



  • @Treeki said:

    A little background: it's a proxy server for an MMO (Furcadia- anyone heard of it here? Probably not..)

    Is it?

    ...Yep, it's an MMO for furries. :\

    You know, they have another one of those, it's called "Second Life"

    Also, what PSWorx said.



  • @PSWorx said:

    <font size="-1">I think there is no one here who didn't produce things like this when he started.</font>

    How true.  I remember rewriting basic string functions (like strlen, strcpy, strncpy, etc.) and creating huge global buffers since I didn't know how to use malloc when I made a basic web server to get familiar with sockets programming in Linux.  Maybe I should post the source here sometime. 



  • These are all mistakes I made when I first started programming (VB6 was my first real language, before that was csh/ksh scripts and batch files in DOS). I wrote my own Replace( ) and Trim( ) functions, used truly awful variable names, On Error Resume Next everywhere with no error-trapping (nah, just skip it and keep going), I believed global variables were more memory efficient... I have certainly come a long way. There are some programs I wrote years ago still in use today that deal with INI parsing in an eerily similar way to how you do it. I don't like the mentality of "if it ain't broke don't fix it", in my case it's "if there ain't funding, you can't do it on company time".

    At least you used the "Open file for input as #" format of file I/O. I had a lot of time invested in ASP, so all I knew was Scripting.FileSystemObject. To this day I don't know how to do it using the way you did, and that's pretty basic knowledge.

    I don't think research is the issue, because I always found it difficult to search for potential built-in functions that do what I need. I'd just happen to notice something in sample code, and then I'd learn about using that feature instead of my own home-grown crap. Don't worry, you're stuff isn't hopeless, it will get better with experience.

    Use global variables as little as possible, name your variables and form controls with a standard convention (prefix string variables with "str", listboxes with "lst", etc), indent your code a bit for better readability. But now I'm curious to try out this game. Perhaps this post was just a ploy to get new members...



  • @Volmarias said:

    @Treeki said:
    A little background: it's a proxy server for an MMO (Furcadia- anyone heard of it here? Probably not..)

    Is it?

    ...Yep, it's an MMO for furries. :\

    You know, they have another one of those, it's called "Second Life"

    Also, what PSWorx said.

    Furcadia was released December of 1996, and SL was released in 2003.

     


     



  • Since so many people have replied while I've been gone, I'll address most.. 

    It's not a ploy to get new members, I assure you. :P I just wanted to give a little background on what this code was for. But I don't really want this topic to derail into talking about Furcadia, more on my noobish WTF's.

    On the use of the Open statement: I learnt that from QBasic, which was what I first started programming with. Back then, there was none of this Scripting.FileSystemObject thing. (But Scripting.Dictionary is useful.)

    On my abuse of Temp(insert type here) variables: I find them nice, since I don't need to keep adding Dim statements for every variable I need to use. Plus, I don't want to use too much memory by Dimming stuff I don't use (two Functions in particular are called for every single line of text sent from/to the client).

    On how Furcadia is a furry MMO: I don't have the exact quote, but the Wikipedia article for it states many of its members are not part of the furry fandom, including me. Look beyond that stuff and it's a solid game which was intended for roleplaying, but can be used as a chatroom. It can be completely customised and you can make maps and script them, plus change almost every graphic in the client. Third party programs like bots and proxies are also supported, unlike most MMOs (that I know of).

    On my weird way of handling the INI files: I'll probably change that.

    On finding built-in functions: I totally agree. I don't have VB6 help, so the only resource I have is MSDN, which does not list many things (still trying to find documentation there on the CString and CBool functions someone mentioned)

    To everyone who tried to help me: thanks. :)



  • Just don't re-implement Split(). I came across some old code of mine the other day that I'd written a SplitString() function in... I think we've all done that before.

    Oh, and a great one from the same code... a function to calculate a checksum that returned a high and low nibble in two variables. But rather than returning them as values from the function, for some quite unknown reason I was setting two global variables from inside it instead. I have no idea why I did that. All other functions were "normal".

     



  • 2 Comments: 

    1. You CAN use RegExps in VB6... Just add a refference to it and you are set...
    2. Also the "internal" split has some problems with quoted text that contains a delimiter in it


  • Wait, it's possible to return two values from a function? :O



  • Yes and no. You can't return multiple values directly in VB. You can however:

    Put the return values into multiple global variables - that's what he did. Very ugly and considered a WTF in 99.9% of all occurances. Don't do this.

    Declare (some) of your parameters as ByRef ("By Reference"). If you then assign new values to the parameters in your functions and if the function was called with variables for those parameters, the new values will be passed to the variables outside. Example:
     public sub scale(ByVal factor as Integer, ByRef x as Integer, ByRef y as Integer)
          x = factor * 2
          y = factor * 10
     end sub
     ...
     dim a as Integer, b as Integer
     scale 10, a, b
     'a is now 20, b is now 100.
    result1 and result2 would be commonly called "output parameters". It's a rather old technique that was mostly used in C as far as I know (someone correct me if I'm wrong). I'm mentioning it here more for completeness, since it's a rather inelegent technique today that can lead to some nasty surprises if you call a function with variables and don't expect them to be changed. (You can always prevent the variables from being changed if you put a ByVal in front of them when CALLING the function. That is, had you written [code]f 10, ByVal a, ByVal b[/code], they would still be 0 after the call.. But if you dare to forget that once... you get the point...)
    If you use it, be careful and try the two following techniques first.

    Return a (single) value that consists of a Type/Structure. This is usually the way to go if you "just" want to return multiple values. A structure (or "type" in VB) is a data type that consists of multiple data fiends. You need to declare what fields you need before you can use it. For more information, google "VB Public Type" or something.
    The example from above:
    public type Point
        x as Integer
        y as Integer
    end type

    public function scale(factor as Integer) as Point
        scale.x = factor * 2
        scale.y = factor * 10
    end function

    Instead of a structure, you can also use a class (module). For the simple purpose of storing structured data, the two work pretty alike though a class module is much more.  
     



  • Read Code Complete Rev 2



  • Please don't worry about diming your variables instead of using Temp. It will make you a MUCH better programmer. As much as possible it is good practice to try to dim them where they are going to be used. I'm not saying you can't reuse a variable in a function, but I wouldn't worry about your concern about using memory by dimming variables. Also, without getting too long, name your variables according to what they would be used for (its ok to use i, j, and k for loop indexers). I know it seems like extra code (and in some cases more than necessary), but it will make the maintenence so much easier, and if anybody (including yourself) had to go back and read the code, they will appreciate it so much.  



  • What I should've mentioned in my "setting two global variables from a function" bit was that as I was just returning the high/low nibbles for a checksum, what I was doing with those values was concatanating them back together again right after the function was called.... so the whole thing was a) WTF and b) pointless. I guess a) and b) usually go together!

     I'm not that bad now, honest!
     



  • Your code isn't too bad :)  I would look into some better error handling (On Error Resume Next / On Error Goto 0 / If Err.Number <> 0 Then / etc. ) to prevent leaks and such, but it's overall pretty good.

    I did some googling for you...

    VB6 Reference
    http://msdn2.microsoft.com/en-us/library/aa338032(VS.60).aspx

    I couldn't find CString or CBool in the VB6 documentation, but it's in the VBScript docs; I think it is the same between the languages...
    CStr: http://msdn.microsoft.com/library/en-us/script56/html/25333070-f879-4904-9fa7-2f2d4e4762ce.asp
    CBool: http://msdn.microsoft.com/library/en-us/script56/html/ff782ecb-f15f-4e3c-a28e-43670557de40.asp



  • What is the advantage of VB6 over VB.NET?



  • @Ice^^Heat said:

    What is the advantage of VB6 over VB.NET?

    MTS support of course...



  • @Ice^^Heat said:

    What is the advantage of VB6 over VB.NET?

    As far as I can see, nothing. I've tried VB2005, and immediately gave up. I'm not about to rewrite over half of my project just for the so-called advantages of .NET. I'm familiar with VB6, it works fine for me, and I ran into many problems when I tried to convert my program.



  • @Treeki said:

    @Ice^^Heat said:

    What is the advantage of VB6 over VB.NET?

    As far as I can see, nothing. I've tried VB2005, and immediately gave up. I'm not about to rewrite over half of my project just for the so-called advantages of .NET. I'm familiar with VB6, it works fine for me, and I ran into many problems when I tried to convert my program.

    Have you ever heard about so-called object-oriented programming?

    I would never ever return back to VB6, but unfortunately I still have to maintain my old VB6 applications and that is a true P.I.T.A.
     



  • @Ice^^Heat said:

    What is the advantage of VB6 over VB.NET?

    Well, I can think of three immediately:

    • VB6 apps are a lot easier to deploy (yet): They just need the VB runtime, a single dll of about 1.5 MB, instead of the huge .NET framework. (Which also gives the benefit that VB6 apps will by default run on pirated computers :p) You can slip that file really easily into your installer and the user will never notice any actual difference from a runtime-less application.
    • VB6 uses some kind of exotic execution system: If you deploy/"save exe" an application, it gets compiled into machine code. However if you run it in the IDE it is interpreted. That may sound strange and is in fact reason for a few exotic behaviors if you deal with the windows API but it has the benefits that the debugging is REALLY convenient: No need to compile programs for test runs, just hit "run" and the action starts, you can literally "pause" the program and jump into breakpoint mode any time by clicking the "pause" button and you can CHANGE CODE while in breakpoint mode. When you continue execution, the program will continue with the changed code as if nothing had happened.
    • I don't think there is any other compiled language that makes it that easy and comfortable to use/create COM objects. Just add the appropiate static references into your project (or create them ad-hoc using CreateObject() if you must) and use them exactly as native VB objects. The other way around, just declare your class module as "public" and you have a perfectly valid COM object. The convenient debugging extends to COM objects as well, even if those are used/hosted by other applications.

    In general, I'd say that VB6 and VB.NET are really two completely different languages. VB6 is the very last installment of the old BASIC series, including the old quirks like line(x1,y1)-(x2,y2) (actual syntax for the line function) while VB.NET is just the VB "skin" for the generic Java-ish .NET languages.



  • Isn't COM dead?



  • Not at the time VB6 came out :p

    As for today, I'd rather call it "undead". It isn't developed anymore but there are still many programs that use it extensively. And almost all extension points in Windows XP are based on it. So if you want to write a shell extension or a plugin for internet explorer there is no way around it. I think Microsoft originally wanted to end support for it this year or last. But they found they couldn't because too much stiff still depends on it...



  • @PSWorx said:

    • VB6 uses some kind of exotic execution system: If you deploy/"save exe" an application, it gets compiled into machine code. However if you run it in the IDE it is interpreted. That may sound strange and is in fact reason for a few exotic behaviors if you deal with the windows API but it has the benefits that the debugging is REALLY convenient: No need to compile programs for test runs, just hit "run" and the action starts, you can literally "pause" the program and jump into breakpoint mode any time by clicking the "pause" button and you can CHANGE CODE while in breakpoint mode. When you continue execution, the program will continue with the changed code as if nothing had happened.

    Microsoft Visual C++ (at least 2003 and later, maybe some earlier versions) supports pausing an app, changing code and continuing, but you need to turn it on. It's called "edit and continue" unsurprisingly.

    And that's in a compiled language. 



  • I remember when I tried to convert some of the old games I wrote in VB6 to VB.NET.  I had extensive use of GDI so most of the 'important bits' wouldn't work, since use of the form's device context handle has been replaced by using the Graphics object.  Which is nice, but too much work to bother.  Plus I've decided that those games aren't really much good now that I know better, so the code's just sat there untouched for ages.  My only use of VB.NET since is because one of my units at uni required it for some reason (because the lecturer wanted us to use a Winsock control to do networking...)

    Most of the other programming units have used C# (and lately C# 2.0), apart from some C and Java in first year.  And of course some C++ (for OpenGL) and most recently C++ with Lua in Games Programming Techniques (yay).

    I also remember making, for an assignment, and interesting Javascript abomination that replaced all the occurrences of most of the words with a link (with the word as teh text) to the next occurence of the word (the last one being a reference to the first occurrence on the 'next' page.  Of course, it didn't need to know where the next word was, since each tag had an id which was the word with a number after it.  Also due to the way I did it, it didn't need to actually know how many occurrences of the word there were.  It just called a function in the onload event, and passed a list of the words to linkify and the next page that each one occurred on.

    This was done because having the links saved in the document was extremely redundant, since each word appeared three times (in text, in the link to the next word, and in the tag id (or was it name... whatever)).  Of course, it took a long time to load a page.  Oh, and the pages were generated by a Java program which took a bunch of MS Word documents, processed them to find the keywords, and then converted them to xhtml (I think via OpenOffice somewhere in there...)

    Our lecturer, who was interested in automatically-generated dense-linking, said we (it was a group assignment) were one of the most technically competent groups (we were, it was just a stupid assignment, plus i only happened to be learning javascript that semester).  On the other hand, he'd somehow forgotten how Java hashtables work and seemed to think it required you to actually touch hashcodes... and don't get me started on the documentation system we had to use.

    This wasn't meant to be this long... say, I wonder if I can find my code... yep, it's still under version control after over a year.  I'll make a new thread since it isn't VB

     

     



  • The main advantage of .Net is the improvement of true object oriented languges. VB6 now can have true classes, and supports operator overloading. In addition, the CLR allows almost all .Net languages to share the same function calls. You really have to dive into .Net to get the feeling of the amount of possiblities it exposes to you. There are classes available for database, network communication, File I/O, operating system calls, graphics, you name it. No more dropping controls on a form that was just a transparent wrapper to a class (comm control, winsock control, adocontrol).  It is easy to instantiate equivalent objects in .Net and it doesn't take nearly as much overhead.  Generics also have helped us make modular classes that can work with multiple types. VB can now take advantage of class and interface inheritance, which allows code to be reused. Although it takes some adjustment for previous VB programmers, the advantages have been worth it. Learning new things is almost a prerequisite for being in this field anyway. VB 6 is for dinosaurs :)



  • One last thing for VB6 advantages... Mutithreading... try making a thread in VB6 this easy

    <FONT size=1>

    dim mThread as </FONT><FONT color=#0000ff size=1>New</FONT><FONT size=1> Thread(</FONT><FONT color=#0000ff size=1>AddressOf</FONT><FONT size=1> ProcessMethod)

    mThread.IsBackground = </FONT><FONT color=#0000ff size=1>True

    </FONT><FONT size=1>

    mThread.Name = </FONT><FONT color=#800000 size=1>"My Processing Thread"

    </FONT><FONT size=1>

    mThread.Start()

    </FONT>

     

    and the code running on the thread is

    <FONT color=#0000ff size=1>

    Private</FONT><FONT size=1> </FONT><FONT color=#0000ff size=1>Sub</FONT><FONT size=1> ProcessHardware(</FONT><FONT color=#0000ff size=1>ByVal</FONT><FONT size=1> state </FONT><FONT color=#0000ff size=1>As</FONT><FONT size=1> </FONT><FONT color=#0000ff size=1>Object</FONT><FONT size=1>)</FONT>

    <FONT size=1>.... your thread processing code here

    </FONT><FONT size=1>

    </FONT><FONT color=#0000ff size=1>End</FONT><FONT size=1> </FONT><FONT color=#0000ff size=1>Sub

    </FONT>


  • @pitchingchris said:

    You really have to dive into .Net to get the feeling of the amount of possiblities it exposes to you. There are classes available for database, network communication, File I/O, operating system calls, graphics, you name it.

    Wow. File IO and everything. It's almost like a real programming language.



  • @asuffield said:

    @pitchingchris said:

    You really have to dive into .Net to get the feeling of the amount of possiblities it exposes to you. There are classes available for database, network communication, File I/O, operating system calls, graphics, you name it.

    Wow. File IO and everything. It's almost like a real programming language.

    I was just making the point that it allowed you to do a lot of things more generically using the objects themselves. Most VB programmers if they have to use ethernet, they just dropped a winsock control on the screen.  If they needed 10 sockets, they just dropped 10 controls. My only point is that as long as you know the namespace where your functionality resides, it is pretty easy to get something up and running once you have played around with a few classes. It is much easier to design it object-oriented from the get go with VB.Net. Try doing inheritance with VB6.  I'm a C# guy myself, but since I work with several VB.Net program, it is easy for us to wrap our stuff in classes and share code between the languages.

     



  • @PSWorx said:

    @Ice^^Heat said:

    What is the advantage of VB6 over VB.NET?

    Well, I can think of three immediately:

    • VB6 apps are a lot easier to deploy (yet): They just need the VB runtime, a single dll of about 1.5 MB, instead of the huge .NET framework. (Which also gives the benefit that VB6 apps will by default run on pirated computers :p) You can slip that file really easily into your installer and the user will never notice any actual difference from a runtime-less application.
    • VB6 uses some kind of exotic execution system: If you deploy/"save exe" an application, it gets compiled into machine code. However if you run it in the IDE it is interpreted. That may sound strange and is in fact reason for a few exotic behaviors if you deal with the windows API but it has the benefits that the debugging is REALLY convenient: No need to compile programs for test runs, just hit "run" and the action starts, you can literally "pause" the program and jump into breakpoint mode any time by clicking the "pause" button and you can CHANGE CODE while in breakpoint mode. When you continue execution, the program will continue with the changed code as if nothing had happened.
    • I don't think there is any other compiled language that makes it that easy and comfortable to use/create COM objects. Just add the appropiate static references into your project (or create them ad-hoc using CreateObject() if you must) and use them exactly as native VB objects. The other way around, just declare your class module as "public" and you have a perfectly valid COM object. The convenient debugging extends to COM objects as well, even if those are used/hosted by other applications.

    In general, I'd say that VB6 and VB.NET are really two completely different languages. VB6 is the very last installment of the old BASIC series, including the old quirks like line(x1,y1)-(x2,y2) (actual syntax for the line function) while VB.NET is just the VB "skin" for the generic Java-ish .NET languages.

    You are right about the first one, but C# also supports Edit and Continue, and you can just add one attribute to your assembly and you can use it in COM.



  • Alright, didn't know that. I take those back then :)



  • C# edit-and-continue is just a shortcut to automatically recompile and re-run your project after you make a change.  This is not the same edit-and-continue that VB6 does.



  • @RaspenJho said:

    C# edit-and-continue is just a shortcut to automatically recompile and re-run your project after you make a change.  This is not the same edit-and-continue that VB6 does.

    That might be the case in C# 1.0 / VS 2003, but it pretty much works the same way as VB's in 2.0 / VS 2005.  Only in certain cases do you actually need to recompile like editing interfaces, method signatures, etc.  For the most part, code internal to a method can edited at will.

     


Log in to reply
 

Looks like your connection to What the Daily WTF? was lost, please wait while we try to reconnect.