-
What Would You Change About C# if You Had The Chance? (For Novices and Experts)
This question goes out to C# novices and the experts.
If you could change something about C# what would it be?
Novices - You know the things that annoy you right from the start that an expert might have gotten used to and forgotten.
Experts - You have detailed knowlege of the language and know what is lacking and what should be changed.
I am collecting this information to help in the development of LightFusion™. It is a programming lanuage being created by VBF's very own Jacob Roman, Penagate, ChemicalNova and myself (eyeRmonkey). Any and all input you have will help us a lot. :)
-
Re: What Would You Change About C# if You Had The Chance? (For Novices and Experts)
Coming from VB, I miss the "With" statement
Also the "Select Case" are not that smooth
PS: May I suggest finding one central place we can look at suggestions, etc, so we don't all go and type the same stuff over and over?
-
Re: What Would You Change About C# if You Had The Chance? (For Novices and Experts)
The IDE re-formatting my code, I make how I want it to look close it then when I re-open it it has been changed. HTML is even worse in ASP.NET.
-
Re: What Would You Change About C# if You Had The Chance? (For Novices and Experts)
Quote:
Originally Posted by GlenW
The IDE re-formatting my code, I make how I want it to look close it then when I re-open it it has been changed. HTML is even worse in ASP.NET.
hmm that usually doesnt happen in C# (it reformats you code when you close a bracket though,,, so you could just undo and it changes back to the old formatting)... I hate that too
I dont think the WITH statement or anything like that will be implemented (I read about it on a msdn blog also) because they want to model C# based on C++ and similar languages. Such languages never featured a with statement.
anyways, I REALLY wish there were inline functions in C# :(
-
Re: What Would You Change About C# if You Had The Chance? (For Novices and Experts)
Quote:
Originally Posted by MrPolite
hmm that usually doesnt happen in C# (it reformats you code when you close a bracket though,,, so you could just undo and it changes back to the old formatting)... I hate that too
I dont think the WITH statement or anything like that will be implemented (I read about it on a msdn blog also) because they want to model C# based on C++ and similar languages. Such languages never featured a with statement.
anyways, I REALLY wish there were inline functions in C# :(
I think a WITH statement is the easiest thing in the world to do if you simply add it in the object name before the source is send to the interpreter/compiler. The only way it would be hard is if you tried to do some optimizations using WITH (which we might do).
Yes inlining was one of the first things we decided to do (Jake's idea).
-
Re: What Would You Change About C# if You Had The Chance? (For Novices and Experts)
You n00bs...hehehe...why is everyone starting to talk about the VS IDE when we talk about C#....it has NOTHING to do with C#. You can write C# code in Notepad if you want. It doesn't reformat your code. And if you have payed millions of dollars to get the VS IDE, you can turn off the formating you don't like. Like here at work when I am in Windows and I am coding in C#, then I turn off the automatic formating of my brackets. The VS IDE automaticaly put your brckets like this:
Code:
if (gay)
{
// Do something
}
But I think that takes one line too much. And since I started out as a VB guy, I am used to have the "then" word on the same line anyway. So I turn this future off. So I have it on the same line. And you can do that too, but it has still nothing to do with the language C#.
Ok, now over to what I would have changed.
1. A possibility to force the GB to collect an object RIGHT THERE AND THEN. And not just marking an object as ready to be collected.
2. The event handlers are confusing for many new programmers. And the way they are handled in C# is error prone when it comes to memory leaks. Since it is hard links. Meaning that the GC might think that your object is still in use even if it might not be. A better and cleaner solution would be like QT does it. Using signals/slots. But then again, there is nothing wrong with using QT# to make your GUI apps in C# either though. So this was more of a rant then anything else..:)
- ØØ -
-
Re: What Would You Change About C# if You Had The Chance? (For Novices and Experts)
Quote:
Originally Posted by NoteMe
You n00bs...hehehe...why is everyone starting to talk about the VS IDE when we talk about C#....it has NOTHING to do with C#. You can write C# code in Notepad if you want. It doesn't reformat your code. And if you have payed millions of dollars to get the VS IDE, you can turn off the formating you don't like.
...and you should read the monkey's original post
Remember, there is no single language who's compiler can make use of ALL functionality offered by the CLR. Only MSIL can do that. If I don't have it wrong, there's about 40 languages with compilers that target the .Net Framework.
The way I understood Monkey, is saying he want to create another language with compiler, that uses a C# like syntax, with the changes one would make to C# if you could.
-
Re: What Would You Change About C# if You Had The Chance? (For Novices and Experts)
"But then again, there is nothing wrong with using QT# to make your GUI apps in C# either though. "
what?:D
-
Re: What Would You Change About C# if You Had The Chance? (For Novices and Experts)
Quote:
Originally Posted by MrPolite
"But then again, there is nothing wrong with using QT# to make your GUI apps in C# either though. "
what?:D
What did you not understand?
- ØØ -
-
Re: What Would You Change About C# if You Had The Chance? (For Novices and Experts)
Quote:
Originally Posted by StrangerInBeijing
...and you should read the monkey's original post
Sorry, I read it again. And I still don't see what you mean. He is asking about the language right?
Quote:
Originally Posted by eyeRmonkey
If you could change something about C# what would it be?
And they answered about one IDE that you can use to code C#. Can you please explain to me what you mean, since I am a bit tired this morning..:D
- ØØ -
-
Re: What Would You Change About C# if You Had The Chance? (For Novices and Experts)
Yeah....you're right...where's the darn Monkey?
Lets' wait and let him explain
-
Re: What Would You Change About C# if You Had The Chance? (For Novices and Experts)
Sorry, but now I am completly lost here...I don't even think that "red cross" can get me back to shore again now..:D Come again please..:D
- ØØ -
-
Re: What Would You Change About C# if You Had The Chance? (For Novices and Experts)
It's nearly week-end mate. Just hang on in there
-
Re: What Would You Change About C# if You Had The Chance? (For Novices and Experts)
Hehe..thanks. I am going out drinking after hours today. That is for sure.
Well, I remembered one more thing that annoys me. That there is NO way to find out the size of a managed object for sure. SizeOf and SizeOf Marshal thingy is not enough. C# should have a clean interface to find out the size of an object. But the framework makes that hard for any lanaguage though..::(
- ØØ -
-
Re: What Would You Change About C# if You Had The Chance? (For Novices and Experts)
I am fairly sure that it will not be a managed environment ;) So no garbage collector. But there will be a sizeof() operator and not being managed it should be a breeze.
Note can you show me how you do error handling in C#? Is it Try/Catch etc. like in C++?
-
Re: What Would You Change About C# if You Had The Chance? (For Novices and Experts)
Yeah, you are basicaly casting exceptions. I hate that. I like much better error codes as return values, ther use pointers or references for the parameters. That is MUCH faster. Error handling in C# and C++ is INCREDIBLE slow...
- ØØ -
-
Re: What Would You Change About C# if You Had The Chance? (For Novices and Experts)
Basically like Win32 APIs then? Status code as the return value and extensive use of out parameters. I prefer that too, although I like the SEH syntax it is as you say rather inefficient.
-
Re: What Would You Change About C# if You Had The Chance? (For Novices and Experts)
Yeah, return codes. Not sure what the system is called but you know....ehh...in binary. So one return code can mean more then one thing if it has too. Like you have return code:
1
2
4
8
16
but not those in between, so if you get return code 7, then you know that you have 1,2,4.
- ØØ -
-
Re: What Would You Change About C# if You Had The Chance? (For Novices and Experts)
I know what you mean, don't know what they are called either :D
basically
1 = 00001
2 = 00010
3 = 1 and 2 = 00011
etc.
-
Re: What Would You Change About C# if You Had The Chance? (For Novices and Experts)
-
Re: What Would You Change About C# if You Had The Chance? (For Novices and Experts)
These are called Bit Fields and Flags depending upon how they are used.
-
Re: What Would You Change About C# if You Had The Chance? (For Novices and Experts)
Quote:
Originally Posted by penagate
1 = 00001
2 = 00010
3 = 1 OR 2 = 00011
:lol: I couldn't resist.
-
Re: What Would You Change About C# if You Had The Chance? (For Novices and Experts)
-
Re: What Would You Change About C# if You Had The Chance? (For Novices and Experts)
Quote:
Originally Posted by StrangerInBeijing
Yeah....you're right...where's the darn Monkey?
Lets' wait and let him explain
My original question was intended to get this point across:
"What do you not like about your current (or past) programming experience."
I am looking for things to include (or leave out) of LF to make it the best language it can be. This includes things like IDE, syntax, compiler, libraries, etc.
Did that clear things up?
-
Re: What Would You Change About C# if You Had The Chance? (For Novices and Experts)
Well, I am a novice,
But coming from VB.NET. In VB.NET after you press enter, the IDE automatically put the closing statement for you. For example
IF bla bla THEN [Press Enter]
//And the IDE, will automatically put
END IF
Another annoying thing is that, after you double-click on a control (let say a button). And you change your mind that you dont want to write a button1_click (event-method) and erase the whole Public bla bla { }, and build ur project. The compiler will tell you that "your form" does not contain a definition for button1_click.
Well you can just delete the code that is being pointed out by the compiler... But, it still annoying :(
-
Re: What Would You Change About C# if You Had The Chance? (For Novices and Experts)
Make it as low lang as Assembler & C , and as simple as VB.NET . :)
-
Re: What Would You Change About C# if You Had The Chance? (For Novices and Experts)
We've decided that it should be easy to tell what assembly code is being generated from the LF code.
Here is the list of rules we have so far.
If anyone has any suggestions that aren't directly related to improvements on C#, VB.NET, VB6, C++, please post in that thread :)
-
Re: What Would You Change About C# if You Had The Chance? (For Novices and Experts)
Quote:
Originally Posted by Pirate
Make it as low lang as Assembler & C , and as simple as VB.NET . :)
:)
Not quite possible. First off assembler and C are exteremly different and you cant have a simple low lang. Its just one of the sacrafices you make (low=fast, high=simple).
-
Quote:
Originally Posted by eyeRmonkey
:)
Not quite possible. First off assembler and C are exteremly different and you cant have a simple low lang. Its just one of the sacrafices you make (low=fast, high=simple).
That's the point , if you can't make something brilliant , then don't . Guys , I'm not fraustrating you but think if this lang can't emulate other langs , then nobody would even try to learn it or install it . Good luck anyways .It's challenging and interesting !!
-
Re: What Would You Change About C# if You Had The Chance? (For Novices and Experts)
LF should include an easy way to break out of double loops, since it is impossible to use the 'break' statement twice and i would never consider using 'goto'.
-
Re: What Would You Change About C# if You Had The Chance? (For Novices and Experts)
Why couldn't you use if statements to get out of the loop just as you would any single loop? Why wouldn't break work twice (we probably won't use break, but maybe).
-
Re: What Would You Change About C# if You Had The Chance? (For Novices and Experts)
Because once you break out of one loop you jump into the enclosing loop. You'd need a flag to say that you'd broken from the inner loop, and check that flag to see whether to break out of the outer loop also.
Sometimes break is useful. Maybe we should be able to specify how many levels to break out of, e.g.
Code:
for (i=0; i=5; ++i) {
for (j=0; j=5; ++j) {
if (j=3) break(2);
}
}
-
Re: What Would You Change About C# if You Had The Chance? (For Novices and Experts)
-
Re: What Would You Change About C# if You Had The Chance? (For Novices and Experts)
I just recently came to C# from VB6, and I miss optional arguments the most. I know about overloading and how to do it, but I still like optional arguments the best.
-
Re: What Would You Change About C# if You Had The Chance? (For Novices and Experts)
Multiple inheritance with Classes (not interfaces) just like in C++.
-
Re: What Would You Change About C# if You Had The Chance? (For Novices and Experts)
Quote:
Originally Posted by Pirate
Multiple inheritance with Classes (not interfaces) just like in C++.
that'd make things really complicated :D
C# isn't for doing super super l33t stuff you know;)
-
Re: What Would You Change About C# if You Had The Chance? (For Novices and Experts)
Quote:
Originally Posted by penagate
Because once you break out of one loop you jump into the enclosing loop. You'd need a flag to say that you'd broken from the inner loop, and check that flag to see whether to break out of the outer loop also.
Sometimes break is useful. Maybe we should be able to specify how many levels to break out of, e.g.
Code:
for (i=0; i=5; ++i) {
for (j=0; j=5; ++j) {
if (j=3) break(2);
}
}
if you really have to, use a goto statement
-
Re: What Would You Change About C# if You Had The Chance? (For Novices and Experts)
Quote:
Originally Posted by MrPolite
if you really have to, use a goto statement
from The C Programming Language (K&R):
Quote:
Originally Posted by Kernighan & Ritchie
C provides the infinitely-abusable goto statement, and lables to branch to. Formally, the goto is never necessary, and in practice it is almost always easy to write code without it.
...
Code that relies on goto statements is generally harder to understand and to maintain than code without gotos.
-
Re: What Would You Change About C# if You Had The Chance? (For Novices and Experts)
lol I'm well aware of that.
but instead of re-inventing a new feature like that, if you're so desparate, you can just simply use the goto statement
:)