- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
Quoth the poet Poe: "A Poem, pah"
Me no native speaker am
Admin
VB just sucks.
Admin
I'm not sure that's entirely true. Assuming that you know of a valid solution, the set of programs of smaller length is finite, and can thus be exhaustively searched for shorter solutions.
Admin
Or do you mean "Mr. Hankey, the Christmas Poe"? [image]
Admin
I'll throw out the same answer I do every time I see this question:
The pseudocode: if false and deleteEverything() ...
VB: Deletes everything
Every other language in existence: Does nothing
Just from personal experience, VB is uncomfortable to use. I was able to dive into PHP, Python, Lisp - hell - bash scripting too - and felt pretty comfortable once I got up to speed. I spent just as much time working in VB, and it still felt wrong. There's nothing I can really put my finger on - just a whole lot of small things that add up to a language that is not fun to program in.
The only language I've enjoyed less was ColdFusion.
Admin
Admin
Ok, I'm not a VB coder, but even I know that VB.NET introduced new short-circuiting operators andalso and orelse. Yes I think they're cumbersome, but they wanted to maintain compatibility, so changing the meaning of and/or was not an option....
Yes VB is verbose, and to a non-VB coder it seems strange. But perl seems strange to a C++ coder, and a python seems strange to a C# developer. French seems strange to a person that speaks Japanese, but both can convey the same ideas....
If you don't like the language, then don't use it and shut up about it.... Enough of the VB sucks threads, geez.
The point is the code snippet sucked, and it would suck in whatever language it was written in.... A good developer can write good code in any language they choose. A shitty developer will write shitty code every language they choose.... It's the skill of the developer, not the capabilities of the language.
-Me (stepping off the soapbox now....)
Admin
If a statement executes, then the whole statement is going to execute. You're compressing a second conditional into your if-statement, since you only want to execute deleteSomething() as
if false then... if deleteEverything() then...
You can certainly stick some "shortcuts" behind an immediate return language, but not knowing enough about the language you are writing in is no excuse for criticizing it.
Admin
"I pity the Foo!"
Admin
Actually I believe it's that there is no universal solution of "what's the shortest program solution for this problem". That is, you can't feed any program into a black box and have it spit out the absolute optimal solution. However, within the constraints of a given problem (say multiplying by two) you can look at the problem and realize the optimal solution (bit shifting).
Admin
who you callin an mfoo foo?
Admin
Actually I believe it's that there is no universal solution of "what's the shortest program solution for this problem". That is, you can't feed any program into a black box and have it spit out the absolute optimal solution. However, within the constraints of a given problem (say multiplying by two) you can look at the problem and realize the optimal solution (bit shifting).
Admin
This is my favorite part :)
Admin
Yeah, I'm sorry, but every time I read anything by "Derrick Pallas" I think of the Raven, and I could avoid posting the poem no longer.
Admin
Oh, and I do in fact have a bust of you above my chamber door. Sometimes I throw darts at it when I don't agree with you. ;-)
Admin
You need to be more precise. As stated, this is nonsense. Maybe what you're going for is something like
"In a formal system one cannot prove that a particular series of digits is of a complexity greater than the number of bits in the program employed to specify the series." -Chaiten/Kolmogorov
Admin
Functions that do not return a value? What's that? You can assign to the function name indeed, but since when did this become a WTF? It's quite different from Return'ing, because it doesn't return immediately.
If you're talking about modules, then: a) VB wasn't designed to be consistent with C#, and existed long before C#'s creation. b) AFAIK, MS added the 'static classes' (read: modules) to C#. So it's really C# that tries to be consistent 8=]. Besides, modules are a feature, not a bug. Not very OO, but not everyone wants to do OOP.
First, it's more readable, because once you stumble upon 'Dim' you know it's a variable declaration. Syntax highlighting helps a lot too, because Dim is a keyword, and most type names are not. Second, after you type 'As', IntelliSense is able to understand that you're writing a declaration, and to suggest a list of types. When type name is the first thing to type, you have no such luxury. Oh, and 'Dim mfoo as Foo()' declares an array of Foo.
Wrong. It declares three strings. And there's no ternary operator. Oh, really? Dim a() As Integer = {1, 2, 3} How cumbersome is this? Wrong again. The specification states that no By??? keyword indicates ByVal. Erm, I don't understand. It seems that it's like that in all major languages. Surely, placing an underscore *correctly* requires a tremendous amount of intellect as well as a ruler with micron marks. 8=]To sum up, I suppose that's just another case of Tool Blame. Let the flames begin!
Admin
Yes, all true.
But the original post was about why VB has such a bad rep - I threw out my ideas on that. I think my last point was the significant one. There's no one thing I can point to and say "This is why VB sucks". It simply is not as enjoyable to program in than other languages.
I picked up VB after having programmed in Java, Python, Perl, sh, C++, PHP, Coldfusion, Javascript - maybe a few others I haven't listed. I've jumped from language to language, and while I may have found the huge leap between C++ and Perl "strange", I certainly never found it uncomfortable. I found VB and ColdFusion to be in a class apart from the rest - the class where programming becomes work and mechanical - not fun and art.
And that's why - for me - VB has a bad reputation.
Admin
Yep, Chaitin is the one I was thinking of. My "conclusion" as quoted was derived from his writings (which I like very much, although not completely understanding them <grin>). For a more detailed explanation, I recommend going straight to the source -- http://www.cs.auckland.ac.nz/CDMTCS/chaitin/sciamer.html . A valuable excerpt can be found under Minimal Programs and Complexity.
Admin
I learned how to program. Then I learned VB.Net.
For some people it is concurrent or the opposite. That is the only issue with VB.Net.
As plenty of people have already mentioned, VB.Net has low barriers to entry for most kids who are goofing around and want to become programmers (assuming they are OK with pirating VS.Net). There is nothing fundamentally wrong with VB.Net.
Admin
You got that the wrong way round.
Strings should be everywhere and more solid support at CPU level for string processing.
Admin
Almost every other non-MS environment has a lower barrier.
Admin
By string processing, do you mean "performing date/time operations" too?
Admin
Pre-.NET VB? Okay, I can somewhat buy that. Though I still maintain it was good for prototyping, and not a terrible language for learning on as long as you had a good reference.
But whatever.NET? Even VB.Net is decent now, and C# is in contention for best-in-class language IMO.
Admin
Yeah, SNOBOL, bay-bee!
Admin
Did you know that:
... Mono has a VB compiler now?
(And compiled applications would run happily even before that.)
Admin
Far be it for me to put thoughts into the OPs head, but I think his point is that there is an inconsistency in how methods are declared in VB versus how they are declared in C#: in VB, there are two completely separate keywords (with two completely separate syntaxes) for defining two concepts which are, essentially, special cases of one-another; in C#, arguably, there is only one syntax (the only difference being that "Sub"s are void functions).
Also, as of VS2005, VB does not really complain about functions which do not, in fact, return a value on all code-paths; C# flags this as an error and terminates the compilation. (I cannot remember off of the top of my head whether VB flags a warning; I have not dabbled in that language for about a week, for which I am thankful.)
Sure, but static classes do not dump their static methods all up in the global namespace, something that VB modules do splendidly.
IntelliSense in C# 2005 is vastly superior to the IntelliSense in VB 2005: in most cases, if you are at a context in which you can define a new variable, the moment you start typing, IntelliSense brings up a menu of available keywords --- including all known types. Further, if you are going to play the syntax-highlighting card, C# actually highlights type/class names (and is able to highlight primitive types differently than class types, to boot), whereas VB does absolutely nothing. Readability is in the eye of the beholder: blatant verbosity, I find, gets in the way of expressing whatever it is that one is attempting to say, anyway. (Which is why I generally prefer type-inferred or duck-typed languages; all that type information, while useful for the compiler to optimize things, mostly just gets in the way, from a readability perspective.)
There are two reasons why I advocate C# over VB: anonymous methods (which allow for (albeit imperfect) closures and continuations) and fantastic (although, again, imperfect) nullable-type support; I find that the lack of those two concepts in VB --- at least, for the moment --- makes using VB very tedious. I have read a few blog entries that suggest some form of support for these two concepts is on the way with Orcas, but until that officially drops, I prefer to use the language which actually supports them.Admin
brilliant
Admin
To start with VB.Net you install VS.Net and you're up and running. It dumbs things down and abstracts thing ridiculously far (big pluses and minuses of course). Then you start dragging and dropping and you have a webpage.
Now let's install PHP. Ok I opened the zip file... now what? Oh I have to install Apache or IIS. Well I've heard of IIS before, let me try that. Ok, let me scroll through all these errors where it says this is incredibly unsecure to run... WHOA! That's a lot of comments on how to get this to work and they're all different. After 3 days of playing around with ISAPI filters and permissions, you realize most people use PHP and Apache together. Ok, so let me do this Apache thing.. ah hell this was obviously made for linux. Here are some comments and help on the online doco site... WHOA! That a lot of comments and they're all different again. Ok, let me look through this 800 line httpd.conf file and see if I can figure out which of the 200 directives apply to me. Oops I changed one I wasn't supposed to, let me download that again and retry this. What the hell, I just write crap in notepad now?
I've set them both up dozens of times. If VS.Net blows up... you're in trouble. But if it works it's a million times easier the first time around. Throughout the years I have enlisted the help of several PHP "gurus" and I got a whole bunch of "Let's try this... shoot. Ok let's try this... DAMNIT that worked last time! Let's try this..."
Admin
Just to throw a coffee table and a camera into the equation ->
PHP.NET on channel 9
Admin
Hang on, while I put on my fire suit.
A function that returns a reference type returns Nothing when you fall off the definition body. Functions return Object' -- a reference type -- by default.
It is a WTF the first time you encounter it, it is one of the many, many, many little pointless rules you have to learn when you are getting into vb which is the reason I insist that it isn't a basic language by any stretch. Anyway, the implicit return variable of functions is a left over for a time when VB didn't have functions as is the distinction between functions and subs.I think so too but I was pointing to a gotcha between C# and VB.NET for that person that said they are the same.
"I do the action that is having with this object which is a cat that is of black which is a color"
-- does not read easier than -- "I have a black cat"
More words != More readable
If you insist on using a keyword at least don't use an insult and it still uses a word too many and reads and looks backwards, yeah I know you are going to say this is subjective, ok so look at this:
Dim Name as String Dim Surname as String Dim Nickname as String
compare that to
my string Name my string Surname my string Nickname
And tell me it doesn't look tighter, cleaner, shorter and, well less "Dim Wit".
I have never found myself not knowing beforhand what kind of variable I want to declare when Im about to declare a variable. I doubt the situation arises that often.
I don't remember stating otherwise.
Is that so? Sorry I fell into one the countless gotchas of VB, if only I didn't to be a fucking expert to use the language.
I belive the behavior of iif was changed recently, if I'm wrong I'm sorry i'll go do more of the action which is of kind memorising.
Try with something without native sintax as Datatables, and arrays of more than one dimension. It doesn't scale at all.
No, other languages, including VB.NET use a reference system. It has reference types and value types, the caller must decide to box or unbox a value type if they want so, why making a distinction between value types and reference types if you are going to ignore it?
Well I tend to type operators without spaces but the underscore doesn't work that way and it bothers me, but it still doesnt make it nice to jump over the actual issue, having to write continuators even when is obvious the expresion is still open, like inside of parens.
Admin
I cannot imagine a better argument against using VB.NET.
True -- I'm not so hardcore as to use vi, but give me a command shell and PHP over an IDE any day. It's like coding HTML by hand -- you have to think about what you're doing when you have to type it out yourself...
Oh, and for an insanely easy WAMP platform that can be used as a frontend for autorun CDs and such, use Server2Go. Yes, you still have to use Notepad, unless you don't want to...
You know, just sayin'...
Admin
Like someone else here said, apparently some people aren't thinking about what properties the objects have they want to manipulate but how the serialization looks like.
Thus "how do I negate that number?" becomes "how do I get that funny line-y thing there?"
Admin
Yes you can write cleaner code by using notepad. As far as learning though, an IDE will always win over a plain text editor as long as you can control it.
Admin
Easy!
Admin
Why? Such a monstrosity could have been done in C# just as easily. The only difference is that most C# users have moved from C or C++, meaning they have development experience. VB users that move to VB.NET may have been some bozo that thought "I can draw a pretty interface".
Just like "guns don't kill people, people kill people" you could say that "VB doesn't create crappy code, crappy coders create crappy code".
Admin
I learned to code with VB.NET. I found that it is easier to understand for someone that doesn't know the syntax of the language. For example
Public Function DoSomething(ByVal arg As Object) as Whatever 'VB Code End Function
is much easier to understand for someone that has never seen VB in its life than
Public Whatever doSomething(Object arg) { //Java Code }
Why?? In VB you have much more information... You know first off that it is a function because it clearly says so. Instead in Java you MUST know (or be able to infer... something someone new to programming most of the time is not capable of doing) that after the Scope of a method comes the Type. Also in Java you must know that the braces define a block of code (something I find less obvious than End Function). Finally using the example above, with VB.NET you also know if the argument is passed by reference or by value. In Java you MUST know that arguments are always passed by reference, if not you might do typical newb (no insult intended) that changes a variable that should have been input only (you can also use Final, but hey... you MUST also know that).
In the end, I believe that VB is great for someone that doesn't know its syntax, since it’s not as obscure as Java or C#, or any other C for that matter. But I must recognize that if everyone is fully proficient in a language's syntax, then the benefit of VB's verbosity is greatly reduced.
Admin
If I had a dollar for every time someone said that...
Honestly, I like the framework (especially 2.0). Can't say I like VB syntax and some of its differing idiosyncrasies, but c# is wicked awesome.
Admin
Yeah, I am the WTF. Meant to quote someone dissing on VB AND the .NET framework.. now I'm just quoting myself. In the end, I shoulda seen it coming, it always does here, doesn't it?
Battle of the languages!
Ha, won't matter in 10 years. All your languages will be long dead, or changed beyond current recognition. :)
Power to the LINQ!
Admin
That's not exactly what ByVal means; in .NET, as long as an object is a reference type (which, by the bye, most types are; "value" types are generally primitive types), it is always passed by "reference" to a method. ByVal/ByRef (and the C# cousins, ref/out, although a subtle distinction exists here) simply alter whether or not you can assign to the original reference that was passed in; they do nothing to prohibit altering the properties of variables which are passed in. This differs from, for example, C and C++, where the passed variable is only updated if it were passed by reference or via a pointer.
Admin
All this VB trolling made me think ... why do we use different languages at all. I use many different languages on a daily basis, the answer is we use what is practical. You wouldn't use a F1 car to do the weekly shop and you wouldn't take a station wagon to do the Indy 500. Yes I did steal that old OS paradigm but what if programming/scripting/markup languages were cars:
FORTRAN : Ford Model T (first mass production) COBOL: < no idea - suggestions pls > LISP: < no idea - suggestions pls >
C : Dragster (most likely to cause you serious head injury) C++ : Ferrari (elegant - well bred, desired by many, understood by so few - often wrapped around a tree)
VB 3/4/5/6 : ?EITHER
Station Wagon (slow poor handling but still useful nevertheless. Nobody wanted one but everybody got married and had to buy one.)
OR
VW Beetle ( One for the masses, Built on the back of a fascist dictatorship, the engine's air cooled in the back - never gonna get you very far, very fast)
JAVA : Skoda (slow, ugly, but runs in most environments)
VB.NET - dodge from "the blues brothers" C# - the General Lee
JavaScript = Reliant Robin (a british oddity famed in "Only fools and Horses" - unsafe and missing a wheel but will get you somewhere 'undefined')
HTML = Citroen 2CV (stupid and ugly yet innovative. Rendered absolutely useless after 3years of it's ridiculous life)
XML = Toyota Corolla (ugly, yet popular, gets the job done but still something bugs you about it, slows down if you try to put too much in the trunk)
I would like to apologise in retrospect for the length of this post, I got carried away. I strongly encourage additions and modifications to this informal list ;)
Admin
But the question is should someone who doesn't know the language be programming in that language? After all, 99.9% of the WTFs are due to the programmer not knowing the language and it's libraries.
Admin
Yeah, but the issue is one of "best practices", which an IDE won't "teach". I like syntax highlighting and (limited) code completion. But I don't like my programming environment getting in my way or adding things to my code that I didn't ask for. What can I say? Old habits die hard, and when I started coding HTML, every K counted...
Admin
The irony (in the US sense anyway) is that they didn't even get that right. In .net there's only really an efficiency gain for stringbuilder over string if the number of concatonations is arbitrary. For a case like this where the chere are a set number of concats there's no efficiency gain. In fact, it migth even hamper the compiler from rolling them all into one operation at MISL level.
Admin
No no no! You're not consistent with yourself. It should have been (I don't know .NET, so let's assume strings have a charAt method just like Java):
:D
Admin
Your basing that on...?
I've used many porgramming languages, and if we're sticking strictly OO, .Net is actually the cleanest OO implementation i've ever used. It doesn't have the annoying hacks, bugs and eccentricities that C++ has, its far more useful than Java (just compare the depth and usefulness of the base class libraries!)...need I go on?
If you don't like the syntax of VB.Net (and, to be fair, my preffered language is C#) then you can use whateverdamn language you like, if they've written a compiler to target the platform.
Thats kinda that whole point.
On the VB Note, i've always thought of two types of people who use VB - "Programmers" and "Developers". VB Programmers think they can program because they learned how to drag, drop and click stuff in VB. These people are dangerous, and should be ejected from the profession on sight. Developers are programmers who know several languages, understand programming, program well, and choose to use VB for a specific task where it can be applied usefully.
After all, it is a RAD tool, which is sometimes what you need. No point in spending ages writing something in C, for instance, that you can do in five mins in VB, if thats all the task requires.
Admin
By the way, that was in reference to
which the forum software decided not to include in the post.
Admin
Your task now is to write a program capable of "realising" that a given program does the same thing as another. Considering some of the comments that come up in response to CodeSODs, I'm going to guess that it's not an easy thing for humans to do. Even for small programs.
Incidentally: as someone whose principal .NET language is C#, and whose last experience with anything BASIC-related was classic ASP VBScript in 2001 (and hated it) - a condition that is unlikely to change - is there any incentive for me to learn VB.NET? Basically, what's VB.NET got going for it that would make it attractive for the non-VB programmer?
Admin
Fascinating. I just download the PHP zip file and unpack it, download the Apache installer and run it, add three lines to httpd.conf and I'm done. But then, I guess I stop to think first and don't expect things to be dumbed down for me.
"Oops I changed one I wasn't supposed to, let me download that again and retry this."
Because naturally the first thing you do after you install something for the first time is that you delete the downloaded installer.
Admin
[quote user=rgz]I have never found myself not knowing beforhand what kind of variable I want to declare when Im about to declare a variable. I doubt the situation arises that often. [/quote] Conversely, I've often found myself wanting to type a variable name before I've declared it. Intellisense actively hinders me there. The frequency with which I have to hit 'escape' makes me think someone's trying to send me a message.