-1

I am wondering if it is reasonable to write closed source, paid web apps in Javascript (JS MVC Frameworks like AngularJS, Backbone, Knockout, ...)? I'm concerned because in this type of frameworks you use typically a REST backend for CRUD operations and the majority of business and application logic happens in Javascript which can be looked up by anyone using my app. He can see how i do things.

When I use for example PHP or Java (Wicket) most of the logic is happening on the server and so a lot less of my source code is exposed. This seems to me a lot safer if I want to have an edge over my competitors, so potentially I earn more money.

So is it reasonable to use JavaScript MVC Frameworks for paid applications? Does it depend on something and if yes on what?

1
  • Just minimize. Barring some spectacular algorithm that performs miracles, nobody likes anybody else's code enough to bother reverse engineering minimized code. Dec 5, 2013 at 8:32

2 Answers 2

6

There is at least one major error in your question: In an REST backend the business logic still is on the server. It has to and having business logic in the browser would be pure madness.

From there we can go on and see that the most complex part of any serious web app rests on the server anyway. The browser can only take the View part of the MVC, maybe a few elements from Controllers. Main Controller functionality and especially Model are just to security relevant.

Beyond that: What do you want to write as web apps? If I want to do something smart, I don't look at my competitors, I use Google and StackExchange to find that it was done before a hundred times or at least something similar. There are libraries for mostly everything. The times when keeping your code a trade secret are gone, at least when we are talking about the user interface.

0

If you are only using REST as your entire backend to communicate with the database, that maybe your problem. Using EJB and JPA, the business logic is abstracted away from the user, and handled by the server and its database.

If your application logic is happening in your java code, well then I would suggest that it is not clean code. A servers job is to respond to the questions asked by the client. If the business application logic happens in javascript, then the client is essentially answering their own questions. Essentially, your questions makes no sense.

Not the answer you're looking for? Browse other questions tagged or ask your own question.