code logs -> 2010 -> Sun, 21 Mar 2010< code.20100320.log - code.20100322.log >
--- Log opened Sun Mar 21 00:00:40 2010
00:01
< Namegduf>
The interesting part for me is when it becomes "Use continue, or use another indentation level for the rest of everything"
00:01
< Namegduf>
In which case you're trading less conditional on top of conditional on top of conditional, which I find makes things harder to follow, for non-straightforward code flow.
00:01
< Namegduf>
Or visa versa.
00:02
< Namegduf>
I tend to pick situationally, there.
00:02
< Namegduf>
And go for a pattern, obviously.
00:02
< Namegduf>
A line of if (blah) continue; at the start isn't so bad.
00:02
< Namegduf>
A single random continue; somewhere...
00:03
< celticminstrel>
I tend to have rather long code lines.
00:04
< celticminstrel>
I also tend to not put a line break between the "template< ... >" and the actual function prototype.
00:04
< celticminstrel>
Unless it simply won't all fit on one line, that is.
00:04 * celticminstrel is trying to do PHP redirection now.
00:04
< Namegduf>
"// Panic, the world is corrupted and all is lost."
00:04
<@AnnoDomini>
I tend to make lines of code as long as they are necessary.
00:04
< Namegduf>
I improved "// This shouldn't happen"
00:04
<@AnnoDomini>
But I do tend to break them up if they take up more than the width of the window.
00:05
< Namegduf>
I "try".
00:05
< celticminstrel>
As do I.
00:05
< celticminstrel>
^ to Anno
00:05
< Namegduf>
Java makes going for perfection rather futile
00:05
< celticminstrel>
Java is annoying sometimes.
00:05
< celticminstrel>
Maybe that's why I don't use it much.
00:05
< Namegduf>
"InputStreamReader blah = new InputStreamReader(foobar);" at a decent indentation level is already quite damn long, and that's just creating a new variable
00:06
< Namegduf>
I like languages with "blah := new InputStreamReader(foobar);" for that kind of thing.
00:06
< Namegduf>
In which the type of blah is inferred from the righthand side.
00:06
< Namegduf>
Also, I don't see the point of the new keyword, I should read up and find out why it's really there.
00:07
< Tarinaky>
In practice I find that template won't fit comfortably on the ssame line as the function prototype.
00:07
< Tarinaky>
So in the interest of consistency I put a line break in every time.
00:07 * AnnoDomini works in full screen.
00:07
< Tarinaky>
Since even if it will fit it'll only be 4 characters short of a wrap anyway.
00:07 * Tarinaky uses a text editor scaled to a very narrow size.
00:08 * Tarinaky find short lines easier to read.
00:08
< Tarinaky>
*finds
00:08
< Tarinaky>
Short staccatto (sp?) lines.
00:08
< Namegduf>
Me too.
00:09
<@AnnoDomini>
Whereas I like seeing as much code on a screen as possible.
00:09
<@AnnoDomini>
I tend to use wide fonts.
00:09
< celticminstrel>
Correct spelling, Tarinaky.
00:09
< celticminstrel>
Oh wait.
00:09
< Namegduf>
What're the kinda policies people here have about non-straightforward code flow, good/bad ways to use break/continue and friends?
00:10
< celticminstrel>
Sorry, it's just one T, according to my spell-checker.
00:10
< celticminstrel>
Language?
00:10
< Namegduf>
Any, I guess. If it varies by language I'd be interested in how.
00:10 Attilla_ [Attilla@FBC920.642D35.7B2B85.11BB86] has joined #code
00:10
< Namegduf>
"Goto outside of a very clear, preferrably well-commented pattern, and only when there's no better way to do that pattern, is evil." is the only real one I've figured for sure.
00:11
< celticminstrel>
The only variants I'm aware of are C++ and Java.
00:11
< Tarinaky>
"Never use goto unless terrorists have kidnapped your daughter and are threatening to kill her - and even then only for as long as it takes for you to go Commando and save her."
00:11
< celticminstrel>
And the only difference is that Java allows labelled breaks/continues, which in C++ would have to be done with goto.
00:11
< Namegduf>
By "well-commented pattern" I'm mostly thinking about error handling in C, for which using it to jump to an error handling block at the end of a function before returning can be the clearest way of getting cleanup in all cases, I think.
00:12 * AnnoDomini tries to find good examples of LINQ to SQL with more than two tables used.
00:12
<@AnnoDomini>
I need to select from four. :/
00:12
< celticminstrel>
Using goto to break out of several loops at once is reasonable too.
00:12
< Tarinaky>
I try to avoid using continue and break.
00:12
< Namegduf>
celticminstrel: Ah, yes, when multilevel break isn't available.
00:12
< Tarinaky>
Although this is probably to my detriment.
00:12
< celticminstrel>
I don't.
00:12
< Namegduf>
I don't, but I wonder if that (ready use of continue/break) is to my detriment.
00:13 Attilla [Attilla@FBC920.398CA6.E1414C.85D335] has quit [Ping timeout: 121 seconds]
00:13
< Tarinaky>
If it's the right tool for the job, it's the right tool for the job.
00:13
<@ToxicFrog>
continue is a pretty natural way of doing filters in languages that don't have it (or on inputs that you can't filter with your language construct for it)
00:14
<@ToxicFrog>
Break, similarly, is useful when the termination condition can't be cleanly expressed as part of the loop itself.
00:14 Attilla_ is now known as Attilla
00:14
< Namegduf>
But using them midloop... less than elegant?
00:15
< celticminstrel>
Not necessarily?
00:15
< celticminstrel>
Depends?
00:16
<@ToxicFrog>
Depends.
00:17
<@ToxicFrog>
There's no such thing as a bad language feature*, just bad usage.
00:17
<@ToxicFrog>
* Probably
00:17
< Namegduf>
COMEFROM.
00:17
< celticminstrel>
Not even export?
00:17
<@ToxicFrog>
...I am not willing to categorically state that there is no situation in which COMEFROM is the right tool.
00:17
<@ToxicFrog>
Although cron knows I can't think of any.
00:17
< Namegduf>
Haha, okay.
00:17
< Namegduf>
Makes sense as a stance.
00:18
< Namegduf>
Would not stop me murdering anyone who used it if it existed in any codebase I'd murder over.
00:18
< celticminstrel>
..what's COMEFROM?
00:18
< Namegduf>
It's a reverse GOTO
00:18
< celticminstrel>
...
00:19
<@AnnoDomini>
I imagine it like a verbose RET. :P
00:19
< Namegduf>
"COMEFROM is roughly the opposite of GOTO in that it can take the execution state from any arbitrary point in code to a COMEFROM statement. The point in code where the state transfer happens is usually given as a parameter to COMEFROM. Whether the transfer happens before or after the instruction at the specified transfer point depends on the language used."
00:19
< Namegduf>
"Depending on the language used, multiple COMEFROMs referencing the same departure point may be invalid, be non-deterministic, be executed in some sort of defined priority, or even induce parallel or otherwise concurrent execution as seen in Threaded Intercal."
00:19
< celticminstrel>
Doesn't sound very useful.
00:20
< Namegduf>
"Intercal" is the hint.
00:20
< Namegduf>
It was a joke feature added because it was such a horrible pain.
00:20
< Namegduf>
Oooh, that'd be a challenge.
00:20
< celticminstrel>
?
00:20
< Namegduf>
To write maintainable Intercal.
00:20
<@ToxicFrog>
I could see uses for it in debugging or monkeypatching, although in those cases the real question is "why doesn't this language have features that are better suited for implementing this"
00:20
< Namegduf>
Develop patterns to maintain and look after a decently sized Intercal codebase.
00:21
<@ToxicFrog>
Step one, write a compiler that takes a real language and emits intercal~
00:21
< Namegduf>
Haha.
00:21 Orthia [orthianz@Nightstar-0878cfcd.xnet.co.nz] has joined #code
00:24
<@AnnoDomini>
Orthia: Post in Nuke.
00:27
<@AnnoDomini>
GNRGNARD.
00:32 gnolam [lenin@Nightstar-38637aa0.priv.bahnhof.se] has quit [Ping timeout: 121 seconds]
00:34
<@AnnoDomini>
Alright, fuck the lack of extensible examples.
00:34 * AnnoDomini goes do something horribly inefficient which will hopefully get the job done.
00:36 gnolam [lenin@Nightstar-38637aa0.priv.bahnhof.se] has joined #code
00:38
<@AnnoDomini>
Unfortunately, the join syntax seems to be made of spiders.
00:47
<@AnnoDomini>
Hatehatehatehate.
00:49
< Namegduf>
It hates you.
00:50
<@Vornicus>
you shoulcn't need to use JOIN if you've got an ORM running.
00:52
<@AnnoDomini>
A what?
00:52
< Namegduf>
Object to database layer thigny
00:52
<@Vornicus>
ORM: Object-relational model, a thing that turns a database into what appears to be a pile of objects.
00:52
< Namegduf>
Ah, right.
00:52
<@AnnoDomini>
Okay, FINALLY. I've found an example that doesn't looked like it was typed by a drunken monkey.
00:53
<@AnnoDomini>
-ed
00:54
<@AnnoDomini>
I have no idea why the tutorials almost invariably assume that single-letter names for variables are a good thing in situations where there are very many different things close to each other.
01:04
<@AnnoDomini>
Hmmmm.
01:04
<@AnnoDomini>
Testing it on another page shows that nothing is overtly wrong.
01:04
<@AnnoDomini>
But it fails utterly when used in an iterator.
01:05 You're now known as TheWatcher[T-2]
01:08 You're now known as TheWatcher[zZzZ]
01:08
<@AnnoDomini>
Oh, I see.
01:08
<@AnnoDomini>
I forgot a field.
01:08
<@AnnoDomini>
And the mass of garbage called an error message obscured the reason.
01:09
<@AnnoDomini>
Now onto the remaining three or four pages.
01:13 * AnnoDomini finds a comment.
01:13
<@AnnoDomini>
// this is a work in progress
01:14
<@AnnoDomini>
I put it there like half a year ago.
01:21
< Namegduf>
Listening to Weird Al actually makes Java enjoyable.
01:21
< Namegduf>
I've no idea what what says about anything.
01:21
<@AnnoDomini>
Pavlov was right.
01:22
< Namegduf>
I think I failed my Knowledge - Psychology, Russian check.
01:22
< Namegduf>
And a Knowledge - Wikipedia check.
01:23
<@AnnoDomini>
You play DnD?
01:23
< Namegduf>
Played 1E and 2E before.
01:23
< Namegduf>
Was going to get into a 3E campaign, but never did; I just follow the humour anyway. :P
01:23
<@AnnoDomini>
Ha.
01:24
< Namegduf>
I did read through the rule, a few examples of other rules, and the guide to creating Pun-Pun.
01:26
<@AnnoDomini>
The rule? You mean the core mechanic? :P
01:26 * AnnoDomini is done.
01:26
< Namegduf>
Er, rules
01:26
< Namegduf>
Core rules.
01:26
<@AnnoDomini>
I see.
01:26
< Namegduf>
You don't need to read The Rule.
01:27 * AnnoDomini got into roleplaying via 3.5e.
01:28
<@AnnoDomini>
It's half to three in the morning, but I'm done with converting my project to LINQ to SQL.
01:28
< Namegduf>
"Half to three"...
01:28
< Namegduf>
Your means of measuring time is awesome, if you're in GMT.
01:28
<@AnnoDomini>
I have belatedly learned how to use joins.
01:28
<@AnnoDomini>
Namegduf: I'm not in GMT. Close, however.
01:29
< Namegduf>
Ah, okay.
01:29
< Namegduf>
+1, then.
01:29
<@AnnoDomini>
What's so awesome about half to three?
01:29
< Namegduf>
Well, it's 1:30 GMT.
01:30
<@AnnoDomini>
Ahahaha.
01:30
< Namegduf>
Which would imply that you're measuring time specifically around 3AM.
01:30
<@AnnoDomini>
My project is now injection-proof, thanks to the new technology.
01:31
<@AnnoDomini>
Up until now, I've been using WHERE clauses rather than JOINS to achieve the same effect.
01:31
<@AnnoDomini>
I did not pay much attention in the databases class.
01:32
<@Kazriko>
and crossjoins?
01:32
<@Kazriko>
from blah,blah2?
01:32
<@AnnoDomini>
Uhhhh.
01:33
<@AnnoDomini>
I can confidently say that I've never used a crossjoin in my life.
01:33
<@Kazriko>
you can accomplish a join using that and a where statement.
01:33
<@Kazriko>
not recommended though.
01:36
<@AnnoDomini>
Well, I used WHERE exclusively.
01:40
< celticminstrel>
There are very few good reasons to use a cross join, and I can't think of what they are.
01:40 * AnnoDomini goes to remove the rubbish that got inserted into the database through testing.
01:42
<@Vornicus>
cartesian product/minkowsky sum
01:50
< celticminstrel>
I know what a cross join is...
01:56 AnnoDomini [annodomini@Nightstar-dc7b9874.adsl.tpnet.pl] has quit [[NS] Quit: Stuff two days ahead of schedule. Yay.]
03:22 Serah^GO^AWAY [Z@26ECB6.A4B64C.298B52.D80DA0] has quit [Ping timeout: 121 seconds]
03:34
<@ToxicFrog>
"I'm not a real programmer. I throw together things until it works then I move on. The real programmers will say "yeah it works but you're leaking memory everywhere. Perhaps we should fix that." I'll just restart apache every 10 requests."
03:34
<@ToxicFrog>
-- Rasmus Lerdorf, inventor of PHP
03:38 celticminstrel [celticminstre@Nightstar-f8b608eb.cable.rogers.com] has quit [[NS] Quit: *hums* Can't stay now!]
03:41
< Namegduf>
Hmm.
03:41
< Namegduf>
Coding at past 3AM...
03:42
< Namegduf>
I'm looking at these lines I wrote within the last five minutes. I've documented this method as "Open the door" and nothing else. Its signature is "public static void main(String[] args)"
03:42
< Namegduf>
And I literally have no memory of writing those words.
03:52 Serah [Z@3A600C.A966FF.5BF32D.8E7ABA] has joined #code
04:21 Firelord [2kindscom@Nightstar-f161076b.hlrn.qwest.net] has joined #code
04:21 Firelord [2kindscom@Nightstar-f161076b.hlrn.qwest.net] has left #code []
04:39 gnolam [lenin@Nightstar-38637aa0.priv.bahnhof.se] has quit [[NS] Quit: Z?]
07:24 Rhamphoryncus [rhamph@Nightstar-8931f88f.abhsia.telus.net] has quit [Client exited]
07:33 Vornicus is now known as Vornicus-Latens
09:23 You're now known as TheWatcher
09:32 AnnoDomini [annodomini@Nightstar-dc7b9874.adsl.tpnet.pl] has joined #code
09:32 mode/#code [+o AnnoDomini] by Reiver
10:26 AnnoDomini [annodomini@Nightstar-dc7b9874.adsl.tpnet.pl] has quit [Ping timeout: 121 seconds]
10:28 AnnoDomini [annodomini@Nightstar-ef18c6e6.adsl.tpnet.pl] has joined #code
10:28 mode/#code [+o AnnoDomini] by Reiver
10:36 Thaqui [Thaqui@27B34E.D54D49.F53FA1.6A113C] has quit [[NS] Quit: This computer has gone to sleep]
10:48 Tarinaky [Tarinaky@Nightstar-feebdd0d.adsl.virginmedia.net] has quit [Ping timeout: 121 seconds]
11:02 Tarinaky [Tarinaky@Nightstar-8953ef17.adsl.virginmedia.net] has joined #code
11:10 Tarinaky [Tarinaky@Nightstar-8953ef17.adsl.virginmedia.net] has quit [Connection closed]
11:15 Tarinaky [Tarinaky@Nightstar-8953ef17.adsl.virginmedia.net] has joined #code
12:29 AnnoDomini [annodomini@Nightstar-ef18c6e6.adsl.tpnet.pl] has quit [[NS] Quit: Will return. Maybe.]
12:38 AnnoDomini [annodomini@Nightstar-ef18c6e6.adsl.tpnet.pl] has joined #code
12:38 mode/#code [+o AnnoDomini] by Reiver
13:01 celticminstrel [celticminstre@Nightstar-f8b608eb.cable.rogers.com] has joined #code
13:13 Serah [Z@3A600C.A966FF.5BF32D.8E7ABA] has quit [Connection reset by peer]
13:13 Serah [Z@3A600C.A966FF.5BF32D.8E7ABA] has joined #code
13:15 Searh [Z@3A600C.A966FF.5BF32D.8E7ABA] has joined #code
13:15 Serah [Z@3A600C.A966FF.5BF32D.8E7ABA] has quit [Connection reset by peer]
13:15 Searh [Z@3A600C.A966FF.5BF32D.8E7ABA] has quit [[NS] Quit: The world is so funny sometimes; I often forget to laugh.]
13:18 Serah [Z@3A600C.A966FF.5BF32D.8E7ABA] has joined #code
14:01 You're now known as TheWatcher[afk]
14:25 Serah [Z@3A600C.A966FF.5BF32D.8E7ABA] has quit [Ping timeout: 121 seconds]
14:41 gnolam [lenin@Nightstar-38637aa0.priv.bahnhof.se] has joined #code
14:44 Attilla [Attilla@FBC920.642D35.7B2B85.11BB86] has quit [[NS] Quit: ]
15:00 Serah [Z@26ECB6.A4B64C.298B52.D80DA0] has joined #code
15:39 Attilla [Attilla@FBC920.642D35.7B2B85.11BB86] has joined #code
15:39 mode/#code [+o Attilla] by Reiver
17:33 Tarinaky [Tarinaky@Nightstar-8953ef17.adsl.virginmedia.net] has quit [Connection closed]
17:47 ToxicFrog [ToxicFrog@ServerAdministrator.Nightstar.Net] has quit [Operation timed out]
17:49 SmithKurosaki [Smith@Nightstar-e241a42d.dsl.teksavvy.com] has quit [Ping timeout: 121 seconds]
17:50 ToxicFrog [ToxicFrog@ServerAdministrator.Nightstar.Net] has joined #code
17:50 mode/#code [+o ToxicFrog] by Reiver
17:50 SmithKurosaki [Smith@Nightstar-b74e42f9.dsl.teksavvy.com] has joined #code
18:07 Vornicus-Latens is now known as Vornicus
18:23 Orthia [orthianz@Nightstar-0878cfcd.xnet.co.nz] has quit [Connection reset by peer]
18:31 Orthia [orthianz@Nightstar-0878cfcd.xnet.co.nz] has joined #code
18:53 Rhamphoryncus [rhamph@Nightstar-8931f88f.abhsia.telus.net] has joined #code
19:09
< gnolam>
http://i.imgur.com/RQcCi.jpg
19:09
< Namegduf>
XD
19:09
<@AnnoDomini>
LOL Poland.
19:29
<@Vornicus>
...a sql injection attack on automated license plate scanners.
19:29
<@Vornicus>
awesome.
20:28 Vornicus is now known as Finerty
20:28 Orthia [orthianz@Nightstar-0878cfcd.xnet.co.nz] has quit [Ping timeout: 121 seconds]
20:56
< celticminstrel>
Aaaand Chrome just crashed.
21:04 Thaqui [Thaqui@27B34E.D54D49.F53FA1.6A113C] has joined #code
22:10 Rhamphoryncus [rhamph@Nightstar-8931f88f.abhsia.telus.net] has quit [Client exited]
22:19 Orthia [orthianz@Nightstar-07eee217.xnet.co.nz] has joined #code
22:56 Orth [orthianz@Nightstar-f6b20851.xnet.co.nz] has joined #code
22:57 Orthia [orthianz@Nightstar-07eee217.xnet.co.nz] has quit [Ping timeout: 121 seconds]
23:14 Alek [omegaboot@Nightstar-c531ef76.il.comcast.net] has quit [Ping timeout: 121 seconds]
23:59 Tarinaky [Tarinaky@Nightstar-f087ff12.adsl.virginmedia.net] has joined #code
--- Log closed Mon Mar 22 00:00:41 2010
code logs -> 2010 -> Sun, 21 Mar 2010< code.20100320.log - code.20100322.log >