LOL @ Visual Basic

Joined
Feb 15, 2002
Messages
1,003
So, I'm totally struggling through my Visual Basic class.

Why in God's green earth did Microsoft ever think someone would seriously develop anything with this pile of crap?

Problem #1
Explode a text file into an array -- something you can do with 1 function call in other languages requires around 12 lines of code to do in visual basic.

Problem #2
Count elements in an array -- not with visual basic. You can use UBound to do it, but you have to subtract one.

What. The. Fuck.
 
Drbeagle said:
I don't think visual basic is the issue here. :rolleyes:
Me neither. More software is written in Visual BASIC than any other language.

Meanwhile, the Length property of the Array class gives the number of elements in the array without any pesky subtraction. (UBound? Is the problem that you're using VB 6 from 2001?)
 
three_sixteen said:
Problem #2
Count elements in an array -- not with visual basic. You can use UBound to do it, but you have to subtract one.

You mean this wasn't working out for you...

Code:
        Dim arr As String()
        'counts elements in dimension 0
        arr.GetLength(0)

I hate visual basic as much as the next guy but I'm not sure its at fault here...
 
three_sixteen said:
Problem #1
Explode a text file into an array -- something you can do with 1 function call in other languages requires around 12 lines of code to do in visual basic.
VB > j00

VB is not an untyped scripting language, if that's what you're trying to compare it to.
Code:
Imports System.IO
Imports System.Text.RegularExpressions

    Private Sub ReadAndSplit()
        Dim sreader As StreamReader = New StreamReader("somefile.txt")
        Dim ary() As String = Regex.Split(sreader.ReadToEnd, "\r\n")
    End Sub

I don't see 12 lines of code. :p
 
pxc said:
VB > j00

VB is not an untyped scripting language, if that's what you're trying to compare it to.
Code:
Imports System.IO
Imports System.Text.RegularExpressions

    Private Sub ReadAndSplit()
        Dim sreader As StreamReader = New StreamReader("somefile.txt")
        Dim ary() As String = Regex.Split(sreader.ReadToEnd, "\r\n")
    End Sub

I don't see 12 lines of code. :p

All of the examples I could manage to find had more than one line of code, which by the way, in PHP can be done with one line of code.

So you've all proven me wrong -- Visual Basic is the king of programming languages. It's beyond documented and makes life easier on the developer...

I think I'll stick to C++
 
mikeblas said:
Me neither. More software is written in Visual BASIC than any other language.

Meanwhile, the Length property of the Array class gives the number of elements in the array without any pesky subtraction. (UBound? Is the problem that you're using VB 6 from 2001?)

I'm using .NET
 
TheDude05 said:
You mean this wasn't working out for you...

Code:
        Dim arr As String()
        'counts elements in dimension 0
        arr.GetLength(0)

I hate visual basic as much as the next guy but I'm not sure its at fault here...


Spam posting

In this example
Code:
count = phxHas.GetLength(0)
        For i = 0 To count
            lbArray.Items.Add("(PHX) Phoenix has " & phxHas(i))
        Next
Length dosen't work?
 
I tried to call Length, when I try to compile it says that it's not defined. The same with GetLength..
 
three_sixteen said:
Spam posting

In this example
Code:
count = phxHas.GetLength(0)
        For i = 0 To count
            lbArray.Items.Add("(PHX) Phoenix has " & phxHas(i))
        Next
Length dosen't work?
LOL
Code:
For Each item as String in phxHas
    lbArray.Items.Add("(PHX) Phoenix has " & item)
Next
 
three_sixteen said:
All of the examples I could manage to find had more than one line of code, which by the way, in PHP can be done with one line of code.

So you've all proven me wrong -- Visual Basic is the king of programming languages. It's beyond documented and makes life easier on the developer...

I think I'll stick to C++

1) about 85% of the "hard" stuff that needs to be done in other languages takes about twice as many lines as VB usually does. VB does much of the hard work for you.

2) for the type of programming i do, i'll likely never use VB for anything outside of hobby stuff. it can't create a hex file to run on the HC11 or Z80, it's slow, and i don't know it all that well. i too enjoy c++.... but i'm with the others, i don't think VB is the problem here.

do you remember what B-A-S-I-C stands for? if you do, you'll realize that the microsoft developers have added a ton of functionality to a beginner's language that has now matured into a very quick way to get results for a complex task.

no docs? .....have you even SEEN the MSDN website?

edit: Problem #1
Explode a text file into an array -- something you can do with 1 function call in other languages requires around 12 lines of code to do in visual basic.

additionally, i would add that if you've got 1 function that does this in another langauge, i could probably also never use that language for anything other than a past-time.

it's not that i like to re-invent the wheel, but you're talking about a language that does things for you, and that just doesn't work out when you're programming hardware (even at a simple level).

does ANSI-C have this feature built in, anyone?
 
three_sixteen said:
All of the examples I could manage to find had more than one line of code, which by the way, in PHP can be done with one line of code.

So you've all proven me wrong -- Visual Basic is the king of programming languages. It's beyond documented and makes life easier on the developer...

I think I'll stick to C++

It appears to me that you were given the harsh response due to your inflammatory tone in the original post. Being the intelligent individual that you appear to be, you are surely aware that the people that develop programming languages need to make some trade-offs in their design. As such, each language likely has its own strengths and weaknesses. Let's also not forget that languages evolve over time and therefore some languages that people may consider "obsolete" at this point in time may have served their purpose well "in their time"; I am not saying the VB is an "obsolete" language.

Last but not least, don't forget that famous Quote:
Isaac Newton said:
If I have seen further it is by standing on ye shoulders of Giants.

With all that being said, I am not a VB fan either, since it appears so different from the programming languages that I use more frequently. Also, I have done hardly any VB programming at all, so my unfamiliarity has certainly tainted my view against VB for the time being.
 
IIRC, VB is still being marketed/targeted as a RAD language, much like Borland marketing Delphi. Companies make that decision; "let's just develop some quick apps we need much quicker and easier in VB than longer and harder (subjective) in anotehr language like C++ & MFC/etc".
 
Back
Top