views:

286

answers:

16

I have a couple of things that I would like to have in VB.NET. Do you have ideas of other functions, methods or extensions of the language you are working with? Here are mine:

Extended WITH statement (like in Pascal), to change property of more than one object at time in same with-statement:

WITH Button1,Button4  
       .Enabled=false  
End WITH

Grouping of objects
It would be nice to group objects of same type. Like all controls that handles a particular stage in the program, group them and control them all by the group.

dim EditControls as ObjectGroup(of controls) ={button1,button2,panel1,gridview3}


//affect all controls in the group
EditControls.Enabled=False  

//Affect only Button1 in the group
EditControls.item(0).visible=false
EditControls.item("Button1").visible=false

Any more ideas? ;)

+3  A: 

closure (for java)

VonC
Also: http://docs.google.com/View?docid=k73_1ggr36h in regards to an alternative proposal into the Closure syntax
_ande_turner_
As far as the use of "=>" I'd prefer "::" purely because if i saw "::" in a Java program I would wonder what the hell it was doing there, as opposed to a syntax which could be misconstrued by the uninformed as some boolean operation. C++ confusions aside.
_ande_turner_
A: 

Short-circuit logic in VBScript. I want to be able to check if something exists and check a property in a single if statement.

tloach
Are you aware of the AndAlso operator? http://msdn.microsoft.com/en-us/library/cb8x3kfz(VS.80).aspx
Kon
A: 

Friend classes for C#

Kon
I didn't vote down, but I bet you'd use it to befriend Herbert: http://en.wikipedia.org/wiki/Herbert_(Family_Guy)
Hugo
@Hugo, nice! :)
Kon
A: 

I primarily work with a proprietary language, VAL3, for controlling industrial robots. Next year we are adding classes.

Jim C
A: 

Delphi - inline variable declaration

JosephStyons
+1  A: 

Binary integer literals would be nice in C sometimes, when dealing with masks and generally bit-fiddling. Not a very original thought, though.

unwind
A: 

In JavaScript, i'd like to use any object type as array keys, like Lua and (almost) Python do.

In Python, i'd like:

  • a nicer syntax for dict references (like JS and Lua do)
  • not triggering an exception when trying to read a nonexistant key without using ugly syntax (dict.get[k] is far uglier than dict.k)
  • full lexical scoping
  • usable anonymous functions

In Lua, i'd like scheme-style continuations.

In Scheme, i'd like arc-like lambda shortcuts ([(+ _ 1)] instead of (lambda (x) (+ x 1)))

In arc, i'd like a real compiler

Javier
A: 

I'm working on script language for an puzzle-adventure game right now, and so far I've implemented some features that script writers asked for. Actually, I want some of them in C now :-)

Like 'it' object. It is just symonymous to the last mentioned object in script. Like this:

[load something as object][tport it 100,200][hide it]

Or 'once' prefix. The script consists of two parts: initialization and a looping gameplay script, which is running each frame. And there are some milestones in the gameplay, which results as reinitialization of something. 'once' can be used to do something only once during the lifetime of the gameplay script. Like this:

[if something_happened and you_need_to_reload_something]
  [once load images\another_something as object]
[endif]

After single execution this construction turns to an empty if..endif construction, which is redused by the parser.

akalenuk
Sounds interresting for game loops. I can see more useful tweeks in that area.
Stefan
+1  A: 

properties in Java (like in C#)

Yonatan Maman
that would be so great for readability.
Hugo
A: 

I would like PHP to be more Pythonic in syntax. Specifically, argument passing to functions is very nice in python (ie. widgets=5, sort=name, order=DESC), as is the compact syntax for creating dictionaries and lists.

Adam Backstrom
A: 

Multiple Inheritance (for C#). Yes, I know it's a pain for the compiler/interpreter developers, but hell, I'd like to have it available.

FOR
A: 

Ada has great support for parallel programming via threading (tasks), but I'd like to see it get HPF-like parallel loop constructs for use on array processors. GPU hardware is threatening to become mainstream as general-purpose array processors, and it this would make the language much more usable in that space.

T.E.D.
+1  A: 

Java

  • Reified Generics (i.e. type information present at runtime)
  • Ability to catch multiple exceptions (of different types) in a single catch block
  • Destructors
  • Support for closures or treating functions as data
  • Support for literal collections and type inference, e.g.

Instead of this:

Map<String, String> myMap = new HashMap<String, String>();
myMap.put("this", "is");
myMap.put("very", "verbose");

I'd like something like this:

Map<String, String> myMap = {("this, "is), ("very", "verbose")};
Don
+1  A: 

In Java I would like to be able to switch on a string, like in C#, but apparently that is coming in java 7. Small I know, but I do miss it sometimes.

James McMahon
A: 

I'd like Java to have an equivalent to C++'s "protected" access level.

Adam Jaskiewicz
+1  A: 

Something similar to the SQL 'in' operator (? ... keyword?)

So in C# instead of

if( 0 == value || 5 == value || 6 == value)
   DoSomethingCool();

I'd like to say

if( value in (0,5,6))
   DoSomethingCool();
John MacIntyre
Nice one. Makes it easier to read the code.
Stefan