- 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
Admin
Finaly someone who can make sense. I tried to write something similar, but it just came out as "VB SUXXORZ HARDCOREZ!ELEVENTYONE" so i'll just quote you instead.
Admin
I remember one in particular - the way hash tables are treated in VB. It's just - awful. Adding a value was via c.Add("Key", Object) (or Object, "Key", I don't want to remember), where c is a Collection object.
How do you /change/ a collection item? You don't. You /remove/ the Object, and you add a new one with that key.
How do you check whether a given key is in the collection? You can't. Not directly. You can try accessing the key, and catch the error sic.
Which reminds me, error catching is one of those other godawful things. GoTo? Seriously?
Admin
I've been programming since 1968: ALGOL, FORTRAN, COBOL, two or three varieties of mainframe assembler, BASIC, VB, VBA, 68000 assembler, VScript, JScript, Java, VB.NET, PHP, ASP ... I think that's it; I used the language required by the job - never had a job where I needed to do any flavor of C although I've wanted to try it.
What I've learned:
[captcha: facilisis - a facility affliction?]
Admin
Hey now, variable variables are just like a sort of pointer. You want to hate on PHP, hate on register_globals or magic_quotes or the total lack of namespaces (until recently) and consistency in function names and parameters.
Admin
I think Raw says it stands for "RAD"
Admin
WOW Niklaus made it so a two-byte signed integer could exceed 32767? That is quite an accomplishment.
Admin
At the local university here they use VB for the first 2 years of a comp sci degree. After that they use .Net and C++ depending on what stream(s) you take..
Admin
This made me cold all over. Please make it stop.
Admin
Not having read all the comments, but I think if the code for timer is placed in the getter part, it would make perfect sense.
If (Not IsDemo) ' In demo mode, a number of milliseconds will past, pretending some task is done ' Do actual task End if
CAPTCHA: acsi. Isn't it ASCII or ANSI?
Admin
Sorry to knock you off your soapbox Alex, but in this case the programmer really is to blame. Code that doesn't do what the identifiers and structure suggest is a dime a dozen klocs. Properties can be a useful tool to document that certain members of your class behave in a certain manner. Nothing wrong with that. They (and their access syntax) also solve a subtle problem that several other languages have. Consider a class with a field x that must be publicly accessible. Most books urge you to make x private and add public getX and setX methods. Why? Because if it turns out you ever want to do some processing if x changes, and you used a public field, you're screwed. In VB this problem can't happen. Now, from a language design perspective I wonder if the End Get syntax was a good idea. Since there can be no code inside properties outside the accessors, it would have made much more sense to just use Get and Set statements (without End Get and End Set). After all, there is no such thing as End Case either. Pursuing that line of reasoning a bit further, most non-WTF properties will have exactly one getter and one setter. So one could argue that the Get statement could be dropped, which would also enforce a consistent accessor order. In the rare case that only one of them is present, one could use a modifier on the Property statement (VB classic style) although I'm not convinced of the merit of such properties.
Admin
Not like when VB6 used the same compiler and virtualised environment (Visual Studio and Windows) as Microsoft C.
After all, C was a well know inefficient and slow language (when compared to Pascal or FORTRAN).
Admin
Wow. This is just plain wrong.
There ARE features unique to C# ("unsafe" code, default indexer syntax without introducing a new magic property) ... as well as there are features unique to VB (indexed properties). I like those of C# better.
Admin
The reason we have less than perfect tools like VBA is largely because of history. These things did not just get designed this way, they evolved over time. Much of the time they were trying to be as backwardly compatible as possible. Other times a decision was made, and now we live with it.
In the past, Office applications, as well as those by other vendors, would have their own custom scripting programming language.
For an application like Excel, you want a scripting language. C++ isn't one so wasn't appropriate at the time. VB isn't exactly a scripting language as such but is closer to one - quick interpretation into small units, in-built variant types. You need a variant type as Excel cells can contain any type.
You also often want rapid development rather than building the perfect solution. VBA provides a solution for small-scale programming in a spread-sheet.
Admin
Sorry...
Not an ARRAY reference at -e line 1.
Error, try again.
Admin
You really should thank MS for vb. All Kids and beginners would use C#, Java or C++ instead. And if this happens, we are all doomed. xD
Admin
Define "real software". You are probably right that in most cases it is unsuitable for shrink wrapped or "enterprise grade" software. But "real software" is more than that IMO.
VB has its limitations but it is useful for the casual "programmer" who wants to build something for themselves or say a small community of users.
Also small/medium businesses use applications built in VB and other such tools. They have low upfront costs in general compared to much larger more "robust, extensible, portable etc" solutions.
Anyway some of you can sneer away - I am sure it makes you look more attractive to chicks if you dis VB in front of them!
Admin
Just like the Microsoft Word grammar checker, then, without the added annoyance of slowing the whole program down.
Admin
The mountain of squabbling comments aside, I would say that because VB is by default making a case insensitive comparison (as the language is 'case insensitive') and c# is case sensitive, that using a string comparison as an example isn't an entirely like-for-like comparison (because it can't be a simple byte comparison if ignoring case). Personally I consider VB's case insensitivity a language feature rather than 'backwards compatibility' but you may disagree.
Other trivial examples like incrementing (i.e. var++ vs. var += 1 or var = var + 1) produce identical MSIL.
I think any differences you find will be quite trivial at MSIL level and are probably more of a result of coding style than the language itself.
N'est-ce pas?
Admin
Actually, you can do bitwise shifts and operators in VB.NET 2003 and above. I know it works in 2005.
Admin
Admin
Maybe i'm misreading you, but really, do you prefer having null=="" evaluate to true ?????? I mean it could have been a null array or a null cheese for all you know, is it really sane to compare it with a string using a string comparison function ??
Then again it shows the one most important thing, either way you should know what you're doing (here that it's a null string and not a null cheese for example), and if you cannot know what you're doing, you're much better off with a modern mass-programming language (those they call OO - java, c POUND !!! and the likes) which will prevent "some" of your incomprehension to cause damage (yes, it can be someone else's code and you might not know variable types and all those insignificant (to some languages) details).
I must say I have personnal griefs with VB for doing some stuff the Excel way (you know, not telling you, doing strange stuff in an automated way and you searching for a reason when there is none) and therefore will not be impartial in this quarrel - however I would like to add that C# isn't that much better, so both sides of the arguments receive a point each.
Although coercing the coder in one specific style w/ java or c# or the likes isn't that great, it does prevent a lot of bad coders from doing a lot more damage and thus it is clear that those languages are much better business-wise (150 -cheap- coders projects and other industry standard failures) than VB.
Admin
mmmmmmmmmmmm ... null cheese
Admin
That's where you see programming is really a better world than many others : See this man : his experience is mostly useless today (most of the languages are irrelevant to date - and his brain might have been damaged by all the prehistoric stuff) and yet, his wisdom is as valid as ever, so instead of having to assimilate all the knowledge, you just need those 5 lines of wisdom, a few languages (I guess perl and python would do the trick for a start) and a brain and tadaa you're on your way to be an excellent programmer.
Ain't that amazing ?
Now, you get the same skills and forget about the wisdom and the brain part and tadaaa you're a total fail programmer.
Really, programming is a good world (when you forget about all that [all those other bad and stupid coders] have written for you to stumble upon).
Admin
Whatcha gonna do with all that junk, All that junk inside your code?
Admin
Admin
Admin
Admin
Consider yourselves one-upped. I did both - for YEARS.
-Max :D
Admin
Consider yourselves one-upped. I did both - for YEARS.
-Max :D
Admin
Left him speechless! ;-)
Admin
I've passed that age some time ago, and by the looks of it, so has Steve. :)
Admin
But on the other hand, if all you have are getter and setter methods that, well, get or set the value, you might as well make the property public.
Admin
Erm, yeah, no, you are wrong. C# 4.0 finally supports dynamic variables, which allows you to pull some of the late binding functinality that VB.NET was born with. BTW, Nothing wrong with weak typing, if used properly. Furthermore, if you want, you can declare as an option (or compiler) that there will not be anything that can late bind.
Admin
Timely. Peter Norvig on why he used python for code in his AI book:
http://news.ycombinator.com/item?id=1803815
Admin
Admin
Don't get me wrong, I agree with you totally... but Oracle doesn't.
(Oracle is very powerful, but sometimes in the same way that a thermonuclear device is very powerful.)
Admin
Where's my damn article?
Admin
I would pay money if they would post an article every day.
Admin
Admin
I don't get the Remy hate...
Admin
Well, first, if they were "real programmers", they'd call them symbolic references, and would know that you don't use them willy-nilly and it's much easier to just say "don't use them" because you shouldn't use them 99.99999% of the time you think you want to.
Admin
Admin
C#
VB.NET
Or, even worse:
Oh, and while I'm at it, any code that uses a method with an empty parameter list, considering VB.NET makes parens optional in such cases (I refuse to leave them off in my own VB.NET code, but unfortunately, others are not as considerate).
P.S.: No citing .NET 4.0. I'm not able to use it yet.
Admin
scoff no-one says a byte has to be eight bits.
Admin
Let me make this clear: C# does not support weak typing. Not at verion 1.0, not at version 4.0. Version 4.0 has introduced dynamic types but this is absolutely not weak typing. Weak typing would mean that the type could be changed at runtime, like the old style variant. In C# 4.0 they are statically typed as dynamic, so there is zero risk of the type being changed at runtime. This essentially removes the risk inherent with weak typed variables.
Next time, please don't make me do your research for you. It sounds like you haven't even used the new version, much less understood its features.
Admin
Well, you don't want to just throw getters and setters on everything, but it's substantially better to have some control on the distribution and setting of information than to simply make it public. A setter, for example, can validate the new value and inform the classes concerned when a value is changed, which can't happen if you simply make the field public and let anyone change it at whim, and a getter can be used check a value before returning it, if that is a concern.
However, it's much better, in my view, to inflict changes on objects as actions taken on them than to allow classes to set their values freely. Getters pose less potential harm, I suppose, but they do betray a failure of design: why does class B need class A's data? Why can't class A do its own work?
Admin
Admin
What, exactly, is unimaginable about homosexual activities?
captcha: abbas - speaking of homosexual activities, how many abbas are there in Remy's forthcoming poly-sexual Busby Berkeley porn musical? (sorry, best I could do)
Admin