Originally posted by smitty3268
View Post
Announcement
Collapse
No announcement yet.
Ubuntu Developers Discuss Using Mono AOT
Collapse
X
-
-
Originally posted by curaga View PostBTW, Control.FindControl seems to be a web function, would it have worked in WPF?
http://msdn.microsoft.com/en-us/library/486wc64h.aspx
To be honest, I'm not in love with the direction WPF went, that does seem overly complicated, even if it is possible.
Leave a comment:
-
Originally posted by curaga View PostNo, that's where it doesn't compile, because "using System.blah.foo.bar.xyzz;" is somehow not valid even when having one or two levels less is. I don't mean classes, but static methods and the like; they can never be used just by their name, it's always at least one level of unnecessary fuzz.
For example (may be wrong, just for illustration), Math.PI always has to be typed like that, you can't "using Math" and then type "PI".
Still, that's only 1 level - i have a hard time seeing how Math.PI is that much worse than PI. You shouldn't ever need to do some entire System.blah.foo.bar.Math.PI.
Edit:
Oh, maybe you are talking about things like Application.Current.MainWindow.
That's simply chaining calls together.
Application app = Application.Current; //calls a static method in the Application class
app.MainWindow; //gets the object from the Application class
It's a pretty common convention in C# i suppose. But it really has nothing to do with the using statement.Last edited by smitty3268; 12 May 2012, 05:19 PM.
Leave a comment:
-
Umm, that's exactly what you do.
using System.blah.foo.bar.xyzz;
new something(); //where something is defined in namespace System.blah.foo.bar.xyzz
is correct. If there is a conflict, such as 2 classes in different namespaces that have the same name, then you can even redefine one of them.
using something2 = System.blah.foo.bar.xyzz.something;
new something2();
For example (may be wrong, just for illustration), Math.PI always has to be typed like that, you can't "using Math" and then type "PI".
I'm starting to think you just don't know how to program in C#, and are assuming a lot of things to be true that aren't.
Leave a comment:
-
Originally posted by curaga View PostNice how you skipped the memory part No I don't want my app leaking a meg per second until the GC sees fit to come clean things with a gig or two spent. Causing a huge pause, of course.
Equally bad to Java and worse than C++, IMHO.
I had this one case where I needed to dynamically handle some 500 checkboxes. So of course I wanted to address them by their name, dynamically generated string, at runtime, "checkbox001" and so on. Given that the language is not compiled to machine code, I expect it to take advantage of that and so support features like that, by default.
In that case I couldn't find a way to make the reflection etc work well enough, and had to insert a huge kludge (Dictionary binding the strings to object names, IIRC).
Controls.FindControls("name", true);
That's with the MS APIs, maybe you were using GTK bindings or something?
But what I meant more was the "include" replacement.
I can type
using System.blah;
And then use those things by typing "System.blah.foo.bar.xyzz.something". Overly verbose.
Now, why can't I type "using System.blah.foo.bar.xyzz;" and use the objects directly as "something"? Illogical. That works for some parts and not others.
using System.blah.foo.bar.xyzz;
new something(); //where something is defined in namespace System.blah.foo.bar.xyzz
is correct. If there is a conflict, such as 2 classes in different namespaces that have the same name, then you can even redefine one of them.
using something2 = System.blah.foo.bar.xyzz.something;
new something2();
Because of the mentioned above over-verboseness and "using", among other ugly parts of the language.
Leave a comment:
-
Nice how you skipped the memory part No I don't want my app leaking a meg per second until the GC sees fit to come clean things with a gig or two spent. Causing a huge pause, of course.
Originally posted by smitty3268 View PostSure, it can get verbose, but it's far better than java and I'd say about on par with C++.
Can you go into details of this? Why doesn't reflection work for you? You can certainly iterate through the properties of an object and return just those that are strings if you want. Or did you mean looking up a field by it's variable name? Of course you can do that - the API is pretty ugly, but it's obviously possible.
In that case I couldn't find a way to make the reflection etc work well enough, and had to insert a huge kludge (Dictionary binding the strings to object names, IIRC).
I'm not sure why you find it illogical, but even if you do it's completely optional. "using" is just a syntax shortcut you can replace as follows:
using (IDisposable d = new X()) {
//statements with d in scope here
}
IDisposable d = new X();
try {
//statements with d in scope here
}
finally {
d.Dispose();
d = null;
}
I can type
using System.blah;
And then use those things by typing "System.blah.foo.bar.xyzz.something". Overly verbose.
Now, why can't I type "using System.blah.foo.bar.xyzz;" and use the objects directly as "something"? Illogical. That works for some parts and not others.
Why in the world would you want one? Getting rid of macros is a positive feature of the language, not a negative one.
Leave a comment:
-
Originally posted by curaga View Posthorrible, verbose syntax
being a bytecode language without any of the benefits (no way to addess objects by their name, ie a string. No the reflection/introspection/etc extensions don't work for this.)
slow startup (same as Java)
completely illogical parts like "using"
using (IDisposable d = new X()) {
//statements with d in scope here
}
IDisposable d = new X();
try {
//statements with d in scope here
}
finally {
d.Dispose();
d = null;
}
no macro processor at allLast edited by smitty3268; 12 May 2012, 03:42 PM.
Leave a comment:
-
Originally posted by 89c51 View Postobligatory because there are certain words that create a mess everytime someone mentions them. some are Mono, Pulseaudio, Systemd, Lennart Poettering, Microsoft, network transparency etc
DO NOT MESS with my network transparency! 98% of my work is done over the network.
Leave a comment:
-
yes about dalvik. remember that google developed dalvik to address the specific need they had. openjdk(sun's opensource release of their java ecosystem, you must remember there are different javas out there just like mono is a type of .net) is developed with the understanding that its probobly gunna be run on a desktop or a laptop or a blue ray player or soemthing that will have 128 meg or ram or more and a floting point proccessing unit. the company google bout that was making android started back in somehting like 2003 and started to have soemthing to show in around 2005-2006. think about what a phone had at that time. you had less than 128 meg of ram. an arm5 or less proccessor that had no bells and wistles to make floating point or anyhting like that easier, and you had like 128 meg of storage at best. that is the envronment that dalvik was designed to support. it wasnt designed to be fast but to be really efficient. java EM (sun had a special, much more proprietary ecosystem of java for the embedded phone market, an this is the basis of much of oracles case against google) was what dalvik was ment to compeate with. so compairing mono, a fully fleged speed optimized platform to the dalvik interpreter isn't a fair comparison. mono wont run on the things dalvik will.
one could argue that with the new cortex based asic's with floating point proccessors and 512-1 gig memory and 4-8 gigs of storage, we are geting into the realm of full fleged run time environments where openjdk's hotspot intermriter would thrive. however, oracle is really trowing a stick in that wheel. actualy there was a bit of news (more like non news if you really think about it) that came out just a couple days ago. kinda suprised micheal hasnt mentioned anything about that. whatever though, there wasnt any crappy beer involved so i guess it didnt catch his attention.
Leave a comment:
Leave a comment: