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

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

5 Likes

Time well spent. Said no one ever.

15 Likes

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

7 Likes

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

5 Likes

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.

5 Likes

<barfs on shoes/>

7 Likes

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

12 Likes

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

7 Likes

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”.

8 Likes

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

11 Likes

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.

13 Likes

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?

3 Likes

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.

3 Likes

Using comments is cheating.

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

3 Likes

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.

15 Likes

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

12 Likes

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.

4 Likes

PHP is alright I guess

2 Likes

That actually makes sense to me. Thanks!

2 Likes

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

3 Likes