As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
Hi If I want to choose a language for web development what all the factors I should take care?
And following things are important in my application , so keeping these in mind what language I should choose ?
Every user will be having an account ( need database programming)
Different Data should be shown at client side based on type of the user ( there will be different type of the users, some data will be common to all, some data will be specific)
Need to manage all the data efficiently at server side ( server side programming )
Give rich UI at client side .
Keeping all such things in mind, what language I should choose for web development? please mention in terms of client side and server side programming.
And I did go through the same kind of question in stackoverflow , still am not clear with my doubt, expecting detailed answer. please Provide me necessary links, and I am thinking about php, ruby, JSP, but am not getting which one to choose and when?
Definitely It should be dependent on what I want, so above points tell that what exactly the application needs. Need to manage accounts, different data etc.
Almost (if not all) every modern languages have database bindings, and even if not, database programming could still be done using other backends.
This is application specific, has nothing to do with programming language.
Language contributes very little to speed of execution. Compiler/interpreter implementation, algorithms, data structures, architectures, frameworks matter at a MUCH greater point.
The only (dynamic) web programming language that browsers understand is JavaScript. You can use any JavaScript framework or even any framework that could generate JavaScript code to manipulate user interface.
For a general language:
Will it run on the server I'm looking at getting, or the hosting service I plan to buy?
Do I know it/can I learn it quickly?
Does it have the features I need now, as well as in the future if I plan to expand my web app?
Your questions:
Does this language have a ready-build database interface? If so, good!
Every single language out there supports some sort of conditional (if()) statement. You just need to use them properly, with the data you have.
Back to the first bullet point; will my chosen language run on a webserver?
With a few exceptions (NodeJS, for example), you can't use the same language client and serverside. You'll need to know at least HTML and CSS for your "rich UI", or you could always hire a designer and leave yourself to do the backend.
Personally, I would recommend you use PHP for this project. It does everything you want, is very widely supported by web hosts, and is free to use. Most web IDEs work well with PHP, as do text editors.
In all honesty you are describing just about any of the major server side scripting languages. It all comes down to how much experience you have with the language and which one has the API's / resources you need.
For example with PHP you can use Wordpress, Drupal or Joomla to power the CMS aspect of it all.
On the other hand if you had to script it all from hand then you just need to choose the language you prefer to use. Look at how the scripting language interacts with the database. Does it require much more code to access a query, are you comfortable using the language, can you use that language on your server?
PHP tends to be the no-brainer since it is widely support, there are plenty of resources and information all around the web due to it's popularity, and most of the major CMS's are written for it (meaning you don't have to write one yourself).
You could also consider newer Web languages like Opa or frameworks like ocsigen (with Ocaml), and you could also write your Web application; e.g. with FastCgi technology, in whatever language you are familiar with.
Related
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
I need to valorate what technology use for a web project, the team is composed by 4 developers and the time of the project is 1 year.
I'm more familiarized with php but the client is asking me to do it with JAVA EE.
I always have the same perception with Java and its frameworks:
So much xml and class in order to do simple things. In codeigniter I've to use 3 files (model, view and controller) with hibernate + spring + JSF I need more than 10 files!!!
An abusive use of the server. The javascript code lose importance and it's not good nowadays. Of course we can add javascript code but It seems "java web guys" prefer do the stuff on the server instead of the client.
Not good-looking application. Richfaces seems like a web of several years ago.
When I see a java application like liferay, alfresco, they looks heavy and very slowly.
I think I can be a little confused because lots of people and big companies continues using JAVA for the web. Why? it's about integration?
On the other hand Java is faster than PHP, but JAVA's servers need lots of memory (more expensive). In a server with many request we can improve with a language like php with bigger time per process and less memory per process because the server never is collapsed because of memory. Sometimes a JAVA server could collapsed because of memory and the average of response time in a real production environment would be bigger than php.
I'm really pleased with Codeigniter, why so many people thinks Java is better?
Thanks in advance,
Alberto
well I'm not using CodeIgniter so my comparison is already incomplete.
Question one would be: why do they ask for Java? Often big companies only offer Java or .Net environments for productive systems so they might not have the people to productively run PHP applications. I know its not complicated but the maintenance people define what they are running.
Ofter people talk on languages and their features but when the first business use case has to be discussed no framework will save you that amount of time to make it count. Most programming language will somehow solve the issue.
Java is not only RichFaces or JSF. There is a lot to choose from. A LOT. Not an advantage.
Stuff often forgotten is the tool support. Java comes along with a JVM that can be analyzed in detail what it does with its memory, garbage collector, threads and so on. Profilers in Java allow you to identify almost any memory leak within a few hours.
Most of the JVM monitoring works in realtime (with about 5% overhead).
Talking about tool: refactoring support is far beyond what PHP IDEs come along with.
You are correct if the first look at Java compared to PHP looks like elephants and horses. (ok the logo of php is an elephant, perfect comparison...). Horses are more flexible to turn around corners but they might not carry that much around.
I think from a language perspective Java is still more advanced than PHP. Namespaces, Classes, Type-Safety. These are somewhat available in PHP but still quite new.
Frameworks like Spring allow you to leverage your application on an architectural level and are more than just libraries.
I'm not the biggest Java EE fan, so I'll not complain on that.
A simple approach for you could be Tomcat+Spring+SpringMVC and a template engine for the GUIs. There is also GWT (Vaadin) if you target higher speed client behaviour (still a lot more out there).
There are lightweight approaches in Java too. I agree the standards in Java do have a more fatty tendency.
In my experience Java has no major drawbacks compared to PHP. The language choice will only affect success of the project if people come with less knowledge than required and spend too much time in learning things. And trying to find the right book about Java could be a project by its own :)
(counting as an advantage)
But I have no doubts PHP would allow you to finish the project.
I would rather look into the goals and requirements before choosing the technology. This often implies or simplifies a decision.
I hope I did answer at least one question here :)
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
I had just learned web development a while ago and made a a very novice site to practice. It looks terrible, but it's something to show I tried. I had extremely poor structure, didn't follow any standards, was using templates in Adobe Dreamweaver, etc. I had stopped working on it because of the vast amount of things that needed to be accounted for when making a website and starting learning some programming.
Now I'm trying to get back into it and do everything properly. I added a forum to the site and took a look at some of the source files to try to get a feel for how the pros do it. EVERYTHING was php. All the html was generated in PHP and the forum looked great.
What I want to know is how professional web-developers structure their sites. Mainly HTML with some php includes and things here and there, or mainly or even completely PHP? I understand that the forum is reading from databases and is most efficient when using PHP, but does this apply to most websites too? When I go to Facebook or Google or some web-developers custom-made blog, is that mostly PHP?
I know this can be considered quite subjective to the taste of the developer, but I have no clue where the middle ground lies here.
If it's at all possible, I would love to see some of the source files of the developers reading this.
Also, what programs are used? Just a text editor with syntax highlighting? Are the pages tested by uploading them or, do people have PHP servers installed to test the includes and things?
When I go to Facebook or Google or some web-developers custom-made
blog, is that mostly PHP?
First of all, there are numerous development languages and methodologies, and you owe it to yourself to examine at least a few.
http://en.wikipedia.org/wiki/Web_development
This list doesn't account for the fact that companies (like Google) heavily extend existing technologies or roll their own (e.g. Google and Yahoo design their own hardware from scratch, at least in some cases).
Also, what programs are used? Just a text editor with syntax
highlighting?
You can write code in any text editor, but projects quickly benefit from file organization, autocomplete, visual designers (sometimes), code refactoring tools, test coverage tools, etc. etc.
What I want to know is how professional web-developers structure their
sites. Mainly HTML with some php includes and things here and there,
or mainly or even completely PHP?
This question is independent of PHP. In brief, logic should be separated from presentation and shared functionality should be reused. The MVC pattern is very popular for achieving this.
Speaking of mainstream sites, it's my opinion (based on a few facts) that MySpace lost a great deal of market share due to not having a properly abstracted architecture that supported rapid deployment of new features and high performance.
I have no idea where to go from here. I knew there were a lot of
options and structures, but I was hoping for an example or some
starting point.
There is no one "correct" starting point, but if you like PHP and you are starting to recognize some of the right/wrong ways to do things, you are headed in the right direction. Look for a better editor if needed. Read a few articles on basic design patterns and best practices; they are all over the web.
If you want to branch out a little, download the free version of Visual Studio 2010 and try a .NET MVC web project. You can literally install, create a new project, and click the "Play" button to run.
What you are asking is how to separate content from logic, which is the tip of the iceberg of the larger question of scope when it comes to web page/web app development. One problem with coming up with a "best practice" or generally-approved model is that what might be the best design might not actually work in every browser or work on a mobile device, etc. But one thing to research is the idea of http://en.wikipedia.org/wiki/Business_logic, which aims to separate the aspects of a site/page into various scopes or layers.
I'm not an expert on the topic, but the general idea is to have a Data Layer (from the db), a Logic Layer (your php/web server logic), and a presentation layer (your html). To prevent too much overlap between the logic and presentation layer, many designers adopt an html template system, like Smarty, so that you can have your static HTML page marked up with the dynamic parts (user name, data table values, etc), and the PHP assigns those values to the template variables to be filled in.
Another aspect of this topic is the separation of your presentation layer itself. This generally breaks down into : Document layer (the actual HTML body), Presentation Layer (the look of the document, handled by CSS), and the Interactive layer (anything that should happen while the user is viewing the page, handled by javascript). These get pretty tangled into each other as well, but keeping them as cleanly separated as possible greatly helps your initial issue, as it helps prevent writing PHP that writes HTML that handles all three aspects. Instead, your PHP might only write the document, and the CSS and JS handles everything else once it loads.
What I want to know is how professional web-developers structure pick the technologies for their sites.
Companies use whatever they like, there is no such thing as best language for the web. They pick the technologies that suit their problem set and resources. There is not only PHP, there is ASP.NET, JavaServer Faces for example, and a lot more.
With HTML5 and Javascript libraries like jQuery, KnockoutJS or Dojo Toolkit for example, you can build awesome dynamic websites. I think that is somewhere to start learning, and also use an editor like Notepad++. Note that with a text editor you force yourself to look at the code so you practice it and understand it; I would not prefer the Dreamweaver way. Also, you can challange yourself to make your sites valid against W3C, and by doing so you will increase the quality of your site and code.
As you get more comfortable, you can proceed with PHP and/or the framework based on your preferred language, like CodeIgniter for PHP, which is great for learning MVC. It is a long journey to become an experienced web developer, so take your time. You will have your own best practises and preferences, and with time you will find out how you can do better.
If it's at all possible, I would love to see some of the source files
of the developers reading this.
As for coding styles, you can seek through existing questions, I think there are some for every language.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 12 years ago.
Locked. This question and its answers are locked because the question is off-topic but has historical significance. It is not currently accepting new answers or interactions.
It is widely believed that PHP is the easiest programming language to learn for a beginner. The argument goes that PHP is the easiest language to use for getting a quick prototype up-and-running.
Why might this be? What, specifically, makes PHP easier to use than other languages?
Would this remain true, even when learning to use the object-oriented aspects of PHP? Or is it actually the object-oriented aspects of PHP that make it easy to learn? How does it compare with other web programming languages?
PHP is native to the web. While Ruby and Python have much cleaner syntax, more elegance, and more power, there will always be a layer of abstraction between Ruby/Python and the web itself -- after all, they were designed for much wider domains than the web.
Newbies to programming are typically newbies to sysadmin, and getting to Hello World in a Rails or Django is pretty painful -- for some even prohibitively so -- compared to PHP.
For newbies, it's easy to conceptualize that typing in:
http://mysite.com/something.php
...will execute the code stored in the file:
/path/to/mysite's/webroot/something.php
This simple one-to-one routing also mirrors that of HTML and other static files.
Beware, however, because this one-to-one routing also leads to security problems (i.e. people tend to keep all of their executable code within the webroot -- even secure code, which may contain passwords, hash salts, and other Privacy-Important code). Combine this with a lack of sysadmin experience, and many sites on the web are a chmod away from being totally exposed.
Responsible PHP like Symfony helps people avoid this, but Symfony requires the same level of sysadmin chops as Rails and Django.
Object oriented programming is optional
PHP is forgiving
The script continues running on minor faults.
When E_NOTICE (or even E_WARNINGs) are suppressed, the errors aren't even noticeable.
But also in the small things like substr: In C# you'll get a big fat exception when you'll try substr($text, 3) on a $text with 1 character.
Great online manual
http://php.net/manual/
Quick and Dirty is the default
The language is filled with useful shortcuts.
PHP lets me express what I want without typing an essay.
Conceptual simplicity.
A php site can consist of one file representing one page, with the dynamic content embedded within the static markup as needed. You can scan down a simple php file and see everything defined and run sequentially.
With a simple php site, there is no learning curve where one has to figure out in what file a specific piece of logic belongs, or in what external file a function has been defined.
...
Of course there is a reason that frameworks like rails provide lots of files and a fixed structure, and I would definitely recommend using one for any sizeable (and probably almost every small) site.
I do think though that it's this very low barrier to entry that is responsible for a lot of php's popularity.
I don't think that there's any reason a better php style system couldn't be written in ruby or similar - think just directories and .erb and .haml files and nice 4.days.ago syntax. But most people who could do this see the value in the extra tools that a framework provides. Sinatra is a minimal framework, in which it's possible to define an entire site in one file, but even it has routing powered by code instead of just directory and file naming.
PHP have many web tutorials and books about it, it's free and popular which makes PHP communities bigger. And also it's intuitive.
While PHP is far from the best web programming language, it's the most common (in terms of availability in hosting packages), the most popular (even in things like tags here on SO), it has some of the best documentation, and it's one of the least strict in terms of having to follow any sort of standards.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 12 years ago.
Remember Aptana Jaxer? It plugs into Apache and allows using JavaScript on the server-side as an alternative to languages such as PHP. It comes with a consistens and slick API for filesystem access, database connectivity, socket communication and whatever else you need.
I wonder why hasn't this been more widely adopted, why aren't more people using this? Javascript is a modern and clean programming language as opposed to PHP and the Jaxer API is just so much more consistent and neat. No offense, but the PHP API is just such a big mess with all its inconsistencies and its inconsequent function naming convention.
Jaxer also makes client/server communication really convenient with its runat="server-proxy" where you can directly call server-side function from within your client-side script and Jaxer takes care of all the XML HTTP request stuff.
So I would just really like to here what people think about it or why there's hardly anyone using it. Not wanting to start a flamewar here, I'm just curious.
Thanks
Well, first of all, there is Node.JS out there, too. Far more people have heard of that, probably. And people do use node, especially when it comes to chats and similar things: Things there long-polling is appreciated.
My personal problem with node is, that it is so asynchronous. That's a very, very, very big pro on one hand, because is allows most awesome performance and makes some things so much easier, but on the other hand it is a big minus for those used to synchronous programming languages. I simply have problems with looking at code which has 15 callbacks nested in each other...
I remember taking a look at Jaxer, back when it came out. I don't remember any sample applications at the time though. I wanted to get a feel for what it was good at. Just because a language is "cleaner", may not be enough to get people switch. What is its "unique benefit"? For example, Node.js is good at real-time applications and they make that relatively clear in the sample code on their front page.
I think there was also been more uptake of Javascript, since Jaxer was initially released. There seem to be more back-end developers who now also know Javascript. I would say that's more true now than when Jaxer was released. In other words, maybe it was ahead of its time.
Personally I liked Jaxer, because you easily could use the same code client and server-side without duplication (such as form validation), however I didn't like, that you had hardly any control over the generated pages, which where propped full of JavaScript even for the most trivial page and made the pages highly depended on JavaScript, which made unobtrusive JavaScript virtually impossible.
So I guess for purely JavaScript-based web apps it's ok, however now there is for example Google Web Toolkit, which is much more powerful, which basicly also allows you to use one language client and server-side.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 9 years ago.
Friends,
I've got some exp in c++ and now kind of starting my way to J2EE (to survive:))). Meanwhile, I've got a plan to venture in to a web portal my own. But with very little experience in web technology, I'd need to start from scratch. I'm little confused on which way to go and I'm here.
PHP, Python or JSP, considering the fact that, anyway I've got to learn J2EE at my work.
Would that be worth to learn PHP or Python to develop a portal which I expect to get 80-100K
hits per day "IF" everything goes well OR jsp would be sufficient?
Many thanks
Before learning either of these, spend some real time and learn HTML and CSS in depth. Also learn Javascript and JQuery (or your favorite client side library). The O'Reilly books on the topic are pretty much all good IMO.
I say that because I think that you'll find that for most modern web sites, a lot of richness is moving to the client side, and away from the server side. Under this model, your code in PHP or JSP is probably going to look pretty similar (ie, fetch data from the database and serve it to your view or into JSON for the client to consume).
Considering you're used to c++, should look at aspx and c# - probably closer to your current experience.
That said, PHP is a doddle, so it shouldn't present any challenges. Bear in mind that if you want to get the most from the language, you absolutely have to learn a little bit about configuring apache, and frameworks (cake, codeigniter, zend etc).
All the server-side technologies you list are "sufficient" for the volume of traffic you expect, if you design the site well from a performance and scaling viewpoint -- and so do many others you haven't mentioned, such as other Java-based approaches, C# ones, and (last but not least) Ruby (probably with Rails, though, like the other languages, it has several frameworks for you to choose from).
As most everybody said, the client-side considerations are sharper -- unless you want to try a "server-side generator of client-side code" like gwt (I'm told the latter works well, but personally I'm always wary of code generators, esp. using a code generator w/o understanding of the "code" it makes for you, which in this case is HTML, CSS, and Javascript with its own framework). Except for GWT and similar approaches (if that's your chosen poison), really learning HTML, CSS and Javascript is really a must -- and then you get to choose among many, many frameworks again (jQuery, Dojo, closure, etc, etc).
For performance issues, you really want to study Steve Souders' site (and books, etc) -- Steve was a server-side guru until measurement showed him the bottleneck was really client-side, and then he turned himself into the client-side performance wizard;-). But to get the most out of the books you'll need understanding of HTTP, HTML, etc, etc, to start with;-).
Hit's per day isn't a really useful metric for estimating performance. You really need to be concerned with the peak load and the acceptable response time.
80-100k hits per day is an average of about 1 hit per second. The hits are not going to be evenly spread out, so for normal traffic you might expect a peak load of 10 hits per second.
If you are going to promote the site with newsletters or commercials, expect to peack at 100's of hits per second.
If you selling $1 air tickets, expect to peak at 1000's of hits per second.
Now the language you choose for the site isn't nearly as important as your choice of database (not necessarily relational) and the way you store the data in the database.
Scaling up frontends is relatively easy, so having really fast efficient HTML generation shouldn't be a primary concern. Pick a platform that is going to be efficient for development time.
I expect this question to be closed as being subjective. But, I'll put in my 2 cents.
JSP would likely dovetail well with J2EE. (I've heard that it can be a bit rigid, but I have no experience to provide any insight on the matter.)
PHP is a good candidate, because it's popular. You can find a lot of info on the web.
Python isn't as popular for webdev, so finding examples won't be as easy.
I also second Dave Markle's opinion. If you want to learn webdev, HTML, CSS and JavaScript will be crucial as well. You may never want to be a front-end developer, but you can't get away from dealing with those technologies at some point.
There are many options.
Since you already know (and is learning about) Java, one option is to use GWT for both server and client. This can help you in that you do not need to learn another language (JS/HTML/Python/PHP etc). If your portal is going to be big, using Java can help you organise the application better - usually JS/HTML based applications are not very suitable for proper organisation, even if you use good JS Libraries like jQuery or YUI. Having a good organisation can help a lot - during updation and modification later.
If your planned venture is a single/two person venture or if it is time bound - where time to market is everything - then I would not suggest the earlier approach - especially if your server side part is expected to be big.
Java is a slow language to write code in. A project which you will take say 6 months to write in Python will take you close to 1 year + in Java. In such a scneario, I would prefer Python - it is a proper language - unlike PHP, and you create code with good organisation there too - albeit a little less organised than using Java.
Please note that if your client side code is much more complex than your server side code, then going with GWT will do you no harm. But if your server side code is very complex compared to the client side, then I would suggest Python.
Another point is to use existing Web Frameworks to ease your work. For Python, Django is an excellent choice. This itself will decrease your work time by 50% or more, while making your code much more secure and scalable.
It really isn't that similar to C++, but I would recommend PHP. You really can't expect a server-side scripting language to be similar to a compiled language like C++. Personally, I find PHP to be an ugly, messy looking language, but once you get into it, it's very rewarding. Other languages have too many drawbacks. ASP.Net is too Microsoft-centric, Python and Ruby on Rails are too obscure, and are also non-curly bracket languages, meaning it will require a lot of adjustment to change to them. Hope this helps.