Puke, I am your Phava: code that works both as PHP and Java


#1

Originally published at: http://boingboing.net/2016/08/31/puke-i-am-your-phava-code-th.html


#2

Time well spent. Said no one ever.


#3

Well, at least it’s not javascript and php. Something may be salvageable here…


#4

Now I want a program that works in both APL and Perl.


#5

I can’t seem to find the framework, but someone actually wrote such a thing. It allows you to run the same code both client and server-side, with PHP on the server and JS on the client.

Because the syntax is very different for some things in the 2 languages, all variable names had to start with a $ and loops and string concatenation required function calls that handled the differences similar to how this Java/PHP example do.


#6

<barfs on shoes/>


#7

Wow. That’s the first time I’ve looked at a block of code and all I could think was “gross.”


#8

“Block” seems overly generous, it suggests structure. I’d call it more of a “gob”.


#9

I do love those very tactile nouns, like “blob”, “wad”, “lugi” and “pile”.

Maybe I should call it a lugi of code.


Other good ones: “Sticky bunch”, “Oozing handful”, “Wet happenstance”, “Cold slimeball”.


#10

I dunno crap about code, but it looks pretty ■■■■■ to me.


#11

It’s not so much that it’s ugly. It’s what it does that’s horrific. I mean, PHP is alright I guess… But then combining it with Java just seems to be ruining good PHP.

I don’t know thing one about the Java language, but I can tell you, if you have an idea for an app you want to run on my machines, it will never be a Java app. That shit is unmanagable. At work we have people who need Java 7.51 (the app breaks with anything else), Java 7.65 (same as before), and Java 8.25. We need three fucking versions of Java to run the SaaS stack we have. It’s disgusting. Java puts a bad taste in my mouth, and I just can’t think positively about it.


#12

I’m hitting like, but most of what you just said might as well be written in Gheg. :laughing:

So, it’s like mixing industrial effluent with toothpaste? One needing careful handling from a distance, the other being fine in it’s place but the two should never ever be put together?


#13

I guess so. PHP has its own issues like any other programming language and framework. And I don’t know if all the problems of Java are intrinsic to the language and JVM, or just the people who code it and implement it, but I’ve never met a Java app I’ve liked.


#14

Using comments is cheating.

In my day job I have microsoft excel expressions which work fine as python code.


#15

Back in college I wrote a program in both C and Pascal. It produced the same results both ways: hundreds of compiler errors. I don’t think I got an A.


#16

Java was historically important. I think it saved a generation of programmers from themselves by taking memory management and a whole host of “clever tricks” around typecasting and reinterpretation out of their hands. The virtual machine was important for establishing cross-platform as the norm, but now we’re all writing web apps with maybe a chunk of native interface code, so who cares? The language is barely kept relevant by android but even there you get memory leaks. But I feel like Java is based on an ideal that “rigorous static checking will prevent bad code” and that’s just a lie. Now I have to wade through a bunch tedious boilerplate to understand your (and my own) bad code. You still need comprehensive testing, and then the static typing becomes something you have to fight, with endless interfaces and factories…

Behemoth corporations fighting it out for ownership and nobody ever took responsibility for dependency management. Fuck maven. Ant, you’re ok.

Php is like a far-out fantasy series by J.R.R. Hackerman. There are some people who are into it, and you can pick it up pretty easily and have fun without knowing too much, but if you really want to understand what the fuck’s going on and why things are called what they are and why gravity only works sometimes then you’re going to need to catch up on a whole lot of back story. It’s a story that starts with a little script about a hobbit and ends with the fucking Silmarillion. I avoid it so that I have an excuse not to help people with their wordpress thing or their drupal whatever.

Edit: I guess this is more a reply to @M_M


#17

Rigorous static checking is helpful though, especially on large scale systems maintained by generations of developers. The bloat seen in java is partly due to its ever so tricky object model and partly due to IDEs which allow you to churn out millions of lines of code.

But after 20 years of C development and five years in java I am coding in python.


#18

PHP is alright I guess


#19

That actually makes sense to me. Thanks!


#20

I like the sound of this. It suggests something of unspeakable horror being referred to in very polite company.