Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 2 years ago.
Improve this question
In web development, does the backend code always mix with the front code at some point? Checking jsp and some php I see that the code is usually mixed, is this a bad practice or should you always avoid using javascript as an intermediary?
Normally it depends on what you really want to do. But they are usually mixed
PHP was developed as a templating language for web, so basically it is what it was created for. But you might notice that in modern projects PHP used mostly as an API backend for Javascript application. In such cases, it will not be mixed.
It seems to me that it depends on the project type. But even if you do not use modern JS frameworks try to separate business and frontend logic. Check the MVC architecture or DDD.
Related
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 1 year ago.
Improve this question
I'm working with PHP and I love this language but when I look at big websites there a small percentage of them using PHP and the rest of using node.js etc, so based on the big websites like Netflix, etc, have some questions
1- Is PHP required in companies?
2- what PHP framework should I learn
3- what frontend framework, etc, good for PHP?
4- is node.js better than PHP
if there is anything wrong or you can correct me I'm here to learn :)
I'm very lost I really need the answer I don't know where to go.
in PHP there is no way to automatically refresh the page however
there is a guide on this page to do that
if you started to use a framework like Laravel you can do that with
the Browsersync plugin
I have seen a lot of PHP and Laravel projects requests in freelancing
websites than node js so yes it's required
both languages are needed there is no language better than the other
one each one have its use cases
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 6 years ago.
Improve this question
I'm currently working on a PHP project, which should use markdown to display some text.
The question I ask myself now since there are markdown parsers for javascript and PHP is if I should parse the markdown Server or Client Side.
Pros Server-side:
Always the same, even on clients which have javascript disabled.
Pros Client-side:
More dynamic allows for Preview function.
Uses Clients-Resources instead of the Servers.
Did I miss anything?
What would you suggest?
Any help is appreciated!
Inspired by so-called Isomorphic Javascript or Universal Javascript, I suggest you to make the first rendering on server side; then when you update your page —using ajax— you make the rendering on client side. Doing so you would get the pros of both solutions:
a fast initial rendering of the page (no need to wait for the JS libraries to be loaded)
a reduced server load for following requests
an up-to-date user experience for edition
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
I'm creating a php app where almost all requests are in ajax and some Jquery effects, so some of my pages are up to 2000 lines of code, all my jquery in one big $document.ready{}, is it normal? should I be ashamed of showing this code to other developers? or is there a better way of organasing Jquery code ?
Like how many others have said, if it's maintainable and easy to read then it shouldn't be much of an issue. However, in my experiences, code that is organized into separate logical modules were MUCH easier to read and maintain than one long document.
With that being said, the typical workflow these days with tools such as browserify would be to refactor and separate the code such that each file executes a specific task for development purposes and when it is time to deploy to production, one would use a build tool to group/minify and optimize for the browser.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
We are planning to shift our web application from php framework to angular.js, but I am worried if my code will be stolen? because javascript frameworks source are open to everyone, does it makes sense to worry about it? Are there any popular applications that use javascript frameworks?
For protecting your javascript code you can use UglifyJS
https://github.com/mishoo/UglifyJS
For protecting your request to the API you can use server side
authentications
If you want to build a one-page application you must use some JS
framework, more about frameworks you can see
http://en.wikipedia.org/wiki/Comparison_of_JavaScript_frameworks
In any case, you can't 100% protect your code, but you can make it 99% unreadable, for example, look at this resource http://javascriptobfuscator.com/.
You can't
AngularJS is client-side frameworks and PHP is server side language, so no you can't completely migrate your application to AngularJS.
Probably what you want is Node.js
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
I'm new to Flask and frontend javascript frameworks and trying to build nice REST site which will not reload every user click. I now a little bit of jQuery. What is the best javascript framework suited for Flask?
Flask is a microframework, intended for wide use of extensions (see the list for most known). And also it's JavaScript-agnostic. So you can use any js-framework you want.
jQuery is good and well-known. I would recommend jQuery + Backbone.js for AJAX/REST web applications. Works nice with Flask.
Backbone.js is also well-known and uses RESTful interfaces by default. But it's main purpose is to help you implementing web apps using MVC (model-veiw-controller) approach on client side. MVC approach is mandatory for complex, feature-reach applications, and gives you supportability and code readability.
I thing this will be best choice for you.
(similar frameworks exist of course)