HAY GUISE! I've got a question for you!



  • Would you want to develop in an HTML template system that had its own
    custom scripting language based on Java that had the following limitations?

    • No primitives (no int, float, or arrays)
    • Only while loops
    • No try/catch blocks
    • Only classes from java.util and java.lang are allowed
    • By that I mean you can only instantiate them, you can’t call static methods (for example: String.valueOf(true) is invalid)
    • You get to extend the system by adding methods to one single pre-defined Java class
    • Every statement gets wrapped in a tag, sort of ColdFusion-style

    When I say every statement, I mean it.

    <FOO>while (true)
        <FOO>if (bar)
            <FOO>bat()</FOO>
            <FOO>baz()</FOO>
            <FOO>break</FOO>
            <!-- etc., and by the way, comments don't make it 
            through to the output page when it gets parsed -->
        </FOO>
    </FOO>
    


  • Stop it! You're scaring me!



  • It's pure genius. I always get a good feeling whenever someone moves forward under the premise that he knows more about Java than Java's designers do. I propose we call it JavaStripped.



  • @djork said:

    Every statement gets wrapped in a tag, sort of ColdFusion-style
     

    Amazingly, this makes languages in which statements are tags seem more natural.



  • AAAAAAGGGGGGHHHHH!!!!!!! IT...BURRNNNSSS!!!

    I would find a new job.  Reinventing the wheel is not fun.



  • @djork said:

    Would you want to develop in an HTML template system that had its own
    custom scripting language based on Java that had the following limitations?

    Of course! I could think of an adequate hourly rate.



  • From the title, I was expecting this to be some lame spam, but it turned out to be a good WTF.  You should work on your headline writing skills.



  • @vt_mruhlin said:

    From the title, I was expecting this to be some lame spam, but it turned out to be a good WTF.  You should work on your headline writing skills.

    Agreed. How about "Wherein I Postulate Upon the Various Comparative Merits of an Unnamed Proprietary Enterprise Scripting Language vs. the Java Upon Which It is Based" instead?



  • @vt_mruhlin said:

    From the title, I was expecting this to be some lame spam, but it turned out to be a good WTF.  You should work on your headline writing skills.

     

    My first thought was "This is going to be amazing."  I think the tipoff was that a word as long as 'question' was spelled correctly.  You might want your sarcasm detector adjusted--I find that this site puts a lot of wear on mine and I have to take it into the shop on the 'severe use' maintenance schedule instead of the 'normal use' schedule.  Check your manual.  You might also just need to top off the lubricant.  



  • I see some merits in a very limited template system (i.e. one that simply is not powerful enough to let you put business logic into html templates),  but of course you should not be forced to develop in it. Just make an HTML template, put in a few placeholders and loop markers, done. Everything else is done somewhere else, using a real programming language. Obviously, such a template system should be simple and compatible with HTML editors so web designers without programming skills can use it.



  • Inventing these limitations is the clear proof of incompetence.



  • @ammoQ said:

    I see some merits in a very limited template system (i.e. one that simply is not powerful enough to let you put business logic into html templates),  but of course you should not be forced to develop in it. Just make an HTML template, put in a few placeholders and loop markers, done. Everything else is done somewhere else, using a real programming language. Obviously, such a template system should be simple and compatible with HTML editors so web designers without programming skills can use it.

    Absolutely.  If you've ever used ASP.NET you know that ASP pages are at their best when they are just filled with the simple, logic-less, presentation tags.  Having a class for each page is a great way to organize things.

    This, on the other hand, is almost the opposite.  There is ONE class (pre-defined) that is there for you to put your custom logic for [i]about EIGHT HUNDRED templates[/i], and it has to be instance methods, so you have literally one degree of freedom for defining custom logic.



  • @djork said:

    Would you want to develop in an HTML template system that had its own
    custom scripting language based on Java that had the following limitations?

    • No primitives (no int, float, or arrays)
    • Only while loops
    • No try/catch blocks
    • Only classes from java.util and java.lang are allowed
    • By that I mean you can only instantiate them, you can’t call static methods (for example: String.valueOf(true) is invalid)
    • You get to extend the system by adding methods to one single pre-defined Java class
    • Every statement gets wrapped in a tag, sort of ColdFusion-style

    When I say every statement, I mean it.

    <FOO>while (true)
        <FOO>if (bar)
            <FOO>bat()</FOO>
            <FOO>baz()</FOO>
            <FOO>break</FOO>
            <!-- etc., and by the way, comments don't make it 
            through to the output page when it gets parsed -->
        </FOO>
    </FOO>
    

     

     

    This must be a hoax. You can't have a foo tag within a foo tag.  I call shenanigans. 



  • @Lysis said:

    @djork said:

    <FOO>while (true)
    <FOO>if (bar)
    <FOO>bat()</FOO>
    <FOO>baz()</FOO>
    <FOO>break</FOO>
    <!-- etc., and by the way, comments don't make it
    through to the output page when it gets parsed -->
    </FOO>
    </FOO>

     

    This must be a hoax. You can't have a foo tag within a foo tag.  I call shenanigans. 

    Nope, no hoax.  That's exactly how control structures like if/else/while work (wait... not [i]like[/i] if/else/while... just if/else/while, that's all you get!).



  • I have found new levels of WTFery in my attempts to third-system this serious case of second-system-syndrome.

    The following code fails with a NullPointerException when run:

    label = (String)(callstack.remove(callstack.size() - 1));

    While this code is fine:

    Object o = callstack.remove(callstack.size() - 1));
    label  = (String)o;

    Can you spot the problem? I can't.



  • @djork said:

    I have found new levels of WTFery in my attempts to third-system this serious case of second-system-syndrome.

     

    I thought second-system-syndrome was when a system was grossly overengineered?  Looks like a first-system-syndrome to me, or perhaps even the fabled zeroth-system-syndrome.

    Sorry, can't help with your problem, though.  Maybe it's the order in which the statements are evaluated?  Like, it's trying to cast first and then call remove() instead of casting the result of remove()?  shrug 



  • @Outlaw Programmer said:

    Looks like a first-system-syndrome to me, or perhaps even the fabled zeroth-system-syndrome.

    None of the above. The problem is not the environment in which the system was developed. What you have here is "bloody idiot syndrome".



  • I have to confess. I've done something horrible.

    I'm writing a dialect of Lisp that compiles to this tag-code template language. It adds such advanced features as: simple iteration, simple list declarations, and a syntax that is not insane. There's an advanced set of features which adds the ability to define functions that compiles to code that basically uses the tag-code language to build a simple VM. It's pure insanity, I know, but if it would be possible to actually write code in a succinct language that allows things like, oh, I dunno, [i]functions[/i], then it is all worth it.

    Even if it's never adopted by the project team, it was a fun Friday project.



  • @phaedrus said:

    ou might want your sarcasm detector adjusted--I find that this site puts a lot of wear on mine and I have to take it into the shop on the 'severe use' maintenance schedule instead of the 'normal use' schedule.  Check your manual.  You might also just need to top off the lubricant.  
     

    You have a sarcasm detector?

    please sir, email me teh codes


Log in to reply
 

Looks like your connection to What the Daily WTF? was lost, please wait while we try to reconnect.