code logs -> 2007 -> Sun, 08 Apr 2007< code.20070407.log - code.20070409.log >
--- Log opened Sun Apr 08 00:00:53 2007
00:27 gnolam [lenin@Nightstar-13557.8.5.253.se.wasadata.net] has quit [Quit: Z?]
00:33
< Janus>
... that's.
00:34 * Janus spent about two hours fiddling with string.h, to find out it needed to be using an std namespace.
00:35
< Janus>
Ever hear of abstinence?
00:36 * Janus gives <string> it's stupid std. In the face.
00:39 GeekSoldier is now known as GeekSoldier[A]
00:39 * GeekSoldier[A] is now away - Reason : Sleeping
00:40
< MyCatVerbs>
Janus: <cstring>, surely?
00:44
< Janus>
Are they different..?
00:45
< Janus>
Oh, hey~ You can just plop an "std::string" as a type instead of using the namespace.
00:53
<@Vornicus-Latens>
string gives you a C++ string class
00:53
<@Vornicus-Latens>
cstring gives you the C string functions.
00:56
<@McMartin>
Janus: std:: requires you to put that in front of every. Single. Fucking. Declaration. And. Function. Call.
00:57
<@McMartin>
Also, um, how did this only just now bite you?
00:57
<@McMartin>
You can't so much as pipe to cout without contending with the std namespace.
00:57
<@McMartin>
Which is one reason my C++ code written back when I was in high school lo these mumble-mumble-mumble years ago no longer compiles.
00:57
< Janus>
I've used it with a small census thing... but I thought that was just to get iostream to work.
00:57
<@McMartin>
std is for the entire library
00:58
<@McMartin>
After all, we can't allow anything to be reserved!
00:58
<@McMartin>
C++ code must faithfully replicate every single boneheaded decision C ever made!
00:58
<@McMartin>
Not that I am bitter.
00:58
<@Vornicus-Latens>
Of course not.
00:58
< Janus>
Of course. So... is there any negative things from just using the name space?
00:59
<@McMartin>
You can't name your variables cout.
00:59
<@McMartin>
(ZOMG NOES *dramatic chord*)
00:59
< Janus>
Or string?
00:59
<@McMartin>
That either.
00:59
<@McMartin>
Basically, any function defined in std becomes defined in global.
00:59
<@McMartin>
This actually isn't as bad in C++ as it is in, say, Java.
01:00
<@McMartin>
It's actually reasonable in Java to be leery of doing the import * thing.
01:00
<@McMartin>
But java automatically imports java.lang for you, which is the equivalent of std.
01:01
<@McMartin>
And actually, it occurs to me that even if using std you can still name your variable string as long as it's in some other namespace and you use the qualified name to refer to your variable.
01:02
< Janus>
Alright, so certain words are out; "string" seems a tad too common to reserve it like that, but awwell. Nothing else possibly bad happens though, right?
01:03
<@McMartin>
As far as I know, the only thing "using namespace whatever;" does is move symbols into the relevant namespace.
01:04
<@McMartin>
There are rather a lot of symbols defined in std, but they're also constantly used.
01:04
<@McMartin>
You don't get to name your variables strlen in C, either, not if you don't want your skull beaten in by dozens of enraged maintainers.
01:05 * McMartin isn't sure if it's guaranteed to check local definitions before imported ones.
01:05
<@McMartin>
Java tends to get slightly confused in those situations, particularly when you have a class mypackage.Iterator that extends java.util.Iterator.
01:06
<@McMartin>
Importing java.util.* in such a situation is rarely wise. Even if the code is right it will often confuse the readers.
01:08
< Janus>
The more one hears about Java, the more painful it feels. Not that there's any correlation or anything.
01:08
<@McMartin>
The indictment, is, IMAO, properly leveled against OOP in general.
01:09
<@McMartin>
But actually, this is a place where C++ and Java go to opposite extremes.
01:09
<@McMartin>
The entire C++ library is in one namespace: std. If you want to pull in *any* names, you basically have to pull in them all.
01:09
<@McMartin>
Java splits it up extremely finely, and the only ones that are always there are the ones like String and Integer.
01:10
<@McMartin>
And even then you can overload the names as long as you're careful about it.
01:10
<@McMartin>
In both -- to put it in C++ terms -- the fact that you're "using namespace std;" doesn't mean that std::vector won't work.
01:10
< Janus>
Ah, I see now... That's not so bad for Java then.
01:11
<@McMartin>
But if std::vector and mylib::vector are both different classes, it's Bad Form to rely on some declaration at the top of the source (or in a completely different file; hi there, .h files) to determine which you mean.
01:12
<@McMartin>
Also, I overstated the case against std slightly. Importing one thing means importing all of it, but because of the difference between C++ and Java linking disciplines, stuff that's in std but only in headers you don't #include won't cause conflicts.
01:12
<@McMartin>
(until someone modifies it because they need something from that file, but.)
01:12 Thaqui [~Thaqui@Nightstar-11596.jetstream.xtra.co.nz] has joined #code
01:12 mode/#code [+o Thaqui] by ChanServ
01:13
<@McMartin>
Java on the other hand uses namespaces as a global type identifier, so that any type that can be named can be linked in at any point.
01:13
<@McMartin>
Which is like Python's module system, and kiiiiinda like PHP's dynamic includes, but without the raging insanity.
01:13
<@McMartin>
(Java's namespace management is actually more complex like this; they implement a thermonuclear attack on the "DLL Hell" problem and do solve it For All Time, but actually being in that situation is Still Not Fun.)
01:14
<@McMartin>
(But you can, for instance, have one program using two contradictory versions of the same class at the same time, pass them around, and still have everything type-check.)
01:14
<@McMartin>
(The Tomcat webserver exploits this to ensure that each application it is hosting doesn't need library coherence with the other hosted applications.)
01:15
<@McMartin>
(But this is all a pointless aside, because the ability to do this really derives from the fact that Java is dynamically linked by default and C++ is statically linked.)
01:19
< MyCatVerbs>
Down with static-everything.
01:20
< MyCatVerbs>
Except for places where you need to iterate a few million times and the converse becomes a perf issue. ^^
01:20
<@McMartin>
Well, C++, like C, is only statically linked by default.
01:20 AnnoDomini [~farkoff@Nightstar-29279.neoplus.adsl.tpnet.pl] has quit [Quit: Some people find sanity a little confining.]
01:20 * Janus snaps out of info-overload.
01:20
<@McMartin>
You can do all the crazy reflection tricks Java uses to make component-based software not be excruciating pain.
01:20
<@McMartin>
It's just that doing them in C or C++ is, well, excruciating pain.
01:20
< MyCatVerbs>
McMartin: but you have to do 'em by hand. Which is excruciatingly painful?
01:20
<@McMartin>
Pretty much.
01:21 * McMartin may just not know his Python well enough, but he believes that Java beats Python at these specific tricks.
01:21
< MyCatVerbs>
McMartin: because the problem itself is excruciatingly painful, intrinsically, and the only reason it isn't the equivalent of having 240V alternating current wired to your genetalia in Java is the fact that Sun built it in and did it on your behalf?
01:22
<@McMartin>
MCV: Well, no. If it's built into the language, it's not actually that hard to do.
01:22
<@McMartin>
Building a Java runtime that handles all the dynamic stuff is an undergrad-level project.
01:22
<@McMartin>
Albeit one of probably at least three months.
01:22
<@McMartin>
You just have your runtime, the first time it sees a class reference, go "Oh hey, I haven't seen this. I shall load it up and then populate a data structure full of function pointers."
01:23
<@McMartin>
And then you've got Python, which does uses duck typing.
01:23
<@McMartin>
It's a trivial problem when you have that.
01:23
<@McMartin>
Because there aren't any type signatures *at all* to keep track of.
01:24
<@McMartin>
The only part I'm not remembering at the moment is whether or not Python lets you say "please import the module with the name corresponding to this string".
01:24
<@Vornicus-Latens>
Yes.
01:25
<@Vornicus-Latens>
there is a load() function that does that
01:25
<@McMartin>
Aha. In which case, life is good.
01:25
<@McMartin>
And with respect to component software, Java and Python are of roughly equal power and ease of use.
01:25
<@McMartin>
And the differences will have to do with the fact that Python uses duck typing and Java uses signatures.
02:34 GeekSoldier[A] [~Rob@Nightstar-4487.pools.arcor-ip.net] has quit [Ping Timeout]
03:02 Janus is now known as Jan[bathipoo]
03:02 MyCatVerbs is now known as MyCatSleeps
03:32 Mahal [~Mahal@Nightstar-763.worldnet.co.nz] has quit [Ping Timeout]
03:58 Jan[bathipoo] is now known as Janus
04:19
<@ToxicFrog>
McMartin: "duck typing"?
04:19
<@ToxicFrog>
Also, it occurs to me that as of Lua 5.1.1, I can apply metatables to strings.
04:20
<@ToxicFrog>
This means I can make str["2..3"] a synonym for string.sub(str, 2, 3), I think.
04:20
<@McMartin>
If obj.walk(), obj.talk(), and obj.quack() all do what you'd expect, than that object is of type Duck.
04:20
<@ToxicFrog>
Aah.
04:20 * ToxicFrog drops into C to test this out
04:21 * McMartin -- being an ivory-tower sort -- usually calls this "Smalltalk-style method resolution."
04:24 * ToxicFrog blinkblinks at the lstrlib.c source
04:24
<@ToxicFrog>
Apparently, as of Lua 5.1.1, the following is enabled by default:
04:24
<@ToxicFrog>
> foo = "abcd"
04:24
<@ToxicFrog>
> print(foo:sub(2,3))
04:24
<@ToxicFrog>
bc
04:35 Vornicus-Latens is now known as Vornicus
04:51 Thaqui [~Thaqui@Nightstar-11596.jetstream.xtra.co.nz] has quit [Ping Timeout]
06:05 Janus [~Cerulean@Nightstar-10302.columbus.res.rr.com] has quit [Quit: My portfolio is 2 days late, and it's -2% done. njr65e6hy~]
06:32 BlueTiger [BlueTiger@Nightstar-620.natsoe.res.rr.com] has joined #Code
06:33 Syloqs-AFH [Syloq@NetAdmin.Nightstar.Net] has quit [Connection reset by peer]
06:53 BlueTiger [BlueTiger@Nightstar-620.natsoe.res.rr.com] has quit [Quit: ]
07:13 ReivZzz is now known as Reiver
07:19 GeekSoldier [~Rob@Nightstar-4487.pools.arcor-ip.net] has joined #code
07:46 trap [~trapsarah@61.246.21.ns-2826] has joined #Code
07:46
< trap>
hello
07:47 trap [~trapsarah@61.246.21.ns-2826] has left #Code []
07:49
<@Vornicus>
goodbye
08:06 Doctor_Nick [~fdsaf@Nightstar-1992.9-67.se.res.rr.com] has joined #code
08:09 Thaqui [~Thaqui@Nightstar-11596.jetstream.xtra.co.nz] has joined #code
08:09 mode/#code [+o Thaqui] by ChanServ
08:13 Doctor_Nick [~fdsaf@Nightstar-1992.9-67.se.res.rr.com] has quit [Quit: ]
08:13 Thaqui [~Thaqui@Nightstar-11596.jetstream.xtra.co.nz] has quit [Ping Timeout]
08:14 AnnoDomini [~farkoff@Nightstar-29279.neoplus.adsl.tpnet.pl] has joined #Code
08:14 mode/#code [+o AnnoDomini] by ChanServ
08:25 GeekSoldier [~Rob@Nightstar-4487.pools.arcor-ip.net] has quit [Ping Timeout]
08:35 gnolam [lenin@Nightstar-13557.8.5.253.se.wasadata.net] has joined #Code
08:35 mode/#code [+o gnolam] by ChanServ
09:48 GeekSoldier [~Rob@Nightstar-3387.pools.arcor-ip.net] has joined #code
10:16 You're now known as TheWatcher
10:27 Vornicus is now known as Vornicus-Latens
11:13 Thaqui [~Thaqui@Nightstar-11596.jetstream.xtra.co.nz] has joined #code
11:13 mode/#code [+o Thaqui] by ChanServ
11:24 Serah [~Z@87.72.36.ns-26407] has quit [Ping Timeout]
11:27 Mahal [~Mahal@Nightstar-763.worldnet.co.nz] has joined #Code
11:27 mode/#code [+o Mahal] by ChanServ
11:40 Serah [~Z@87.72.36.ns-26407] has joined #Code
11:40 mode/#code [+o Serah] by ChanServ
11:57 GeekSoldier [~Rob@Nightstar-3387.pools.arcor-ip.net] has quit [Quit: vote Bush again in 2008... I need the money!]
12:19 Thaqui [~Thaqui@Nightstar-11596.jetstream.xtra.co.nz] has quit [Connection reset by peer]
12:21 Thaqui [~Thaqui@Nightstar-11596.jetstream.xtra.co.nz] has joined #code
12:21 mode/#code [+o Thaqui] by ChanServ
13:04 GeekSoldier [~Rob@Nightstar-3387.pools.arcor-ip.net] has joined #code
13:47 gnolam is now known as gnolam|RAG
13:49 GeekSoldier [~Rob@Nightstar-3387.pools.arcor-ip.net] has quit [Quit: vote Bush again in 2008... I need the money!]
14:22 Doctor_Nick [~fdsaf@Nightstar-1992.9-67.se.res.rr.com] has joined #code
14:32 GeekSoldier [~Rob@Nightstar-3387.pools.arcor-ip.net] has joined #code
14:46 GeekSoldier [~Rob@Nightstar-3387.pools.arcor-ip.net] has quit [Quit: vote Bush again in 2008... I need the money!]
14:47 AnnoDomini [~farkoff@Nightstar-29279.neoplus.adsl.tpnet.pl] has quit [Ping Timeout]
14:49 AnnoDomini [~farkoff@Nightstar-29279.neoplus.adsl.tpnet.pl] has joined #Code
14:49 mode/#code [+o AnnoDomini] by ChanServ
15:07 MyCatSleeps is now known as MyCatVerbs
15:42 Thaqui [~Thaqui@Nightstar-11596.jetstream.xtra.co.nz] has left #code [Leaving]
16:22 gnolam|RAG is now known as gnolam
16:32 Reiver is now known as ReivZzz
17:25 You're now known as TheWatcher[afk]
17:35 drnickaway [~fdsaf@Nightstar-1992.9-67.se.res.rr.com] has joined #code
17:36 Doctor_Nick [~fdsaf@Nightstar-1992.9-67.se.res.rr.com] has quit [Ping Timeout]
17:38 Doctor_Nick [~fdsaf@Nightstar-1992.9-67.se.res.rr.com] has joined #code
17:38 drnickaway [~fdsaf@Nightstar-1992.9-67.se.res.rr.com] has quit [Ping Timeout]
18:28 Janus [~Cerulean@Nightstar-10302.columbus.res.rr.com] has joined #Code
19:09 You're now known as TheWatcher
19:16 gnolam is now known as gnolam|300
19:25 KBot [~karma.bot@Nightstar-28960.neoplus.adsl.tpnet.pl] has joined #Code
19:25 AnnoDomini [~farkoff@Nightstar-29279.neoplus.adsl.tpnet.pl] has quit [Ping Timeout]
19:25 KarmaBot [~karma.bot@Nightstar-29279.neoplus.adsl.tpnet.pl] has quit [Ping Timeout]
19:26 KBot is now known as KarmaBot
19:26 AnnoDomini [~farkoff@Nightstar-28960.neoplus.adsl.tpnet.pl] has joined #Code
19:26 mode/#code [+o AnnoDomini] by ChanServ
19:35 Vornicus-Latens is now known as Vornicus
19:38 ryan [~Legend@60.51.42.ns-2935] has joined #Code
19:43
< ryan>
Pi: are u around here ? I wish server linking on Nightstar.net
19:43
< ryan>
u guys will still accecpting or not ?
19:43 * AnnoDomini is very suspicious.
19:44
<@jerith>
#Nightstar is the correct place for this conversation, ryan.
19:44
< ryan>
k
19:45
<@AnnoDomini>
I find taking someone with such... unorthodox... spelling seriously hard.
19:45
< ryan>
accepting*
19:45 ryan [~Legend@60.51.42.ns-2935] has left #Code []
19:47 * AnnoDomini wonders what server linking is.
19:48
<@ToxicFrog>
Adding a new server to the network.
19:49
< Janus>
Heh, thought that was another Ryan for a moment.
19:49
<@AnnoDomini>
Ah. I seem to remember reading something about NS not wanting to do such stuff. Or I misread it that way.
19:50
<@jerith>
We pretty much don't.
19:51
<@jerith>
At the very least, we don't want to link with randoms. We have enough people on the network currently who are competent to run whatever new servers we want to add, I suspect.
19:52 * AnnoDomini shall remember, and ask any such people if they are random in the future. :)
19:53
<@jerith>
Server linking is a trust thing.
19:53
<@jerith>
Because anyone who is a server admin is pretty much a network oper as well, as I understand it.
19:54
<@AnnoDomini>
T'would be hard to do otherwise, I would think.
19:55
<@ToxicFrog>
Well. It's possible to be a server admin without being a network oper.
19:55
<@ToxicFrog>
However, anyone who's an admin has the cability to make themselves an oper, since they have access to the config files.
19:59
< Janus>
The three servers we already have seem to be doing alright. Or, they're at least paper trained. Somewhat.
20:00
<@AnnoDomini>
We had some netsplits lately, though.
20:01
< Janus>
Maybe they just needed some space. :P
20:09
<@jerith>
I think they're pining for escher.
20:09 * jerith has fantasies of a fully-connected network and dynamic routing protocols.
20:10
<@jerith>
The trick is to do it without generating multicast storms.
20:21 Syloq [Syloq@NetAdmin.Nightstar.Net] has joined #code
20:48 Mahal [~Mahal@Nightstar-763.worldnet.co.nz] has quit [Quit: Goodbye.]
20:54 Mahal [~Mahal@Nightstar-763.worldnet.co.nz] has joined #Code
20:54 mode/#code [+o Mahal] by ChanServ
21:49 You're now known as TheWatcher[T-2]
21:52 You're now known as TheWatcher[zZzZ]
21:57 BlueTiger [BlueTiger@Nightstar-620.natsoe.res.rr.com] has joined #Code
22:18 Janus is now known as Jan[din]
22:38 BlueTiger [BlueTiger@Nightstar-620.natsoe.res.rr.com] has quit [Quit: ]
22:42 Syloq is now known as Syloqs-AFH
22:50 Mahal [~Mahal@Nightstar-763.worldnet.co.nz] has quit [Ping Timeout]
22:51 AnnoDomini [~farkoff@Nightstar-28960.neoplus.adsl.tpnet.pl] has quit [Quit: No fighting in the War Room!]
22:58 gnolam|300 is now known as gnolam
23:29 Doctor_Nick [~fdsaf@Nightstar-1992.9-67.se.res.rr.com] has quit [Ping Timeout]
23:43 Jan[din] is now known as Janus
23:46 EvilDarkLord is now known as Jo}{n
23:48 ReivZzz is now known as Reiver
--- Log closed Mon Apr 09 00:00:53 2007
code logs -> 2007 -> Sun, 08 Apr 2007< code.20070407.log - code.20070409.log >