1. Python + Web
In the past few days, I 've been stuck in Web programming in the house, making language choices and framework choices, and getting my head dizzy. Because you are familiar with python, Let's first look at how to perform Web programming in Python.
Python has the most web frameworks. The more you choose, the less difficult it will be. You have to study each framework before you can draw a conclusion. At last, Django is selected for a thorough study. I found that development is still annoying, and there are too many things involved. Later, I looked at other lightweight frameworks, such as mod_python and webpy, and found it easier to get started.
This is only a technical feasibility analysis. However, when it comes to Web hosts that support python in China, there are fewer and fewer web hosts. From the perspective of commercialization, environment, and maturity, we developed short projects that are not suitable for python.
2. Java + Web
Since python is not suitable, what about Java? Java did not say, so many people use his certainly strengths, for me? I came from C ++/Delphi, and I am not familiar with Java, but I am not very familiar with it in general, especially for the horrible big framework of J2EE, the class library in it is so horrible that you have to use dozens of classes to complete a simple function. I used STRUTS + hibernate to develop a simple user self-service system, and the configuration in the system is crazy. When you are working on a project, you can collect this knowledge and set up the development tool (eclipse). However, you have forgotten it for a long time, I have to go online for another crazy search. Let's talk about eclipse. We should use the hibernate plug-in for hibernate configuration, database ing, etc. The first configuration was conducted based on the information found on the Internet. After the project is developed, everyone is busy with other things. A few months later, we will port the database to Oracle. Now we will build the environment. As we have been developing in other languages in the past few months, I forgot how to set up the environment for a long time, and I had to wait for another half a day to build the environment. Let's get started with the environment. I forgot what Hibernate is, and I have to come up with "proficient in hibernate" for a study.
From another perspective, if we have been using Java for development, this is not a problem, but many of our friends have been developing on Win32 and want to go to the Web, from time to time, we need to re-operate the old machine (win32). The large Java framework is a huge "Mountain" for us ". To be honest, for small projects used for their own products, you don't have to worry about how powerful the development language is, as long as it is enough. Because the introduction of new development languages or tools will inevitably lead to a waste of human resources, and the cost cannot be ignored if you work for yourself. The conclusion is: the Java framework is too large and too complex. We need to spend too much money and energy making profits. If there is a better choice, we will not consider Java for the moment.
3. Asp.net + Web
So what are the remaining options? ASP, ASP. NET, C #? I am not planning to use this ASP class. I also know that with Microsoft's powerful Visual Studio development tools, ASP Web development will become increasingly complex and it is very difficult to get started with ASP languages. However, considering that our products must support Unix-like platforms, only this one does not need to consider the ASP class. However, we can select ASP for projects that do not require cross-platform access.
Another reason for not selecting ASP is the product's own security. Although services are not sold, different business models may not be generalized. ASP itself does not seem to support code encryption. That is to say, the application you deploy to the customer can be directly modified by others. Some of the information I found on the Internet can be vaguely felt that after a good website comes out, if ASP is used, similar websites will soon be copied; we can also download the full-site code from the Internet, which can be used without modification. If our product is developed using ASP, then competitors will not be able to take it directly and use it for another skin. Encryption does not seem very easy to do. Of course, I have not studied the ASP encryption problem mentioned above. Maybe there is a solution.
Conclusion: ASP does not support cross-platform security and does not support ASP.
4. PHP + web4.1. select to learn PHP
Then there will be no more options, and the final focus will be on PHP.
PHP is a dynamic scripting language. Due to the first python, PHP is familiar with the characteristics of the Dynamic Language. After seeing it, PHP feels similar to Python and has a close affinity. This may be because I saw PHP at a good time, and PhP4 does not seem to support object-oriented, but I have seen PHP 5.2 and started to fully support object-oriented; in addition, PHP is designed for the web. You cannot write a program that runs independently from the web like python (maybe you can, I have no specific research ), the support for web should be quite good, and I learned PHP with curiosity about PhP.
The specific deployment can be easily obtained from the Internet. My experiment environment is php5.2 + apache2 + MySQL.
PHP is very fast to learn. I have experience in language learning. Generally, it is from top to bottom, and then from bottom to top. From top to bottom, we should first have a general understanding of the quality and characteristics of the language itself. We should take what it can do, and what it can do. It should be object-oriented or process-oriented; is the application widely used? What are the successful cases. Only by understanding the general features can we decide whether to learn or not, so that we can understand how long it will take and how it will take to learn based on my current experience.
From the bottom up, we should first learn the syntax structure of the language when learning a specific language. As long as there is a foundation for other languages, this is often very simple, nothing more than variables, constants, expressions, process control, functions, classes, inheritance, objects, memory management. I only spent two hours learning PHP and compiled several small programs for testing.
After mastering the basic syntax, you can learn the core of the language: Class Libraries and frameworks. The default class libraries in different languages are different, and there are only a few. There are a lot of Python and a lot of PHP, and Java and. NET are very full. Class Libraries and frameworks are the essence of a language. A commonly used framework can be used to grasp the language itself. Of course, it is best to combine language learning with practical applications, so that you can learn and use it at the same time, so that learning is more solid and faster.
When learning, it is best to read the code written by others. There are no shortage of good tutorials and code instances in each language, so as to make full use of network resources.
4.2. php development tools
Finally, you must select a proper development tool to learn a language. Otherwise, your development efficiency will not go up. Java uses eclipse, JBuilder,. Net Visual Studio, and activepython pythonwin and PHP? PHP has to use Zend, but Zend is charged and expensive. Depending on the situation, Zend is allowed, and editplus and phpdev are not allowed.
4.3. php application
PHP can be directly embedded into HTML, and its usage is similar to ASP. That is, _ cookie, _ session, and _ request provide convenient features for dynamic web page development. I think this is basically enough, however, in actual work, you must consider the division of labor. That is to say, we should separate programmers from the work of art. programmers should focus on bussinesslogic, and artists should be responsible for page design, however, the results after logical processing should be displayed on the page, which involves how to tell the processing result to HTML. In principle, HTML processed with PHP can be directly embedded into PHP code. We only need to put the code for logic processing in a single file. html contains this file, the output result is complete. However, people are always very smart and have long seen this problem. As a result, many people have come up with the Web MVC Architecture and many MVC frameworks support PHP. As long as you use a framework, you need to be familiar with this framework, which undoubtedly increases the learning cost. The following are some of the frameworks I have seen.
Template framework smarty: of course there are other template frameworks, and there are many smarty users. Download an actual example: ecshop is based on smarty, and bblog is based on smarty. Smarty itself is complicated, but for us there are several common functions. Smarty provides a template language that allows HTML designers to use PHP to process results without understanding PHP. It defines a set of tags, as long as you use tags embedded with smarty in HTML, you don't need to embed PHP code. This makes it easy for HTML designers to master several tags without learning PHP.
However, after the smarty tag is embedded in HTML, HTML designers who open HTML in development tools such as dreamwaver (DW) seem to be a mess and violate the WYSIWYG principle, in this case, you can download a smarty plug-in of DW to partially solve this problem.
In addition to this annoying problem, smarty also has many advantages, such as automatic page Cache Management, custom display templates, and security to prevent embedded tags from harming the entire program; the speed is also said to be quite fast, and it is not much inferior to using PHP directly.
The disadvantage of smarty is that, as a template framework, we need to follow its rules during development. When writing logic, we need to keep assign, assign, and assign, but this is also clear, we can also draw. The conclusion is: the template framework smarty is worth choosing.
But there are also other options. It is very interesting to have a taste of the following two articles:
Beyond the template engine, PHP resource template-template Terminator
PHP also has other Web architectures such as phpmvc, zendframework, and fleaphp. These frameworks are only one way to achieve the goal. I think it is best not to use a framework. The characteristics of PHP itself are brisk, PHP + has enough ways to display templates. Isn't it better to do the work in the simplest and clearer way?
It is worth noting that the absence of frameworks is not equivalent to the absence of code libraries, and the role of mature PHP code libraries cannot be denied. This is called Pear (PhP extension and application repository in PHP: PHP extension and application library), refer to "using pear to accelerate PHP program development".
4.4. Conclusion
Finally, it is concluded that PHP is the first choice for web development. The existing MVC framework is not used for development, and PHP + display templates are used to quickly and cleanly develop applications.
5. Summary
I have compared several common web programming languages. The analysis is based on my own needs. Maybe it can represent some of my friends.
It is used in the development of independent information products, or other products (such as hardware equipment) auxiliary software products.
We hope to discuss different technologies for different applications.
========================================================== ========
On the winter solstice, my friends remember to eat dumplings. "On the winter solstice, the dumplings are not good. No one cares if your ears are frozen "!!!