IRC Networks
Irc Logs Stats
Start date: 2007-09-27 02:48:27
Last update: 2008-10-24 20:19:38
Channels: 41
Logged Lines: 6230436
Size: 1822.40 MB
Powered by
Channel Info
Network: freenodeChannel: #csharp |
Search in www.irclog.org
Log from #csharp at freenode 2006-09-04
[11:31]<afd>but i have to fix the time
[11:54]<izrb>Do you guys use Visual C#?
[11:55]<zyccus>IraB: yes
[11:56]<ycnr>VB.Net!
[11:57]<zyccus>well I mainly use VB.NET :P
[12:08]<szzcd>hey, has anyone got experice with "File Installation" with vs2003?
[12:12]<pzrrnrvqt0wr>what experience is there to be?
[12:12]<pzrrnrvqt0wr>you just install the file
[12:13]<szzcd>yeah well it is creating an .msi, and I want to put a condition on whether to install it
[12:14]<pzrrnrvqt0wr>whot do you mean condition whether to install it?
[12:14]<cjfm_fusyjg>can someone remind me, what was the the bonus of doing something like: x = list.selected item AS c; instead of cating (c)?
[12:14]<cjfm_fusyjg>casting
[12:14]<pzrrnrvqt0wr>Cold_Fusion: here is not vb.net.
[12:14]<cjfm_fusyjg>it's c# and you can do AS in c#
[12:15]<pzrrnrvqt0wr>uh.
[12:15]<pzrrnrvqt0wr>wtf?
[12:15]<cjfm_fusyjg>yeap.
[12:15]<pzrrnrvqt0wr>who inserted extra stupidity in C#?
[12:15]<cjfm_fusyjg>I just forgot the bonus of it, what the actuall difference between AS and casting is
[12:15]<szzcd>Priest-of-Psi: It is for a .dll if it exists I dont want to install it, since it causes a "read only" error in the MSI installer.
[12:15]<cjfm_fusyjg>so can someone remind me?
[12:16]<rwyfcygs>I think it's an exception thing
[12:16]<rwyfcygs>As I recall, as returns null and does not throw an exception... (just checking)
[12:16]<cjfm_fusyjg>yeah I think so too, but was it not something more...
[12:17]<pzrrnrvqt0wr>why would anybody use that as stupid-ass convention, is beyong me.
[12:17]<rwyfcygs>THe other thing is that it doesn't go through user-written cast routines
[12:17]<cjfm_fusyjg>so it's faster
[12:18]<rwyfcygs>Well, it's faster if i) You are commonly expecting your cast to fail
[12:18]<rwyfcygs>and ii) You haven't written explicit cast routines
[12:18]<pzrrnrvqt0wr>"expecting your cast to fail"
[12:18]<pzrrnrvqt0wr>that's great programming right there.
[12:19]<pzrrnrvqt0wr>never mind TypeOf.
[12:19]<cjfm_fusyjg>lol didnt know that one
[12:19]<cjfm_fusyjg><awilkins> Well, it's faster if i) You are commonly expecting your cast to fail
[12:19]<cjfm_fusyjg>that
[12:19]<rwyfcygs>Well, exceptions are expensive...
[12:19]<pzrrnrvqt0wr>yes, that's why you use them sparingly
[12:20]<rwyfcygs>So using as and checking for null would be faster. ... of course, it might be better to check that the type will cast beforehand
[12:20]<pzrrnrvqt0wr>people who "expect their cast to fail" code using the exception-driven paradigm.
[12:20]<pzrrnrvqt0wr>the whole program is driven by exceptions.
[12:20]<pzrrnrvqt0wr>(hint, it's stupid)
[12:20]<lcs>or just use if(object is SomeType)
[12:20]<rwyfcygs>I'm not saying it's good design, I'm just trying to justify the presence of both means of casting.
[12:21]<pzrrnrvqt0wr>what pks siad.
[12:21]<pzrrnrvqt0wr>awilkins: oh, i get your point, i'm just saying bad design needs no justification. just re-design :)
[12:21]<lcs>heheh, true
[12:21]<rwyfcygs>What pks said is probably what "as" does internally anyways...
[12:21]<lcs>so called fubar ;)
[12:21]<pzrrnrvqt0wr>i mean, we're supposed to be the tech elite
[12:21]<lcs>awilkins: yes, you can do the same thing with as
[12:22]<pzrrnrvqt0wr>why the fuck settle for something less than the best design?
[12:22]<dyvaxnfja>time
[12:22]<lcs>awilkins: but it takes longer to write if(object as SomeType != null)
[12:22]<pzynsv-jp-psy>Sarky: ?
[12:22]<lcs>so its worse ;)
[12:22]<rwyfcygs>I can see one case where "as" might be useful, (but it would be incredibly bone-headed design) ; if you want to cast one compatible type to another but avoid the explicit cast operator.
[12:23]<szzcd>Priest-of-Psi?
[12:23]<cjfm_fusyjg>so, how'd you write current = combobox.selecteditem as x; you'd use a cast or instead?
[12:23]<szzcd>Priest-of-Psi wrong p and autocomplte sorry :(
[12:23]<pzynsv-jp-psy>:P
[12:23]<lcs>Cold_Fusion: use only cast when object is a value type
[12:23]<lcs>Cold_Fusion: otherwise better use this 'as' thingie
[12:23]<cjfm_fusyjg>current is an object with several values...
[12:24]<lcs>coz it does not throw exception when combobox.selecteditem is null
[12:24]<cjfm_fusyjg>always the same type of object thou
[12:24]<lcs>it just returns null
[12:24]<szzcd>Project2501a: It is for a .dll if it exists I dont want to install it, since it causes a "read only" error in the MSI installer.
[12:25]<kjr>awilkins: there are some times where you don't need hard cast failures
[12:25]<kjr>so it's not necessarily about expecting failure
[12:25]<kjr>so much as failure not being critical
[12:26]<cjfm_fusyjg>aight thanks
[12:28]<pzrrnrvqt0wr>you know string selectedItemString = (string) combobox.selecteditem ; works wonders.
[12:29]<pzrrnrvqt0wr>but that's just my lame excuse, cuz i still remember my C.
[12:31]<rwyfcygs>I always used to use the IteTag properties on the VB controls
[12:32]<rwyfcygs>I like the Tag properties in general.
[12:32]<pzrrnrvqt0wr>you know, that reminds me of an old post in comp.lang.c
[12:32]<pzrrnrvqt0wr>there was this Algol programmer who was very fond of his language
[12:32]<rwyfcygs>A scary one?
[12:33]<pzrrnrvqt0wr>so, when his company switched over to C, and he discovered the preprocessor macros
[12:33]<pzrrnrvqt0wr>he recoded ALL the C constructs into the Algol ones, using the preprocessor
[12:33]<pzrrnrvqt0wr>so, he could code Algol, while compiling in C.
[12:33]<pzrrnrvqt0wr>yes, it was scary
[12:34]<pzrrnrvqt0wr>but it was funny, too
[12:34]<pzrrnrvqt0wr>16 years later, i still laugh about it.
[12:34]<rwyfcygs>Heh. Isn't that the way most compilers are today anyway?
[12:34]<pzrrnrvqt0wr>no.
[12:34]<pzrrnrvqt0wr>compilers are translators
[12:34]<pzrrnrvqt0wr>you don't write greek using english chars, i'm sorry, nobody would understand you.
[12:36]<rwyfcygs>I was labouring under the impression that since the C compiler was small and realtively easy to implement, that if you can make your compiler output C code, then that would work quite nicely.
[12:37]<pzrrnrvqt0wr>how many compilers have you coded?
[12:37]<rwyfcygs>None :-)
[12:37]<rwyfcygs>But I believe I'm quoting an idea from an aritcle about compilers.
[12:37]<pzrrnrvqt0wr>Q.E.D.
[12:37]<pzrrnrvqt0wr>Q.E.D.
[12:38]<rwyfcygs>How many compilers have you coded?
[12:38]<pzrrnrvqt0wr>i'm on my second.
[12:38]<pzrrnrvqt0wr>it's a VB6 compiler, believe it or not.
[12:39]<rwyfcygs>Just for reference, this is where I got my misguided ideas from, perhaps you'd like to correct them. http://en.wikipedia.org/wiki/C_programming_language#Usage
[12:40]<rwyfcygs>Maybe "most" was a bit strong.
[12:40]<pzrrnrvqt0wr>will fix.







