|
I voted you a 5, just because I was in the mood. Yeah, that's right, feel thy wrath! Muwahahahaha!
|
|
|
|
|
Sorry, I couldn't resist.
/ravi
|
|
|
|
|
yeah and while we're on the topic, what's that got to do with musical notes?
|
|
|
|
|
Though it (VB) can not stand to compete against other languages, for a significant percentage of software professionals it is an essential breadwinner.
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
All the world's a stage,
And all the men and women merely players.
They have their exits and their entrances;
And one man in his time plays many parts... --William Shakespeare
|
|
|
|
|
I was only kidding. I don't have religious opinions on programming languages, code editors or religion.
/ravi
|
|
|
|
|
Ravi Bhavnani wrote: What's VB?
VB = C# - curly braces - semicolons + Dim
|
|
|
|
|
+ My namespace.
/ravi
|
|
|
|
|
Nemanja Trifunovic wrote: VB = C# - curly braces - semicolons + Dim
+ Me keyword and everything totally messed up due to a backward compability with a extremely inefficient and over-keyworded language.
Greetings - Gajatko
Portable.NET is part of DotGNU, a project to build a complete Free Software replacement for .NET - a system that truly belongs to the developers.
|
|
|
|
|
gajatko wrote: over-keyworded language
Proof? Examples?
|
|
|
|
|
I mean: a lot of redutant and hilarious keywords, which can be replaced by intuitive symbols. Do you really need a proof for this obvious thing? Here are examples:
Then, End If, End While, End X, Dim, As, Implements, Handles, Until, & operator, ReadOnly, OverLoads, CDate, CChar, CStr, CSng etc. (and 11 more), ReDim, Preserve, WriteOnly , etc. etc.. There are much more redutancies in this ankward sandbox programming language, but I think that's enough for now. Cheers.
Greetings - Gajatko
Portable.NET is part of DotGNU, a project to build a complete Free Software replacement for .NET - a system that truly belongs to the developers.
|
|
|
|
|
Yeah I see what you mean. I'm still thinking in a classic VB way since I don't use .NET much. But, I see how some of those (not all, some are just verbose) could overlap the BCL functionality.
|
|
|
|
|
Nemanja Trifunovic wrote: VB = C# - curly braces - semicolons + Dim
I'm still happy to be a dinosaur too. Rawr!!
|
|
|
|
|
VB also supports an 'Optional' keyword. C#, for some reason supports only overloading and does not support the optional keyword.
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
All the world's a stage,
And all the men and women merely players.
They have their exits and their entrances;
And one man in his time plays many parts... --William Shakespeare
|
|
|
|
|
Yeah, that's a tough one to swallow coming from C++ as well. Although with a bit of prep work, you can kinda fake it by passing in an object and using initializers. IMHO, C# should build this into the compiler and just give us named parameters with default values...
---- You're right.
These facts that you've laid out totally contradict the wild ramblings that I pulled off the back of cornflakes packets .
|
|
|
|
|
That's pushing the envelope a bit far! "Optional" is really only useful in VB to simulate polymorphism, which C# already supports.
Public Sub MyExample(intLength As Integer, Optional intWidth As Integer)
' Some code
End Sub
-- C#
public void MyExample(Length as int)
{
}
public void MyExample(Length as int, Width as int)
{
}
http://mytechworld.officeacuity.com
|
|
|
|
|
I disagree:
public void MyExample( int length, optional int height = 0, optional int width = 0 )
{
}
is better (and clearer) than
public void MyExample( int length )
{
MyExample( length, 0 );
}
public void MyExample( int length, int height)
{
MyExample( length, height, 0 );
}
public void MyExample( int length, int width )
{
MyExample( length, 0, width );
}
public void MyExample( int length, int height, int width )
{
}
|
|
|
|
|
Why bother with a keyword? The compiler should be able to handle
public void MyExample( int length, int height = 0, int width = 0 ){
cheers,
Chris Maunder
CodeProject.com : C++ MVP
|
|
|
|
|
You are right. 'Optional' is just syntatic sugar that would make it more visible.
|
|
|
|
|
No - VB.NET has polymorhism too
Optional is mainly used for dealing with OLE Automation (particularily of Office apps) which have optional parameters....
But doesn't C# have a var keyword for that?
|
|
|
|
|
That's not polymorphism, that's overloading, and is entirely separate issue from default (optional) parameters - for example C++ supports both.
|
|
|
|
|
And here's why:
pane.YAxis.IsVisible = true;
pane.YAxis.Type = AxisType.Linear;
pane.YAxis.Scale.FontSpec.Size = 9;
pane.YAxis.Scale.FontSpec.IsAntiAlias = true;
pane.XAxis.IsVisible = true;
pane.XAxis.Type = AxisType.Date;
pane.XAxis.MajorTic.IsInside = false;
pane.XAxis.MajorTic.IsOpposite = false;
pane.XAxis.MinorTic.IsInside = true;
pane.XAxis.MinorTic.IsOpposite = true; Becomes:
with (pane.YAxis)
{
.IsVisible = true;
.Type = AxisType.Linear;
with (.Scale.FontSpec) { .Size = 9; .IsAntiAlias = true; }
}
with (pane.XAxis)
{
.IsVisible = true;
.Type = AxisType.Date;
with (.MajorTic) { .IsInside = false; .IsOpposite = false; }
with (.MinorTic) { .IsInside = true; .IsOpposite = true; }
}
---- You're right.
These facts that you've laid out totally contradict the wild ramblings that I pulled off the back of cornflakes packets .
|
|
|
|
|
I find your solution VERY hard to read! Specially the idea of allowing nested with's...I think that's a recipe for disaster and ugly code.
I don't think the time you save by typing less is worth the readability you give up, specially now a days that IntelliSense is so great. I rather Copy/Paste the object name, or create object references and deal with those directly, for example:
YAxis y = new YAxis();
y.IsVisible = true;
y.Type = AxisType.Linear;
y.Scale.FontSpec.Size = 9;
y.Scale.FontSpec.IsAntiAlias = true;
pane.YAxis = y;
I think we need to learn and leverage the tools we already have before asking for new ones, I'm surprised to see how most developers don't take the full advantage of VS or C# advanced features.
|
|
|
|
|
rickyvj wrote: I don't think the time you save by typing less is worth the readability you give up
Actually, it would save little if any typing. The win (for me anyway) comes in eliminating the "wall of text" - line after line of nearly identical property names. I'm looking for something closer to CSS-style syntax: <span style="font-weight: bold;">selector</span> { <span style="font-style: italic;">properties</span> } .
rickyvj wrote: IntelliSense is so great
IntelliSense reduces the amount of time it takes to create a dense block of chained properties, but does nothing to aid in reading the results later on. The example is taken from a bit of code i use for creating ZedGraph charts; originally, it was much, much longer, but i've eliminated most of it in favor of rule-based or metadata-based configuration after it became clear that maintaining such dense code was extremely error-prone.
rickyvj wrote: I think we need to learn and leverage the tools we already have before asking for new ones
That's... a bit silly. Like suggesting i should learn to use a paring knife more effectively before asking for a potato pealer, or memorize logarithm tables before asking for a pocket calculator. If a tool is useful, it should be built - anyone is free to not use it.
rickyvj wrote: I'm surprised to see how most developers don't take the full advantage of VS or C# advanced features.
I have several socket wrenches i've never used; they came in a set with several others that i use frequently. But if i ever do need them, they're ready and waiting...
---- You're right.
These facts that you've laid out totally contradict the wild ramblings that I pulled off the back of cornflakes packets .
|
|
|
|
|
With 2008 there is an an easier way to do what you suggest using the new constructors.
pane.YAxis = new YAxis{
IsVisible = true,
Type = AxisType.Linear,
Scale.FontSpec.Size = 9,
Scale.FontSpec.IsAntiAlias = true
};
Richard Green
|
|
|
|
|
Great, thanks!
See? This is what I mean by learning the tools you already have before asking for new ones!
|
|
|
|