|
|
Invisible wrote:
> So does .Net have a less horribly broken library design then?
I would say it does, actually, yes.
Now, granted, it's very *complex*, because it has a lot in it. And some
of the design decisions aren't obvious unless you actually read the 20
or 30 pages of "this is why we did it this way" documentation.
For example, most of the classes say "static class methods are not
thread-safe, but instance methods are." Huh? Why would you do such a
thing? But the rationale is actually quite reasonable, and it's obvious
the designers had spent some time thinking it through.
The same with the organization of complex callbacks/events, where you
have a pre-change callback, a post-change callback, and throwing errors
results in different behaviors at different points in the process.
Complex, but when you go looking for "how do I do this..." you go "Oh,
they already made that work right."
The regexp matcher, for example, is also way complex compared to what
I'm normally used to. But it lets you match on one call multiple
subexpressions, find out where they matched, and so on. In that case,
there's really no "simpler" version, and the documentation is mildly
obtuse, but playing around with it a little and looking at the result
set in the debugger made it clear.
It also helps that there are things like events (linked lists of
callback pointers) and properties (automatically-named getter/setter pairs).
There are, of course, still warts, many caused by the static typing. For
example, the return type from the regular expression matcher is several
inter-related classes all referencing each other. Confusing, until you
actually read all the docs. Not more confusing than, say, trying to
understand C socket programming based on the man pages, tho.
There are also warts caused by interfacing to systems (like SQL) with
different data models (like, there's an "int?" type, which allows for
integers or NULL, but the IDE doesn't generate code to use that, instead
requiring things like resultset.column[2].isnull()).
The encryption stuff is kind of funky, as half of it is still using the
Windows library things, so like the encryption stuff only works if
you're running web pages under IIS, because it's using IIS's encryption
library.
I haven't had to deal with reflection, introspection, or code
generation, nor with all sorts of dynamic loading/programming/etc.
But overall, it's surprisingly clean.
--
Darren New / San Diego, CA, USA (PST)
On what day did God create the body thetans?
Post a reply to this message
|
|