|
NotShadowStar: it's not fair to blame Java for RIM's bullshit platform. Once you blatantly violate the JLS in your implementation, it isn't really Java anymore. Imagine the new levels of hell that might be unleashed if RIM tried to develop their own version of PHP.
|
# ? Sep 30, 2010 04:16 |
|
|
# ? May 14, 2024 22:47 |
|
You know the Godwin Law of Hitler, where Hitler is the singularity of everything terrible in the 20th century. Java is like that, it's the singular point of everything terrible in technology. Yes, Java is Hitler.
|
# ? Sep 30, 2010 04:54 |
|
Does that make PHP Stalin?
|
# ? Sep 30, 2010 04:58 |
|
w00tz0r posted:You're right, I'm totally off the mark with this one. My original plan was to use a vector, since it has contiguous memory allocation, rather than a linked list; LinkedHashMap was a terrible example, I was thinking of complexity, not efficiency. Haha, fair enough. With that extra information it is most certainly a horror. Also yeah, I'd use a vector along the lines of: code:
Zombywuf fucked around with this message at 11:58 on Sep 30, 2010 |
# ? Sep 30, 2010 10:52 |
|
NotShadowStar posted:Yes, Java is Hitler.
|
# ? Sep 30, 2010 13:22 |
|
NotShadowStar posted:I wonder how RIM isn't sued to hell from Oracle like they're doing with Google. Maybe the secret to not getting sued is to make really terrible copies. I do wish Google had chosen something other (less verbose) than Java, though. Munkeymon fucked around with this message at 15:08 on Sep 30, 2010 |
# ? Sep 30, 2010 15:05 |
|
Munkeymon posted:Maybe the secret to not getting sued is to make really terrible copies. They have Guido Van Rossum on their team!! loving google
|
# ? Sep 30, 2010 16:10 |
|
Munkeymon posted:Maybe the secret to not getting sued is to make really terrible copies. It looks like Scala and JRuby run on Dalvik, so there's that. You could also drop down to C++
|
# ? Sep 30, 2010 16:49 |
|
Zombywuf posted:Haha, fair enough. With that extra information it is most certainly a horror. In hindsight, it's not the fact that he's using a custom memory pool that's a horror - cache misses are an issue, and this resolves them - it's just his implementation and lack of documentation. As is usual with this codebase, I get told to do a simple task like "parse this file into this data structure", and then when I start to look at how, it requires 14 classes and a custom memory pool.
|
# ? Sep 30, 2010 17:36 |
|
In Python, to quote the Python thread, a folder is a package. In Perl, this is not true. When you use the "use" function, all the terms are directories except the last one which is the file. And the double colon :: is the delimiter between each term. ...But the file can contain a package or packages plural which are named completely differently. You have absolutely no idea what semantics you just imported. Plus, when you do start to make use of stuff in that package, suddenly all the terms are levels in the package heirarchy except the last term which is a function or variable inside the file, and the double colon is now magically the package heirarchy delimiter. Only now have I realised that any agreement between the package heirarchy and the filesystem heirarchy is basically just a huge coincidence, and even now I probably still have most of this wrong. Why would a programming language even allow you to do such confusing things?
|
# ? Sep 30, 2010 21:34 |
|
We have some code that generates SQL queries based on limited regexes that a user can enter. For some of these, we have to query a secondary table to determine which rows we can pull from the primary table, via regex. Here's a small portion of one of the queries generated today: select id, field1, field2, field3, field4 from TABLE where id> 0 and (id regexp '^3$' or id regexp '^4$' or id regexp '^5$' or id regexp '^6$' or id regexp '^7$' or id regexp '^8$' or id regexp '^9$' or id regexp '^10$' or id regexp '^11$' or id regexp '^12$' or id regexp '^13$' or id regexp '^14$' or id regexp '^15$' or id regexp '^16$' or id regexp '^17$' or id regexp '^18$' or id regexp '^19$' or id regexp '^20$' or id regexp '^21$' or id regexp '^22$' or id regexp '^23$' or id regexp '^24$' or id regexp '^25$' or id regexp '^26$' or id regexp '^27$' or id regexp '^28$' or id regexp '^29$' or id regexp '^30$' or id regexp '^31$' or id regexp '^32$' or id regexp '^33$' or id regexp '^34$' or id regexp '^35$' or id regexp '^36$' or id regexp '^37$' or id regexp '^38$' or id regexp '^39$' or id regexp '^40$' or id regexp '^41$' or id regexp '^42$' or id regexp '^43$' or id regexp '^44$' or id regexp '^45$' or id regexp '^46$' or id regexp '^47$' or id regexp '^48$' or id regexp '^49$' or id regexp '^50$' or id regexp '^51$' or id regexp '^52$' or id regexp '^53$' or id regexp '^54$' or id regexp '^55$' or id regexp '^56$' or id regexp '^57$' or id regexp '^58$' or id regexp '^59$' or id regexp '^60$' or id regexp '^61$' or id regexp '^62$' or id regexp '^63$' or id regexp '^64$' or id regexp '^65$' or id regexp '^66$' or id regexp '^67$' or id regexp '^68$' or id regexp '^69$' or id regexp '^70$' or id regexp '^71$' or id regexp '^72$' or id regexp '^73$' or id regexp '^74$' or id regexp '^75$' or id regexp '^76$' or id regexp '^77$' or id regexp '^78$' or id regexp '^79$' or id regexp '^80$' or id regexp '^81$' or id regexp '^82$' or id regexp '^83$' or id regexp '^84$' or id regexp '^85$' or id regexp '^86$' or id regexp '^87$' or id regexp '^88$' or id regexp '^89$' or id regexp '^90$' or id regexp '^91$' or id regexp '^92$' or id regexp '^93$' or id regexp '^94$' or id regexp '^95$' or id regexp '^96$' or id regexp '^97$' or id regexp '^98$' or id regexp '^99$' or id regexp '^100$' or id regexp '^101$' or id regexp '^300$' or id regexp '^301$' or id regexp '^302$' or id regexp '^303$' or id regexp '^304$' or id regexp '^305$' or id regexp '^306$' or id regexp '^307$' or id regexp '^308$' or id regexp '^309$' or id regexp '^310$' or id regexp '^311$' or id regexp '^312$' or id regexp '^313$' or id regexp '^314$' or id regexp '^315$' or id regexp '^1018$' or id regexp '^1019$' or id regexp '^1020$' or id regexp '^1021$' or id regexp '^1022$' or id regexp '^1023$' or id regexp '^1024$' or id regexp '^1025$' or id regexp '^1026$' or id regexp '^1027$' or id regexp '^1028$' or id regexp '^1029$' or id regexp '^1030$' or id regexp '^1031$' or id regexp '^1032$' or id regexp '^1033$' or id regexp '^1034$' or id regexp '^1035$' or id regexp '^1036$' or id regexp '^1037$' or id regexp '^1038$' or id regexp '^1039$' or id regexp '^1040$' or id regexp '^1041$' or id regexp '^1042$' or id regexp '^1043$' or id regexp '^1044$' or id regexp '^1045$' or id regexp '^1046$' or id regexp '^1047$' or id regexp '^1048$' or id regexp '^1049$' or id regexp '^1050$' or id regexp '^1051$' or id regexp '^1052$' or id regexp '^1053$' or id regexp '^1054$' or id regexp '^1055$' or ...
|
# ? Sep 30, 2010 21:44 |
|
qntm posted:In Python, to quote the Python thread, a folder is a package. You seem to have thoroughly confused the default place perl looks for a Perl package based on its namespace with some sort of deep meaning, and also forgotten that you have very, very fine grained control of what semantics you import.
|
# ? Sep 30, 2010 21:46 |
|
NotShadowStar posted:It looks like Scala and JRuby run on Dalvik, so there's that. They seem to have abandoned the Python compiler in favor of ASE, though :\ quote:You could also drop down to C++ Yeah, I saw that and my first thought was "Let's fracture the platform as hard as we loving can!" but maybe I'm overreacting
|
# ? Sep 30, 2010 22:07 |
|
I just wrote a short three number wide median algorithm using ?: notation. After I removed the helping parentheses, I got this construct out of it:code:
|
# ? Sep 30, 2010 22:07 |
|
Plorkyeran posted:Does that make PHP Stalin? No, .NET is Stalin and Mono is the People's Republic of Tannu Tuva. PHP is probably Imperial Japan or something.
|
# ? Sep 30, 2010 23:19 |
1337JiveTurkey posted:No, .NET is Stalin and Mono is the People's Republic of Tannu Tuva. PHP is probably Imperial Japan or something. PHP just doesn't have an Imperial Japan feel to me. PHP is more like a tribe that is into some weird freaky poo poo they do out in the middle of the jungle, oblivious to the modern civilizations being built around them.
|
|
# ? Sep 30, 2010 23:30 |
|
PHP is Pol Pot
|
# ? Sep 30, 2010 23:38 |
|
Otto Skorzeny posted:You seem to have thoroughly confused the default place perl looks for a Perl package based on its namespace with some sort of deep meaning, and also forgotten that you have very, very fine grained control of what semantics you import. Well, by all means explain it. As I understand it, "use Foo::Bar;" will make Perl look through all of the directories in @INC for a file named "Foo/Bar.pm", NOT for a file containing "package Foo::Bar;". That is, it is a command to import a specific file, and "::" is being made into a directory separator. Meanwhile, Foo/Bar.pm could start off with "package Something::Else;", so that when, later in the script, you start calling Something::Else::function(), (1) the "::" suddenly has a completely different meaning and (2) the reader has no idea where this function has mysteriously appeared from.
|
# ? Sep 30, 2010 23:57 |
|
Combat Pretzel posted:I just wrote a short three number wide median algorithm using ?: notation. After I removed the helping parentheses, I got this construct out of it: this is awesome don't let anyone else tell you otherwise
|
# ? Oct 1, 2010 00:27 |
|
php-internals is Kim Jung-il. PHP is North Korea. e: also, qntm posted:Well, by all means explain it. As I understand it, "use Foo::Bar;" will make Perl look through all of the directories in @INC for a file named "Foo/Bar.pm", NOT for a file containing "package Foo::Bar;". That is, it is a command to import a specific file, and "::" is being made into a directory separator. Meanwhile, Foo/Bar.pm could start off with "package Something::Else;", so that when, later in the script, you start calling Something::Else::function(), (1) the "::" suddenly has a completely different meaning and (2) the reader has no idea where this function has mysteriously appeared from. Any Perl developer that places two unrelated packages in a single .pm file deserves to get shot in the face, and then only under extremely extreme circumstances. If you see this on CPAN, name and shame. I'll bring the pitchforks. McGlockenshire fucked around with this message at 00:49 on Oct 1, 2010 |
# ? Oct 1, 2010 00:47 |
|
PHP is fascist Italy. All of their poo poo is shoddily built and is barely fit to subjugate Ethiopia/be used as a scripting language. Their general staff ranks from useless to incompetent to insane, and any competent engineer/scientist/technician has long since fled to better places. Unfortunately, they happen to be positioned in such a way that no matter what side you're on you'll have to deal with them at some point.
|
# ? Oct 1, 2010 01:27 |
|
Combat Pretzel posted:I just wrote a short three number wide median algorithm using ?: notation. After I removed the helping parentheses, I got this construct out of it: That's nothin' compared to the elevenary operator. Oddly enough, your median algorithm doesn't disturb me as much as Stepanov's order-selection algorithms in Elements of Programming (well, maybe if you added the parens back at least). Although after some aggressive template-based inlining, I bet they end up being nearly the exact same assembly code.
|
# ? Oct 1, 2010 02:37 |
|
Zombywuf posted:That has nothing to do with Perl, I used to have to maintain a 60,000 line XSLT file. What has what to do with what? I have seen regex's that have destroyed worlds, and bad Perl code is the worst kind of code.
|
# ? Oct 1, 2010 03:11 |
|
Flobbster posted:Oddly enough, your median algorithm doesn't disturb me as much as Stepanov's order-selection algorithms in Elements of Programming (well, maybe if you added the parens back at least). Although after some aggressive template-based inlining, I bet they end up being nearly the exact same assembly code. Actually using Stepanov's order-selection algorithm over just sorting and grabbing the middle element would nearly always be a bit of a horror, but I guess if you need its performance it's better than trying to write the same thing without the ridiculous template metaprogramming.
|
# ? Oct 1, 2010 03:20 |
|
A very bad man posted:What has what to do with what? I have seen regex's that have destroyed worlds, and bad Perl code is the worst kind of code. No, it really really isn't, I'd paste some of this xslt, but business concerns were buried so deep into the madness of this web scraping tool it's impossible. Perl does not make code any worse. Hell, good Haskell code is twice as unreadable as bad Perl.
|
# ? Oct 1, 2010 12:14 |
|
Zombywuf posted:Hell, good Haskell code is twice as unreadable as bad Perl.
|
# ? Oct 1, 2010 15:56 |
|
Janin posted:This isn't true at all, FYI -- good Haskell is roughly comparable to Ruby, better than Python, and much better than Perl. You seriously consider Ruby more readable than Python? Every Ruby example I see reminds me of Perl golf*. *I have not made a serious effort to learn Ruby, but I have looked at code samples out of curiosity
|
# ? Oct 1, 2010 19:17 |
|
Munkeymon posted:You seriously consider Ruby more readable than Python? Every Ruby example I see reminds me of Perl golf*. There's a lot of bad Ruby out there.
|
# ? Oct 1, 2010 19:27 |
|
Munkeymon posted:Every Ruby example I see reminds me of Perl golf*. Seconding this. I made it about as far as the difference between the .. and ... operators. Ruby may be concise, but you're kidding yourself if you call it intuitive.
|
# ? Oct 1, 2010 19:32 |
|
Janin posted:This isn't true at all, FYI -- good Haskell is roughly comparable to Ruby, better than Python, and much better than Perl. Better than Python? Reading Python is just reading pseudocode that can be interpreted by a computer, too.
|
# ? Oct 1, 2010 20:08 |
|
I think he's talking about how haskell's type signatures add to the readability:code:
|
# ? Oct 1, 2010 20:25 |
|
Ugg boots posted:Better than Python? Reading Python is just reading pseudocode that can be interpreted by a computer, too. My pseudocode isn't full of __________gratuitous_underscores__________
|
# ? Oct 1, 2010 20:29 |
|
Otto Skorzeny posted:My pseudocode isn't full of __________gratuitous_underscores__________ Maybe that's why your computer refuses to interpret it
|
# ? Oct 1, 2010 20:48 |
|
Ugg boots posted:Better than Python? Reading Python is just reading pseudocode that can be interpreted by a computer, too. tef posted:zygohistomorphic_prepromorphism
|
# ? Oct 1, 2010 21:41 |
|
Yes My point was that haskell is as readable as the types it is using. A lot of haskell is readable but I feel like i need a PHD in category theory for some of the more crazy stuff.
|
# ? Oct 1, 2010 21:52 |
|
I'm not denying that it's *possible* to write unreadable code in Haskell. Rather, I'm simply stating that properly written Haskell is more readable than properly written Python. Type signatures, types, and especially category theory have nothing to do with it. In fact, category theory is irrelevant to 99% of Haskell programmers.
|
# ? Oct 1, 2010 22:03 |
|
Internet Janitor posted:Seconding this. I made it about as far as the difference between the .. and ... operators. Ruby may be concise, but you're kidding yourself if you call it intuitive. Que. Actually I've been doing Ruby for like 6 years and I have never seen this triple dot. I had to look it up, and it looks straightforward. Old Ruby code can be really bad because it's either 'oh hai metaprogramming and syntax shortcuts' and a huge mess (I maintain the old Ruby-LDAP library and it's like this, we're slowly fixing it) or it's Java refugees making a gigantic mess out of poo poo (MOAR CLASSES). People who actually get it, it's loving awesome. You can write crazy DSLs without anyone having to understand why the DSL works. Like this RSpec test I converted: code:
Or check out the new upcoming superstar Homebrew which is a no-bullshit package manager for OSX. It's written in Ruby, and package specifications are written as 'formulae', but you don't need to know anything about Ruby because Homebrew is great and built a fantastic DSL: code:
|
# ? Oct 1, 2010 22:03 |
|
Small horrors are the best. Requirement: Validator should ensure that object has no child objects and no related objects. Thank ye gods I was walking through the junior developer's office as we don't have much in the way of formal code reviews. Mainly because I think my people can handle poo poo like this. But apparently this guy missed the day on operators. He wrote this: code:
Good help is hard to find.
|
# ? Oct 1, 2010 22:08 |
|
NotShadowStar posted:You can write crazy DSLs without anyone having to understand why the DSL works. These embedded languages aren't really 'domain-specific' by virtue of being a superset of ruby. Unless of course you think ruby itself isn't a general programming language. That and you'd expect the errors from a domain specific language would be about the language itself. It isn't a DSL unless you get errors about the language itself when things break. Abstractions are double edged - people shouldn't have to understand how the internals work *or* fails. You might as well call any set of C preprocessor macros a DSL
|
# ? Oct 2, 2010 01:31 |
|
|
# ? May 14, 2024 22:47 |
|
tef posted:These embedded languages aren't really 'domain-specific' by virtue of being a superset of ruby. Unless of course you think ruby itself isn't a general programming language. That and you'd expect the errors from a domain specific language would be about the language itself.
|
# ? Oct 2, 2010 02:01 |