Visual Basic needs more credit
-
Nothing against vb, but catching exceptions and then not handling them is epic fail for me, not "beauty and elegance".
Running through a database there are some times bad records. I don't want them crashing the program nor do I care at this point what the problem is
-
With, when used appropriately, aids clarity just by removing characters – if you have to read past "SomeLongObjectName." at the start of every line you won't actually see the important word. When used badly (so you don't know whether the tokens on the line are part of the with'd object or locals or something else) it makes things worse. I've used with in ActionScript, usually for graphics code which is doing nothing but a bunch of calls to lineTo, moveTo, setBitmapFill etc, and (imo anyway) not having "e.graphics." on every line makes that clearer.
BobJanova wrote:
doing nothing but a bunch of calls to lineTo, moveTo, setBitmapFill etc, and (imo anyway) not having "e.graphics." on every line makes that clearer
Howsabout writing a function then? Now I'm wondering wether or not an anomymous function would do that...
You'll never get very far if all you do is follow instructions.
-
If it's in VB, it isn't "done". :laugh:
You'll never get very far if all you do is follow instructions.
Whats not in visual basic?
-
Wow. Dude. If you're going to say something like that, make sure you're exposed to more languages first.
6 years of school, granted my studies are out of date by 5 years
-
Or handled it.
Wrong is evil and must be defeated. - Jeff Ello[^]
When dealing with a database, sometimes there are bad records. I meant for these try catches to be this way, as I don't care at this point why there would be problems in the data, all other errors are handled.
-
Sorry as Bob has pointed out, this sort of argument needs more research. many have also pointed out from the .net framework that C# doesn't need the
With
keyword. There are many other keywords if you looked and were pedantic enough C# doesn't use but slight change / merge of keywords you could achieve the same thing. relax and enjoy the lounge they don't really care what language you code in.Every day, thousands of innocent plants are killed by vegetarians. Help end the violence EAT BACON
VB New image with {.height = height} C# New image {height = height} second one fails
-
With his pants on fire :laugh: I read somewhere that there are things that VB can do and C# can't an vice versa though... Think it had something to do with Errorhandling ?
Inline XML? Does C# have that yet?
-
6 years of school, granted my studies are out of date by 5 years
"with" isn't particularly unique or interesting. There's a lot of functionality in a few lines. But you can stack up languages like cordwood that have lambdas, currying and/or templating features that would reduce the footprint of that code far more. It's awesome to be excited about a language. Lord knows I've spent most of the last 40 years that way. But do yourself a favor, take this post and put it in a calendar item marked 5 years from now and come back and look at it then. Visual Basic has come a long way since the VB3 days. But it's a very very long way away from winning awards for elegance.
-
VB New image with {.height = height} C# New image {height = height} second one fails
No as you would of written it like this VB.NET Version
New image With
{
.height = height
}C# Version, in the C# version the With Keyword is ommited
new image { height = this.height }
Every day, thousands of innocent plants are killed by vegetarians. Help end the violence EAT BACON
-
Are you still opposed to using (the namespace one, not the disposing one or the alias one) as well?
Yes. And I really don't like that Extension Methods require the
using
directive. Very powerful are aliases though. Recently I used an alias to resolve a namespace conflict, rather than havegloball::
scattered throughout some code:namespace PIEBALD.Data.MySql
{
using MySqlClient=global::MySql.Data.MySqlClient ;public sealed class DatabaseInfo : PIEBALD.Data.DatabaseInfo<MySqlClient.MySqlDbType>
You'll never get very far if all you do is follow instructions.
-
Inline XML? Does C# have that yet?
Don't know...
-
When dealing with a database, sometimes there are bad records. I meant for these try catches to be this way, as I don't care at this point why there would be problems in the data, all other errors are handled.
Then catch the DB errors and rethrow the rest.
Wrong is evil and must be defeated. - Jeff Ello[^]
-
That code would fail as the scopes would be confused
No it wouldn't.
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
-
this message is spam
Colborne_Greg wrote:
this message is spam
OK, at least you're being honest about it. As requested, I've reported your message as spam. Happy now? ;P
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
-
Colborne_Greg wrote:
this message is spam
OK, at least you're being honest about it. As requested, I've reported your message as spam. Happy now? ;P
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
Advertising your other post is spam
-
Then catch the DB errors and rethrow the rest.
Wrong is evil and must be defeated. - Jeff Ello[^]
I'm not using SQL
-
No as you would of written it like this VB.NET Version
New image With
{
.height = height
}C# Version, in the C# version the With Keyword is ommited
new image { height = this.height }
Every day, thousands of innocent plants are killed by vegetarians. Help end the violence EAT BACON
So now instead of with I need this. And I would have to write this over and over and over
-
No it wouldn't.
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
VB New image with {.height = height} C# New image {height = height} second one fails
-
I think that Visual Basic should be shown off for its beauty and elegance. Here is a sample of what it can do - that no other language can do:
Private Sub AlbumListPopulate()
Try
AlbumsList.ItemsSource = New List(Of Image)For Each AlbumName In Pictures.Albums Try AlbumsList.ItemsSource.Add \_ ( New Image With { .Height = 150, .Width = 150, .Source = RotateStream \_ ( Pictures.Album(AlbumName).Picture, Pictures.Album(AlbumName).Angle ) } ) Catch End Try Next Catch End Try
End Sub
-
"with" isn't particularly unique or interesting. There's a lot of functionality in a few lines. But you can stack up languages like cordwood that have lambdas, currying and/or templating features that would reduce the footprint of that code far more. It's awesome to be excited about a language. Lord knows I've spent most of the last 40 years that way. But do yourself a favor, take this post and put it in a calendar item marked 5 years from now and come back and look at it then. Visual Basic has come a long way since the VB3 days. But it's a very very long way away from winning awards for elegance.
The unique part about the with; is that it is simple - easy to learn, little if no problems to overcome just by using the structure.