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 currently developing a web application using PHP, but I'm considering developing the web application using the lift framework instead, because twitter and foursquare have implemented it. I know a few benefits using lift/Scala but, could you guys mention some benefits compared to PHP?
Many thanks
Resmus Lerdorf, the inventor of PHP, once said with regards to foursqaure (build with scala/lift) that it's the first site for a long time that doesn't have a single security hole he could find.
If you're having trouble enumerating the reasons why you'd use scala/lift over PHP, you'll probably want to stick with PHP. PHP is a far more mature and supported platform - oodles of documentation, huge community, tons of tools and libraries.
Scala is a great language, but the primary reason it's being used by Twitter and Foursquare is it's ability to work with enormous sets of data on a horizontally scaled architecture. These are very specific problems for these companies, and Scala was chosen for this purpose very deliberately.
As someone who has recently begun learning Scala, the community and documentation is minute compared to PHP's. Especially where Lift is concerned. And things like IDE support is still in it's early stages.
There's really no way to compare the two technologies (very different approaches). If want to use Scala, use it, but you'll probably be investing more time and energy if you're not already proficient (also, some background in Java doesn't hurt). PHP is just PHP, it's so easy to just pick up and use.
If you ask such a question you'd better stay with PHP. Once your project becomes more and more complex and you are fed up with PHP limitations the question will disappear on its own.
But Lift does not have to be the framework of your choice.
You should consider anything except PHP a good language for web applications, but Scala is a pretty excellent one, although it will change the way you think about programming as a whole. Some people can't handle that, so be warned.
PHP advantages:
Is installed even on the cheapest "5ยข-a-month" webhoster.
PHP disadvantages:
The libraries are not stable and change every now and then, often without notice.
The whole language is buggy and generally doesn't work as a sane person would expect.
The documentation is unusable, sometimes wrong, sometimes only understandable with the user supplied usage examples (which are often wrong or not optimal, too).
No quick way to see the implementation of some language-supplied code.
The API is one big mess ... this shouldn't be called API, it should be called MCOBRIM: Messy Collection of Buggy, Random and Ill-named Methods.
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 6 years ago.
Improve this question
I start this topic saying that I use PHP since 2014 and I'm experienced with it, but recently (yesterday) I started to give a look to NodeJS.
Node is growing fast and it's been used by a lot of web-services.
I started using it yesterday, but I found it less "beginner-user friendly" than PHP.
I'm not saying this as a beginner in computer programming, but as a Node-beginner.
What is your opinion?
Is it worth knowing both languages?
Is it worth knowing both languages ?
If you come from php development, learning node is a great idea.
It ll teach you in a soft way the concurrent programming pattern, and also event/stream programming,
it will lead you to face problems regarding the underlying OS in a soft way.
All sort of stuff that PHP greatly solves for you right out of the box and which you never think about.
Node will also give you the impression of a bigger playground to explore.
But, if you want to be productive when it s about building website, i believe PHP is better.
On the other hand, if you are looking for performance, node may be better, but true performance comes with compiled languages like GO, not scripted languages.
Finally, if php was not plumbed by all those damn heavy javaesque framework, it would be a really nice environment with a good trade off between speed and complexity.
Node gives you speed, but it comes with a price about the complexity which can be very costly.
As a beginner of both language i noted the following advantages of both languages
PHP
Mixing code with content
Deep code base
No client app needed
SQL
Speed of coding
NodeJs
Separating concerns
Newer code means more modern features
Service calls are thinner than HTML-fat PHP calls
JSON
Raw speed
You can read full article Here
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 am planning to make a website which shows location information up.
The thing is, since the pages will be interactive to users and I am thinking of using node.js and mongoDB(pretty capable for node.js isn't it?).
Please recommend me which languages are fitting on node.js & mongoDB.
Python? or should I use jade for the development?
and plus, will be PHP Codeigniter helpful?
(I am used to developing with PHP and I am wondering if PHP & node.js combination is nice)
Thanks in advance.
Generally I'd prefer not to use two different languages for comparatively simple applications (if your usecase is simple). There might be usecases where you can't avoid this, for example you have to use libraries that only exist in either one of the languages.
I'd use Jade with ExpressJS as Backend, however I consider the template language to be a highly personal Choice. See http://expressjs.com/api.html for an ExpressJS example
See https://npmjs.org/browse/depended for a list of popular NodeJS packages. Some people prefer to use EJS (embedded javascript) or ECO (embedded coffeescript) or one of numerous other templating systems instead of Jade.
Please also consider to use CoffeeScript instead of writing the JS yourself (CoffeeScript is automatically converted into JS. It adds some neat features that are easy to get wrong when you're writing plain JS.
From a performance standpoint, NodeJS is best when you have many API calls that return a small amount of data. I've made good experiences with ExpressJS performance using Jade as backend.
I can recommend the NodeJS beginner book, however, this is, as always, highly subjective.
It's difficult for me to Judge if Python might be a better solution. I recommend you take a look at Tornado together with Jinja2 as template engine. NodeJS can sometimes get quite a callback hell, because of the way it does its asynchronicity, see e.g. http://callbackhell.com/
Note that in any case, for increased security and fast static file (CSS, JS) delivery, you might want to add a reverse proxy layer (Nginx usually provides better performance, but Apache works as well) before the NodeJS/Python server.
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 know a little java, android languages.
Now I want to build an Android server-client application and for
client side I will use Android(java) and for server side either
JSP/servlet or PHP.
So I have 2 questions:
What is easier and faster to learn PHP or JSP/servlet(also don't
forget that I also know java) ?
2)Which one would work better? as the client side would be written
in Android(java) may be the JSP/servlet would work better, or it
doesn't matter?, and as PHP is the most used server language may be
it would work better?
Thank you in advance.
I personally found PHP simpler and easier to learn, BUT i knew JAVA and C++ before. I would also like to add that a few of my colleagues that had little experience with other programming languages found PHP to be fun and easy to learn. You have much less to worry about memeomry consumption, variables types, Threads etc...
It totally depends on what your system will require.
-Java is more complex and thus offers a wider range of possibilities, more control etc...
It doesnt mater in what programming language the client application is written in, since client/server communication is done using "standard protocols and systems and formats", such as REST protocol, JSON data encoding and so on....
Another advantage of PHP is that it will run on basically any hosting you purchase for your server, since most of them if not all support PHP/mySQL, while Java will probably require you to purchase a Cloud service or something similar. In such sense PHP may come cheaper to you.
I would also like to add that i have used PHP in most server apps i made, one example was a trading app...but some apps that needed multithreading + RAM caching + hash maps + sockets + other Java functionalities that are built in, etc were meant for Java...so PHP can do the work, but for some things Java is better and just comes naturally...this is totally based on my personal experience so dont take it for granted, you may have a totally different experience.
Maybe tell us what will your app do so we could point you in the right direction.
This
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
First of all, I'm an experienced js programmer, good also in php (exluding database design) but don't know much about how servers work.
I'm participating to a quite big projects that's about to start and I'm trying to figure out what's the best tecnology to use.
The application will be geolocalized, and will use google maps. It will have a lot of javascript rendering (probably on the front end I'll end up using backbone or ember, but still thinking). hopefully, it will be used by a lot of users. The will continuously receive data while moving around. Specifically, they'll receive data from clubs, pubs and so on.
hopefully, it will coninuously grow over time, with new features, more data, more users.
I was wondering if node.js could be a good choice for developing it of it would be better to stick to more conventional php ways.
what do you think?
Since you are an experienced Js programmer, you shouldn't have a real problem using Node.js. You're already familiar with the language. If your application will send and receive data continuously, I recommend Node.js and socket.io, which enables real-time communication.
Nodejs takes a lot more initial code than php(because there is no middleware server like apache, you have to program the server yourself), but can perform faster and has much better support for templates and websockets than php. If your maps application wants real time updating, then websockets are incredible, but there is no good solution in php at the moment. The only way to handle websockets in php is through external programs, because you can't control the php server.
One thing to consider if you are going to use nodejs is: Do you like callbacks? Unlike php, where everything is performed synchronously, in nodejs, almost everything is written in asynchronous callbacks, to prevent the server from seizing up while handling a big request. Some people like this coding style, others despise it and think it is a messy bunch of functions inside of functions inside of functions. I personally like this style but it is more complicated than php.
A lot of the choice depends on your team's personal preference. Spend a hour or two trying both with your team and seeing which appears to be working best for you.
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
Recently, i heard alot of JavaScript being used sever-side. Node.js, express.js and similiar stuff are mentioned more and more, but i never had the muse or time to dig deeper into the topic.
Now, as the information flood would not decrease, i can not longer ignore those circumstances.
I wonder about two things:
Can i replace my complete, simple PHP backend, which is primary used only for database access, with server-side Javascript
and if yes:
are there any benefits of doing so?
and if not:
Why is there such a hype?
The topic seems to be quite complex and not too easy to learn, but as time goes by, i more and more get the feeling that this maybe will be the future of backend coding.
Yes you can.
If you are primarily serving data, a more contemporary approach would be to use node.js to implement a restful api . Node.js is particularly suited for this as it inherently works asynchronously - which means each request to the data source (ie the database) inherently does not block while the server is waiting to return, allowing it to punch well above it's weight in terms of being efficient when servicing many requests.
You could use the node modules express.js or restify.js to implement this.
A warning though - node.js is a single threaded application which means some work has to be carried out before is scale able. There are some good solutions for this, such as using Amazon Elastic beanstalk. But as node.js is a relative newcomer many other proposed solutions may need some coaxing to be production ready.
You may find it beneficial to read 'Javascript the good parts' by Douglas Crockford before you begin - something I needed to bring my knowledge of Javascript to a level where I could write quality maintainable code for node.js
Yes you can replace it.
Main concepts about Node you have to know is being async, second is being event-driven.
So if your PHP app just accesses db and serve responses back, node.js would be more efficient in such applications, as would not block idling for response from db, but can process with other requests and so on.
It is not complicated, if you do it. Just go and dive into. Don't ask - prototype. It is the best way to understand if you really need it or not.
I've replaced all my PHP need to node.js, except templating.