|
It all depends on the kind of work at hand:
I've been working with high skilled programmers for 30 years, and my experience is quite the opposite. The applications were all quite large and complex, or had highly innovative and complex functionality, or both.
Of course if the job at hand is more mechanical in nature and doesn't require the coder to really think out of the box, then a skilled programmer won't be happy, and will quit, or not even apply to the job in the first place.
GOTOs are a bit like wire coat hangers: they tend to breed in the darkness, such that where there once were few, eventually there are many, and the program's architecture collapses beneath them. (Fran Poretto)
|
|
|
|
|
My family owns a factory warranty center for Panasonic, growing up I was trained on programming microchips.
When I deal with people and they tell me they know computers my first thought is to think they are full of themselves.
|
|
|
|
|
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.
|
|
|
|
|
The minimum you can have without with would be g.lineTo(), g.moveTo() etc.
|
|
|
|
|
Yep, looks good to me.
You'll never get very far if all you do is follow instructions.
|
|
|
|
|
Are you still opposed to using (the namespace one, not the disposing one or the alias one) as well?
|
|
|
|
|
Public Shared Function GetImage(FileName As String) As BitmapImage
If FileName <> "" Then
Using isStore = IsolatedStorageFile.GetUserStoreForApplication()
Using targetStream = isStore.OpenFile(CameraControl.LastKnownTaken.FileName, FileMode.Open, FileAccess.Read)
Dim ImageCaptured = New BitmapImage
ImageCaptured.SetSource(targetStream)
Return ImageCaptured
End Using
End Using
End If
Return Nothing
End Function
|
|
|
|
|
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 have globall:: 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.
|
|
|
|
|
Thank God I don't need SQL anymore.
I use Unidex which I wrote in Visual basic 
|
|
|
|
|
visual basic takes less skill to get the job done
|
|
|
|
|
If it's in VB, it isn't "done".
You'll never get very far if all you do is follow instructions.
|
|
|
|
|
Whats not in visual basic?
|
|
|
|
|
In the time of autocompletion editors, less typing is no longer a valid argument.
GOTOs are a bit like wire coat hangers: they tend to breed in the darkness, such that where there once were few, eventually there are many, and the program's architecture collapses beneath them. (Fran Poretto)
|
|
|
|
|
If you'd picked a case of With doing namespace/object elision, you might have a point. But as several people have pointed out, this is an object initialiser which is included in C# and (I think) has been since the same .Net compiler version as the VB.Net syntax you're demonstrating.
Other languages like JavaScript, Ruby, Perl etc can create objects with data in a single statement like this, too, and have been able to for years.
If you're going to make a claim like "no other language can do [something your fave can]" then at least a tiny bit of research would be a good idea.
|
|
|
|
|
Without the with operator C# has a smaller scope
|
|
|
|
|
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
|
|
|
|
|
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
|
|
|
|
|
Colborne_Greg wrote: I need this
Probably not.
You'll never get very far if all you do is follow instructions.
|
|
|
|
|
Simon_Whale wrote: would of have
FTFY
new image() { Height = Height }
In one small test, I see that the this. isn't required, but it seems to confuse the debugger a bit. I prefer to use this. just because.
You'll never get very far if all you do is follow instructions.
|
|
|
|
|
It does not fail in C#.
class DataObj {
public int Height { get; set; }
}
class Starter {
public static void Main() {
int Height = 23;
DataObj obj = new DataObj { Height = Height };
System.Console.WriteLine("Set to " + obj.Height);
}
}
Compiles without warnings and gives the right answer.
Once again, if you're going to make concrete statements about what is or isn't possible in a language, you need to check whether that statement is accurate first.
|
|
|
|
|
As I have learned but there is no period before either height so now the reader of the code has to guess at the scope of the object
Real genius
|
|
|
|
|
It's pretty obvious from context that one of those is a property name on the object you're setting, and one is a name in the local scope, and that's all the . tells you.
It's no different from public Form Form (or Dim Form As Form or whatever you write in VB) and other places where you have the same word in two different contexts.
|
|
|
|