- Mustach
- Mar 2, 2003
-
In this long line, there's been some real strange genes. You've got 'em all, with some extras thrown in.
|
Zombywuf posted:
Also, why should it not be possible to call a member of a null object?
Because 99.9999999999999999999% of legitimate member functions will try to do something with what this points to.
|
#
¿
Apr 8, 2008 03:10
|
|
- Adbot
-
ADBOT LOVES YOU
|
|
#
¿
Apr 28, 2024 17:32
|
|
- Mustach
- Mar 2, 2003
-
In this long line, there's been some real strange genes. You've got 'em all, with some extras thrown in.
|
Entheogen posted:
what is so horrible on exiting when exception occurs? For some exceptions it makes sense, and you can print out what the message was before you exit anyways.
Because that example doesn't do anything with the exception(s) and manages to give less information than if the exception(s) had just been left uncaught.
|
#
¿
Jul 9, 2008 18:53
|
|
- Mustach
- Mar 2, 2003
-
In this long line, there's been some real strange genes. You've got 'em all, with some extras thrown in.
|
You're both missing the real problem. DestroyEvent() takes a CGameEvent* (or CGameEvent*&); it's not invalidating any iterators. So, that comment is ironic, because the remaining events won't be iterated. mEvents.begin() isn't going to change, so re-accessing or deleting that element that got destroyed on the first iteration will probably crash the program.
edit: What's an "lIterator" supposed to be, anyhow? Loser Iterator?
Mustach fucked around with this message at 21:17 on Jul 31, 2008
|
#
¿
Jul 31, 2008 21:14
|
|
- Mustach
- Mar 2, 2003
-
In this long line, there's been some real strange genes. You've got 'em all, with some extras thrown in.
|
Oh man, that would make that segment of code a lot worse.
|
#
¿
Jul 31, 2008 22:48
|
|
- Mustach
- Mar 2, 2003
-
In this long line, there's been some real strange genes. You've got 'em all, with some extras thrown in.
|
Either the headers date back to some ancient and barely-standard-conforming VC, were tool-generated, or were jerk-generated.
|
#
¿
Aug 25, 2008 19:06
|
|
- Mustach
- Mar 2, 2003
-
In this long line, there's been some real strange genes. You've got 'em all, with some extras thrown in.
|
Does the runtime overhead of creating a list and copying elements to it count as a coding horror?
|
#
¿
Aug 27, 2008 21:45
|
|
- Mustach
- Mar 2, 2003
-
In this long line, there's been some real strange genes. You've got 'em all, with some extras thrown in.
|
Volte posted:No, because if the number of possibilities is small enough that you would otherwise list them in the code then the performance difference is negligible.
Maybe, but it's an unnecessary source of potential overhead for a negligible readability improvement.
|
#
¿
Aug 27, 2008 21:56
|
|
- Mustach
- Mar 2, 2003
-
In this long line, there's been some real strange genes. You've got 'em all, with some extras thrown in.
|
== and != are overloaded to do value comparison for Strings in C#.
|
#
¿
Aug 29, 2008 14:14
|
|
- Mustach
- Mar 2, 2003
-
In this long line, there's been some real strange genes. You've got 'em all, with some extras thrown in.
|
You say that like references are one of C++'s harder-to-understand constructs.Lexical Unit posted:
For fucks sake this guy wrote nearly 300 kloc of C++ and he doesn't know what a reference is? gently caress me.
More evidence against putting much meaning behind line counts. When you code like the guy in BigRedDot's story, it's pretty easy to hit the high numbers.
|
#
¿
Aug 31, 2008 05:37
|
|
- Mustach
- Mar 2, 2003
-
In this long line, there's been some real strange genes. You've got 'em all, with some extras thrown in.
|
Anonymous Name posted:Using pointers for output (&lines, &output) makes it more obvious. Plus it allows you to pass NULL if you don't care about a certain value,
Argh my program crashed because the function tried to dereference and write to NULL. Also which of those are output params; I think this function takes at least one pointer-to-const.floWenol posted:If they're not, one has to look up each function where said variable is used as a parameter. Lame.
Yeah that's real tough.
|
#
¿
Sep 1, 2008 22:02
|
|
- Mustach
- Mar 2, 2003
-
In this long line, there's been some real strange genes. You've got 'em all, with some extras thrown in.
|
floWenoL posted:
I don't know if you're being intentionally obtuse, but the idea is to use pointers (and not references) only for output parameters.
There are plenty of currently-existing functions in the world that take pointers as input parameters, and Anonymous Name already mentioned passing in NULL as a valid argument.quote:Oh, how cute, someone who has never done maintenance on a large code base.
Being able to search for "&v" over "v" is not the huge timesave you're making it out to be. Java has no "const"; any method can modify any object that's passed to it if the object's class has mutators. That hasn't stopped the creation of huge and functioning Java codebases, probably because they aren't structured so that "I don't know where this variable is being modified, time to search every source file" becomes possible.
|
#
¿
Sep 1, 2008 22:20
|
|
- Mustach
- Mar 2, 2003
-
In this long line, there's been some real strange genes. You've got 'em all, with some extras thrown in.
|
floWenoL posted:
Wrong-o. I'm saying that the writer of functions should be documenting whether their functions handle NULL or not.
You liar:floWenol posted:
Lexical Unit posted:
So what is the person who's reading the code going to get out of reading it if they don't know what any of the functions do?
Whatever can be gleaned from the function name, comments, and parameter names. If pointers for output params were used consistently, a simple search suffices to find out where a variable can be modified in a called function. If they're not, one has to look up each function where said variable is used as a parameter. Lame.
…
The person who wrote the code may be completely familiar with the function, but maybe not the person reading the code later.
If that's what you really meant, then I'm going to drop it, too. My biggest problem was with the idea that pointer-as-out was some kind of replacement for reading function documentation/asking a coworker; the rest just spun off of that and is apparently well-beaten horse.
|
#
¿
Sep 2, 2008 01:22
|
|
- Mustach
- Mar 2, 2003
-
In this long line, there's been some real strange genes. You've got 'em all, with some extras thrown in.
|
Use Type.GetField(), don't use Type.GetFields() and loop through (possibly) all 5500 of them.
|
#
¿
Sep 8, 2008 21:16
|
|
- Mustach
- Mar 2, 2003
-
In this long line, there's been some real strange genes. You've got 'em all, with some extras thrown in.
|
code:ifpf67_ptr = (Ifpf_0067 *) ((void *) MH_ADDR_ST(
((Msg_hd *) &(((FP_msghdr *)(((void *)&((Fp_mcom_bfhd *)
(&((byte *)(p_msdes)->heap)[(((p_msdes)->mstb[(0)]).ofbf)]))[1]))))[1])));
I need to know what MH_ADDR_ST expands to; I want to see the whole thing, and then see what it simplifies to.
Mustach fucked around with this message at 18:01 on Sep 11, 2008
|
#
¿
Sep 11, 2008 17:59
|
|
- Mustach
- Mar 2, 2003
-
In this long line, there's been some real strange genes. You've got 'em all, with some extras thrown in.
|
It looks like what I posted above you. All on one line, of course.
|
#
¿
Sep 11, 2008 18:06
|
|
- Mustach
- Mar 2, 2003
-
In this long line, there's been some real strange genes. You've got 'em all, with some extras thrown in.
|
Whoever wrote MH_ADDR_ST() is an rear end in a top hat for writing a macro that re-evaluates its argument three times. "Who needs functions or temporary variables? I know what I'm doing! It's a macro, it'll be efficient no matter what!"
Beaten, but whatever I figured it out without having a clue so I'm posting this diagram:
code:--------------
|Fp_mcom_bfhd|
--------------
| FP_msghdr |
--------------
| Msg_hd |
--------------
| |
| /* st_off |
| bytes */ |
| |
-------------|
| Ifpf_0067 |
-------------|
|
#
¿
Sep 11, 2008 20:21
|
|
- Mustach
- Mar 2, 2003
-
In this long line, there's been some real strange genes. You've got 'em all, with some extras thrown in.
|
tef posted:
And signals are part of posix, not C last time I checked.
C gaurantees signal(), raise(), and SIGABRT, SIGFPE, SIGILL, SIGINT, SIGSEGV, SIGTERM. However, "The complete set of signals, their semantics, and their default handling is implementation-defined…"
|
#
¿
Nov 5, 2008 19:15
|
|
- Mustach
- Mar 2, 2003
-
In this long line, there's been some real strange genes. You've got 'em all, with some extras thrown in.
|
Don't look a gift horse in the mouth, I guess.
|
#
¿
Nov 5, 2008 19:26
|
|
- Mustach
- Mar 2, 2003
-
In this long line, there's been some real strange genes. You've got 'em all, with some extras thrown in.
|
You can't subclass java.lang.String.
|
#
¿
Dec 8, 2008 19:58
|
|
- Mustach
- Mar 2, 2003
-
In this long line, there's been some real strange genes. You've got 'em all, with some extras thrown in.
|
Sorry, I was talking about Java, not GNU Gava or whatever
|
#
¿
Dec 8, 2008 20:42
|
|
- Mustach
- Mar 2, 2003
-
In this long line, there's been some real strange genes. You've got 'em all, with some extras thrown in.
|
floWenoL posted:
I also enjoy !(x ^ y), which is equivalent to x == y.
Reminds me of a thread from a few years ago in which somebody called '!=' bloated.
|
#
¿
Jan 8, 2009 21:25
|
|
- Mustach
- Mar 2, 2003
-
In this long line, there's been some real strange genes. You've got 'em all, with some extras thrown in.
|
High as gently caress
|
#
¿
Jan 9, 2009 01:42
|
|
- Mustach
- Mar 2, 2003
-
In this long line, there's been some real strange genes. You've got 'em all, with some extras thrown in.
|
Explicitly nulling references is worthless 98% of the time, yet it seems to be a pretty popular M.O.
|
#
¿
Jan 18, 2009 02:49
|
|
- Mustach
- Mar 2, 2003
-
In this long line, there's been some real strange genes. You've got 'em all, with some extras thrown in.
|
It's just a for-loop followed by a while-loop. It's hosed-up in other ways, but it's not a special syntax or anything like that.
|
#
¿
Jan 29, 2009 16:15
|
|
- Mustach
- Mar 2, 2003
-
In this long line, there's been some real strange genes. You've got 'em all, with some extras thrown in.
|
Another feather in PHP's security hat
|
#
¿
Feb 5, 2009 02:47
|
|
- Mustach
- Mar 2, 2003
-
In this long line, there's been some real strange genes. You've got 'em all, with some extras thrown in.
|
rjmccall posted:
I'm curious if there's a difference between DynamicArray::Size() and DynamicArray::GetNumb().
GetNumb() is what you do when you have to work with code like that.
|
#
¿
Feb 13, 2009 16:45
|
|
- Mustach
- Mar 2, 2003
-
In this long line, there's been some real strange genes. You've got 'em all, with some extras thrown in.
|
And now we flame each other over currying.
|
#
¿
Mar 17, 2009 14:08
|
|
- Mustach
- Mar 2, 2003
-
In this long line, there's been some real strange genes. You've got 'em all, with some extras thrown in.
|
Must be an embedded whitespace script.
|
#
¿
Mar 27, 2009 21:23
|
|
- Mustach
- Mar 2, 2003
-
In this long line, there's been some real strange genes. You've got 'em all, with some extras thrown in.
|
Avenging Dentist posted:
Given that people make functions called doit or run in Java, yes.
public interface Doable{
|
#
¿
May 11, 2009 20:32
|
|
- Mustach
- Mar 2, 2003
-
In this long line, there's been some real strange genes. You've got 'em all, with some extras thrown in.
|
code:public interface Thing{
void doThat();
void okDoTheRealThing();
void helperMethod();
void helperMethodForOkDoTheRealThing();
}
|
#
¿
May 11, 2009 22:31
|
|
- Mustach
- Mar 2, 2003
-
In this long line, there's been some real strange genes. You've got 'em all, with some extras thrown in.
|
rjmccall posted:
really silly workarounds like Swing's J prefix on every single class in the library.
Correction: most classes in the library. Which makes it even worse because it's inconsistent!
|
#
¿
May 14, 2009 03:06
|
|
- Mustach
- Mar 2, 2003
-
In this long line, there's been some real strange genes. You've got 'em all, with some extras thrown in.
|
I don't buy type erasure as the excuse for not being able to say new T[n]. That expression doesn't even need any type information since the elements are all initialized to null and no other "T" methods are used.
It's just another reason to not use Java arrays for anything but varargs.
|
#
¿
May 16, 2009 03:41
|
|
- Mustach
- Mar 2, 2003
-
In this long line, there's been some real strange genes. You've got 'em all, with some extras thrown in.
|
Ah, I should've thought of that since I enjoy bitching about array covariance and the runtime checks associated with it.
|
#
¿
May 16, 2009 05:44
|
|
- Mustach
- Mar 2, 2003
-
In this long line, there's been some real strange genes. You've got 'em all, with some extras thrown in.
|
It returns size_t.
|
#
¿
Jun 2, 2009 21:15
|
|
- Mustach
- Mar 2, 2003
-
In this long line, there's been some real strange genes. You've got 'em all, with some extras thrown in.
|
rjmccall posted:
(b) the program and someone can't happen again or
What was this supposed to say?
|
#
¿
Jun 4, 2009 13:35
|
|
- Mustach
- Mar 2, 2003
-
In this long line, there's been some real strange genes. You've got 'em all, with some extras thrown in.
|
Nope, sorry, don't wanna break backwards-compatibility with all of the high-quality software that depends on barewords
|
#
¿
Jun 12, 2009 17:42
|
|
- Mustach
- Mar 2, 2003
-
In this long line, there's been some real strange genes. You've got 'em all, with some extras thrown in.
|
edit: Actually, it may have been a HashMap<MutableInt,String>…
Mustach fucked around with this message at 22:31 on Jul 7, 2009
|
#
¿
Jul 7, 2009 22:27
|
|
- Mustach
- Mar 2, 2003
-
In this long line, there's been some real strange genes. You've got 'em all, with some extras thrown in.
|
This is the only good Perl program:
code:#!/usr/bin/perl
$_='
$q ="\ 47"; wh
ile ($ ;=
$z += .5 ){
%c= $r=0;$/ ="";whi le(2
0+ $z>($;+=.05)){$c{int$ _+ 2
6+ 2*($ r+= .0 2) *
s in$ ;}{1 -$_
+1 0+ int $r*c o s
$ ;} =1for(0. .1) }$
t =r ever se;$ /. =`
c le ar `. " #!
/ usr /bi n/ pe
rl \n\ $_ =$q \n" ;
fo r$y (1..20){$c{$_} {
$ y }? $ /.=chop$t :
($/ . =" \4
0") for(0. .53) ;
$/. ="\n"}pri nt"$/$ q;
s; ". chr(9 2)."s;;g;eval\n "}
';s;\s;;g;eval
|
#
¿
Jul 10, 2009 01:37
|
|
- Mustach
- Mar 2, 2003
-
In this long line, there's been some real strange genes. You've got 'em all, with some extras thrown in.
|
"Single Point of Return" rears it's twisted head again. It seems like people that subscribe to it always use convoluted logic.
|
#
¿
Jul 23, 2009 17:31
|
|
- Adbot
-
ADBOT LOVES YOU
|
|
#
¿
Apr 28, 2024 17:32
|
|
- Mustach
- Mar 2, 2003
-
In this long line, there's been some real strange genes. You've got 'em all, with some extras thrown in.
|
Gradian: The GNU radian
|
#
¿
Jul 24, 2009 12:44
|
|