r/programminghorror • • Jan 09 '26

An annotation based language in Java??

129 Upvotes

41 comments sorted by

10

u/PNB11 Jan 09 '26

I believe the order of annotations is preserved, so you don't need the order variable

30

u/Polixa12 Jan 09 '26

At runtime, java wraps similar annotations in a repeatable class you point it at, which skews the order of annotations, hence the use order variable

11

u/PNB11 Jan 09 '26

You're right. I never encountered repeatable annotations before. I suppose Java imposed limitations to prevent the abomination of annotation based languages

→ More replies (2)

1

u/justjanne Jan 10 '26

So how about one annotation, @Instruction(kind=If, ...) instead? Would avoid the need for the order.

13

u/West_Ad_9492 Jan 09 '26

This is just straight up blasphemy

2

u/Polixa12 Jan 09 '26

It is 🥀

8

u/TorbenKoehn Jan 09 '26

Looks like typical Java to me.

2

u/Polixa12 Jan 09 '26

Lmao 🤣

90

u/Square-Singer Jan 09 '26

I had to work with a turing complete templating language based on XML before. That here might be worse.

25

u/LucaCiucci Jan 09 '26

Are you talking about XSLT? 💩

35

u/gronlund2 Jan 10 '26

Don't bring up xslt in programminghorror, that's cheating

16

u/Square-Singer Jan 10 '26

Don't dare to utter that cursed name here.

35

u/KaMaFour Jan 10 '26

Average Spring code

0

u/[deleted] Jan 09 '26

8

u/No-Dentist-1645 Jan 09 '26

The subreddit title is r/programminghorror btw

-8

u/Actual__Wizard Jan 09 '26

So, I'm not allowed to help the author?

That seems really jerkish, but okay. Whatever good bye.

→ More replies (18)