|
As much as we love to rage about long-rear end type names, the unfortunate reality is that if we're using a language like Java for a project, we're stuck with them, since the chucklefucks at Sun refuse to actually improve the language in any meaningful way. So I'd at least like it if we could get people behind the idea of bumping up the obsolete 80-character limitation to something a little more reasonable but still legible, like say 100. There's no reasons it should take me two lines to do a simple object allocation like: code:
|
# ? May 15, 2009 13:56 |
|
|
# ? May 14, 2024 13:21 |
|
Sure there's a reason, to get you to complain to Sun or Oracle or the Java Community Process or whoever to get some type inference up in this bitch Also as some salt against making AbstractFactoryVisitorBridgeMementoSingletons
|
# ? May 15, 2009 14:02 |
|
Otto Skorzeny posted:to get you to complain to Sun or Oracle or the Java Community Process or whoever to get some type inference up in this bitch I don't believe the action in the first part of that sentence has ever achieved the consequence in the second part. And even when Sun does add something people have been asking for, they manage to cock it up in the worst way possible to the point of making it only a fraction as useful as it could be (cf. generics). I think auto(un)boxing is the only thing they've added recently that I've actually been 100% grateful for. Watching Microsoft continue to develop and grow C# in a ton of ways makes me wish someone would just fire the entire Java language team and get new people in there who listen to feedback and care about turning it into a real modern programming language.
|
# ? May 15, 2009 14:09 |
|
Flobbster posted:Watching Microsoft continue to develop and grow C# in a ton of ways makes me wish someone would just fire the entire Java language team and get new people in there who listen to feedback and care about turning it into a real modern programming language. What you need is Perl 6.
|
# ? May 15, 2009 14:27 |
|
Zombywuf posted:What you need is Perl 6. I used to follow Perl 6 development pretty closely. Back in 2001. When I checked in on it a few months ago, they still hadn't delivered a usable product. I'll check in again on it in 2015. Hopefully it's done by then so I can install it on my copy of the HURD and use it to script entities in Duke Nukem Forever.
|
# ? May 15, 2009 14:48 |
|
Flobbster posted:generics gently caress Java for not having generic arrays!
|
# ? May 15, 2009 14:50 |
|
biznatchio posted:I used to follow Perl 6 development pretty closely. Back in 2001. When I checked in on it a few months ago, they still hadn't delivered a usable product. It may not be a usable product yet, but it's definitely growing due to user feedback, and the developers intend on turning it into a modern programming language.
|
# ? May 15, 2009 14:50 |
|
Zombywuf posted:What you need is Perl 6. He asked for a real language.
|
# ? May 15, 2009 14:51 |
|
Zombywuf posted:It may not be a usable product yet, but it's definitely growing due to user feedback, and the developers intend on turning it into a modern programming language. So what advantages would I have for choosing Perl 6 for a new project being started today over, say, a language that exists?
|
# ? May 15, 2009 14:59 |
|
biznatchio posted:So what advantages would I have for choosing Perl 6 for a new project being started today over, say, a language that exists? As usual, the answer to that is: depends on your project. Perl is a language suited for certain tasks (and here i'm looking at its legendary strong point: regular expressions), and probably not so suited for others. Can you build a GUI app with it? Of course. Should you? I doubt it. Especially since PERL-compatible regex libraries have been created for other languages as well (java, c/c++, python i think) So, at the end of the day, the questions to be asked are: - Does my project require certain features that PERL would be a perfect solution? - Who will code it? Do those people know PERL?Do they wanna know PERL? - Who will maintain it? Does that team know PERL ?Do they wanna know PERL?
|
# ? May 15, 2009 15:38 |
|
rhag posted:As usual, the answer to that is: depends on your project. I.e. if it's vapourware then running on perl6 is a good idea.
|
# ? May 15, 2009 15:44 |
|
biznatchio posted:So what advantages would I have for choosing Perl 6 for a new project being started today over, say, a language that exists? That would depend on whether or not your project is a Perl 6 implementation.
|
# ? May 15, 2009 15:47 |
|
Then you should use haskell
|
# ? May 15, 2009 16:00 |
|
tef posted:Then you should use haskell ITYM: every language under the sun
|
# ? May 15, 2009 16:38 |
|
MEAT TREAT posted:gently caress Java for not having generic arrays! gently caress Java for type erasure!
|
# ? May 16, 2009 02:09 |
|
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 posted: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 needs to plug the type T into the array type at some point so RTTI can proceed to ask for the array's type. Which does not work if T gets erased.
|
# ? May 16, 2009 03:51 |
|
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 |
|
Vanadium posted:It needs to plug the type T into the array type at some point so RTTI can proceed to ask for the array's type. Which does not work if T gets erased.
|
# ? May 18, 2009 17:02 |
|
rhag posted:As usual, the answer to that is: depends on your project. Do you know the difference between Perl 5.x and Perl 6? Or, for that matter, Perl and PERL?
|
# ? May 19, 2009 03:21 |
|
floWenoL posted:Do you know the difference between Perl 5.x and Perl 6? Or, for that matter, Perl and PERL? That was actually the posting equivalent of a design pattern. Posting it probably made the author feel smarter and like he actually contributed to what was going on, whether it actually fit into the discussion or not.
|
# ? May 19, 2009 14:55 |
|
I had to write some stupid program in ActionScript (the ECMAScript used in flash files). Adobe has helper methods in the Microphone and Camera classes to get the devices and use them. The prototypes look like this: Microphone.Get(Integer) Camera.Get(String) :sciencefail: You'd think that since it accepts a string, the Camera.Get() needs the name of the camera to get. Not so. It still wants the id number... in a string instead of an integer. Its like they don't want code completion to be useful.
|
# ? May 19, 2009 18:44 |
|
vanjalolz posted:I had to write some stupid program in ActionScript (the ECMAScript used in flash files). Adobe has helper methods in the Microphone and Camera classes to get the devices and use them. maybe the id can contain characters other than letters while microphones are always referred to by an integer since that's how windows managers audio input devices.
|
# ? May 19, 2009 20:00 |
|
vanjalolz posted:I had to write some stupid program in ActionScript (the ECMAScript used in flash files). Adobe has helper methods in the Microphone and Camera classes to get the devices and use them.
|
# ? May 19, 2009 21:03 |
|
Not UNIX posted:Are you using AS2 or AS3? The definition in AS2 is public static get([index:Number]) : Camera, and in AS3, it's getCamera(name:String = null):Camera. Adobe posted:name:String (default = null) — Specifies which camera to get, as determined from the array returned by the names property. For most applications, get the default camera by omitting this parameter. To specify a value for this parameter, use the string representation of the zero-based index position within the Camera.names array. For example, to specify the third camera in the array, use Camera.getCamera("2").
|
# ? May 20, 2009 01:06 |
|
From my own beautiful mind:php:<? if($url{0}=='/'){ if($path){ $url=$server.$url; }else{ $url=$server.$path.$url; } }else{ $url=$server.$path.'/'.$url; } ?>
|
# ? May 29, 2009 21:29 |
|
A piece of code I recently had the pleasure of looking over (provenance unspecified):code:
And later, in the same codebase, about 3000 lines of code copy + pasted from IDA pro, with variable declarations for DWORD esi,eax,edx, etc, as well as an array for a fake stack and ~300 temporary values at the top to make it compile. My favourite part is that someone has seen fit to add the comment "// points to a DWORD" to every line that contains the string DWORD*.
|
# ? May 30, 2009 03:51 |
|
What is it about REST that gets people so confused? It doesn't seem like a difficult concept, but then I see "RESTful" APIs designed like this:quote:User online. This service returns whether the user is online or not. This is how i remembered how to write servlets. Is it too much to ask that a user of some architecture actually *read* the paper in which that architecture was defined?
|
# ? May 31, 2009 00:51 |
|
Janin posted:What is it about REST that gets people so confused? It doesn't seem like a difficult concept, but then I see "RESTful" APIs designed like this: Most people interpret REST as "send whatever the hell I want over HTTP." I inherited a "REST" API where the command was solely determined by the URL, parameters could be passed by GET or POST, and the server always returned 200 OK as a response. I cleaned it up to some degree but it still needed a lot of work when I left. Ninja edit: And the person who wrote it rolled his own HTTP server because the default one was "slow." I never saw the benchmarks.
|
# ? May 31, 2009 06:01 |
|
Janin posted:What is it about REST that gets people so confused? It doesn't seem like a difficult concept, but then I see "RESTful" APIs designed like this: Could you repost those examples on how it should be done? I'm curious and I don't quite understand REST.
|
# ? May 31, 2009 16:36 |
|
Triple Tech posted:Could you repost those examples on how it should be done? I'm curious and I don't quite understand REST. For example, assuming JSON-based resources, here's how that API could have been designed using REST: code:
|
# ? May 31, 2009 18:18 |
|
line 67 edit: it works only because in another function there's "if( name==null) return "null";" snowbee fucked around with this message at 18:45 on Jun 1, 2009 |
# ? Jun 1, 2009 18:36 |
|
Crackbunny posted:line 67 So relying on the implementation hashcons'ing the string literal constants? (I don't remember, is that a MUST or a MAY, anyway?). They also can't seem to get method naming/capitalization consistent...
|
# ? Jun 1, 2009 19:01 |
|
OddObserver posted:So relying on the implementation hashcons'ing the string literal constants? (I don't remember, is that a MUST or a MAY, anyway?). They also can't seem to get method naming/capitalization consistent... A must. From http://java.sun.com/docs/books/jls/third_edition/html/lexical.html#101083: quote:String literals-or, more generally, strings that are the values of constant expressions (§15.28)-are "interned" so as to share unique instances, using the method String.intern
|
# ? Jun 1, 2009 19:25 |
|
This is paraphrased from a bit-array library that I'm working on.code:
|
# ? Jun 2, 2009 18:33 |
|
edit: d'oh
|
# ? Jun 2, 2009 18:41 |
|
Nope. Here's a hint: it involves the C standard's arithmetic conversion rules.
|
# ? Jun 2, 2009 18:43 |
|
Yeah, I wouldn't have guessed that. C is pretty weird.
|
# ? Jun 2, 2009 18:44 |
|
mr_jim posted:Nope. Here's a hint: it involves the C standard's arithmetic conversion rules. I was guessing 0 due to integer division roundoff. Boy was I wrong!
|
# ? Jun 2, 2009 19:37 |
|
|
# ? May 14, 2024 13:21 |
|
Mill Town posted:I was guessing 0 due to integer division roundoff. Boy was I wrong! gcc always truncates towards 0, but the C89 standard doesn't mandate that (C99 apparently does). That would make the expected result 1. That's not really what I wanted, but it's not as bad as what actually happens.
|
# ? Jun 2, 2009 19:44 |