Whenever I code in JSP and have inline Java code as follows:
<%
double num = Math.random();
if (num > 0.95) {
%>
<h2>You'll have a luck day!</h2><p>(<%= num %>)</p>
<%
} else {
%>
<h2>Well, life goes on ... </h2><p>(<%= num %>)</p>
<%
}
%>
It seems to drive people crazy and they pass comments such as:
Why are you using technology that is 20 years old?
This is not manageable code
You Should be using Servlets
You should be using JSTL.
Even JSTL is no longer a Good Practice.
And yet when it comes to other languages such as Python (Django) and C# (ASP.NET) it seems to be perfectly fine. The following snippets are from tutorials as early as just a few months.
So whats going on here? Only Java has found a way to manage code properly and other languages are sitting back with a 20 year old technology? Or Java developers are over reacting to a perfectly acceptable way of coding?
{% for x in range(5) %}
<h1>Hello World</h1>
{% endfor %}
Same case in Razor when ASP.NET MVC initializes when you start a new project, the cshtml pages have inline c# codes. For example as follows:
@{ var theMonth = DateTime.Now.Month; }
<p>The numeric value of the current month: @theMonth</p>
Note: Please note that I am not asking how to avoid writing Java code in JSP. I am asking why is back end coding "Not an issue" in other languages less Java.