当前位置: 首页 > news >正文

Why NO to: MySQL, Symfony, CakePHP, Smarty, etc.

为什么80%的码农都做不了架构师?>>>   hot3.png

open solution

很有趣的观点,虽然都让say no,不过感觉被安利到了很多。


Why "NO" to: MySQL, Symfony, CakePHP, Smarty, jQuery, Bootstrap, etc

This article wasn't written just to look for good and bad sides of specific technological and programming solutions. Its point is to show philosophy Quick.Cart and Quick.Cms creators are guided by when choosing certain solutions over other.

这篇文章不是为找出这些技术好的或坏的一面。选择固定的解决手段也同时带来了限制。

This article is for those readers, who have at least the basic knowledge of webdesign. If you want to create a website or an online shop for yourself, your company, or maybe your friends, you should read it.

Our "NO" to MySQL | 拒绝MySQL

Lack of MySQL database is one of characteristics of our scripts. We're not against this technology, but a couple of years ago our enthusiasm was in fact bigger.

我们并不反对这项技术,但是多年前我们拥有更多的热情。

Our scripts are based on a file database, which makes them easier to manage. They don't require a database server, which allows them to work on wider range of servers including these on which MySQL is not available.

我们的脚本基于文件系统,更易管理。它们并不要求一个数据库服务器,同时在不支持MySQL的服务器上也能很好运作。

Installation and configuration of database is not necessary, because it's located in files included in the script and usually uploading script on the server is all it takes to make it work.

Lack of SQL database is also a kind of protection against popular SQL injection attacks, to which a script could be vulnerable if an unqualified person modified it.

The last argument is performance. Lack of MySQL database saves time that would be used to connect to the database and execute queries. In case of Quick.Cms and Quick.Cart, the database files are located on the server with the scripts what makes accessing them much faster.

Example of database connectionExample of a database connection

Our "NO" to frameworks (Zend, Symfony, etc.) | 拒绝框架

As PHP based internet applications programming developed, all kinds of frameworks emerged, that help automatically solve the most common problems with code maintenance, database, etc. Among the most popular are Zend Framework, Symfony, CakePHP, Kohana, CodeIgniter. There are also frameworks developed for the needs of specific companies and projects. Such frameworks are often very useful, mostly free, but actively developed and have good support. They also have their flaws which can be quite significant.

It takes a lot of time to master a framework. Usually the most popular ones include built in mechanisms and functions that help to start working with them and don't require writing instructions for all from scratch. This however makes them often very complicated and it takes a lot of time to learn them. A person who creates new applications all the time could (and should) use them, but if it's just a one time deal or one's programming knowledge isn't very good, it doesn't always pay off. Unfortunately, even though there are many similarities, mastering one framework doesn't necessarily mean it would be easy to start using another. Each one has its own philosophy of working. Sometimes a difficult configuration may stop us from learning one framework and the truth is, that to choose one that would suit your needs, you need to test at least several.

And the size of it! Download a few frameworks to see that even the basic versions are quite large scripts (several to over a dozen MB). When a project is small, the large number of files and code makes it look like taking a sledgehammer to crack a nut. Then you have to consider performance, improvement of which should be the base reason for using frameworks, but it not always is.

And finally we should mention, that this kind of tools are useful for those who create diverse internet applications, because they are usually the base and not a ready-made software. If you develop websites, it's better to use a CMS which is made specifically for that.

Example of Symfony framwork codeExample of Symfony framework code

Our "NO" to templates (Smarty, Twig, etc.) | 拒绝模板

It's not about templates as in skins - just graphics. Smarts are probably the most popular template system. There are other more or less developed templates such as: Twig, Plates and PHPTAL. Just as it was with frameworks, small projects often emerge developing their own template system. Usually they are short-lived.

The idea behind templates it to separate the programming layer from the presentation layer. That's why a website based on templates in theory allows to change HTML structure without even knowing PHP. It sounds wonderful, but it also has it's flaws. Unfortunately HTML code included in templates requires for example attaching contents from database, sometimes creating a new loop known from programming (for example to display a list). It means, that a person who wants to work with templates, must know how they work, which is something like programming. In other words, using for example Smarts, means learning another language, that they use. You can do the same with PHP itself. In case of large projects using templates may be efficient and sometimes necessary, but for smaller projects it's often pointless to add another library (which itself isn't small) and complicate the project's structure.

The above issues make more and more programmers reconsider using templates and going back to pure PHP. This tendency is even shown in the template systems itself. A few of those were developed, that look more like pure PHP than what we know from Smarts, for example.

Quick.Cms and Quick.Cart used to work on custom made template system. But on one point we gave it up to increase performance and to avoid creating more obstacles for first time users. This way they don't have to learn templates, HTML/PHP knowledge is enough.

Pure PHP code and its Smarty template versionPure PHP code and its Smarty template version

Our "NO" to jQuery | 拒绝jQeury

jQuery is a JavaScript library. It helps to write efficient scripts faster, simplifies the code and offers many ready-made functions. But as usual it's a trade-off. The library itself is growing. Optimization and code compression are very good, still jQuery increases website's code size by about 80 KB (first versions were only about a dozen KB). Also, often to use more advanced functions, additional plugins - extensions of the library are required. That is why jQuery with other additional scripts can often significantly increase website's size. If the library's functionalities are used a lot, it does make sense, but often a webmaster could manage without it writing his/her own JavaScript code. That code will be more efficient (if written the right way) and in case of small amount of functions, smaller than the library.

This is how Quick.Cms and Quick.Cart are for the moment. Basic versions don't use jQuery, because custom JS functions are sufficient. However jQuery is required more and more often and attached to some plugins. In the internet one could also observe a trend to create interactive elements on the browser's end. It's quite possible, that jQuery will sooner or later become a permanent part of even the simplest scripts.

Example of jQuery codeExample of jQuery code

Our "NO" to Bootstrap | 拒绝 Bootstrap

It's another interesting framework concerning only Front-End. It has many ready-made components for building websites on the end visible in a browser, for example: forms, menus, tables, etc. It is also helpful in preparing responsive version of websites, among others.

It's a very interesting solution, but unfortunately it includes plenty of redundant code which isn't always necessary when creating a small website. On the other hand trimming it doesn't make sense as well. If you're using a library, why limit its possibilities? To use Bootstrap even in the basic version, we must add over 100 KB of code (at minimum) not counting fonts or required jQuery. Comparing it with even the largest Quick.Cart.Ext script, JavaScript and CSS code necessary for the part visible on client-side is about 40 KB. The free edition Quick.Cms requires 14 KB of this code. Of course we can not state, that it is functionally equivalent. The question is, do we need all those functions if we're not using them?

Example of Bootstrap componentsExample of Bootstrap components

Summary

People visiting your website most likely won't even recognize what technologies stand behind it. For a visitor it's just another website he or she is browsing on the internet. The most important thing is to achieve the goal for which the person visiting your website came to see it. Too much code to be loaded or too much time it takes for the page to load due to redundant code that needs to be processed by the server or the browser and which you're not using anyway, may prevent them from that. For you, as the website's owner, it is important to make the website friendly and easy to use and not requiring going through all those complicated technologies and scripts, each of which takes time you could spend on something else.

You can see the difference yourself, check out the performance tests of our scripts ».

Our scripts' performanceOur scripts' performance


Why

Why "NO" to: SQL, Symfony, CakePHP, Smarty, jQuery, Bootstrap, etc

"NO" to: MySQL, Symfony, CakePHP, Smarty, jQuery, Bootstrap, etc


转载于:https://my.oschina.net/sikou/blog/520721

相关文章:

  • grub引导程序
  • 不使用(a+b)/2这种方式,求两个数的平均值
  • 可以动态添加图片的轮播插件
  • nginx rewrite模块探究与实验
  • SpringMVC(六):Spring 整合quartz作业调度框架
  • ecshop中那些有意思的代码
  • 查看死锁原因 /data/anr/traces.txt
  • 如何删除 SQL Server 表中的重复行
  • Android 不通过USB数据线调试的方法
  • Android网络开发之OkHttp--基本用法GET
  • 查看Android应用包名package和入口activity名称
  • ueditor 最新版本【1.4.3.1】单独文件/图片上传处理方法
  • 【原创】sizeof运算符总结
  • Android客户端性能测试常见指标及测试方法--转载
  • composer 报错笔记
  • [微信小程序] 使用ES6特性Class后出现编译异常
  • 「前端早读君006」移动开发必备:那些玩转H5的小技巧
  • 【140天】尚学堂高淇Java300集视频精华笔记(86-87)
  • 【Leetcode】104. 二叉树的最大深度
  • android高仿小视频、应用锁、3种存储库、QQ小红点动画、仿支付宝图表等源码...
  • Apache的基本使用
  • HTTP中的ETag在移动客户端的应用
  • js操作时间(持续更新)
  • MySQL主从复制读写分离及奇怪的问题
  • vue.js框架原理浅析
  • 函数式编程与面向对象编程[4]:Scala的类型关联Type Alias
  • 前端之Sass/Scss实战笔记
  • 如何实现 font-size 的响应式
  • 思维导图—你不知道的JavaScript中卷
  • 原创:新手布局福音!微信小程序使用flex的一些基础样式属性(一)
  • 做一名精致的JavaScripter 01:JavaScript简介
  • 支付宝花15年解决的这个问题,顶得上做出十个支付宝 ...
  • ​​​​​​​sokit v1.3抓手机应用socket数据包: Socket是传输控制层协议,WebSocket是应用层协议。
  • ​Base64转换成图片,android studio build乱码,找不到okio.ByteString接腾讯人脸识别
  • ​io --- 处理流的核心工具​
  • ​queue --- 一个同步的队列类​
  • ​Z时代时尚SUV新宠:起亚赛图斯值不值得年轻人买?
  • ​渐进式Web应用PWA的未来
  • ​软考-高级-系统架构设计师教程(清华第2版)【第20章 系统架构设计师论文写作要点(P717~728)-思维导图】​
  • #我与Java虚拟机的故事#连载18:JAVA成长之路
  • $.ajax()参数及用法
  • %3cscript放入php,跟bWAPP学WEB安全(PHP代码)--XSS跨站脚本攻击
  • (iPhone/iPad开发)在UIWebView中自定义菜单栏
  • (pojstep1.3.1)1017(构造法模拟)
  • (附源码)spring boot车辆管理系统 毕业设计 031034
  • (附源码)springboot学生选课系统 毕业设计 612555
  • (学习日记)2024.01.19
  • *Django中的Ajax 纯js的书写样式1
  • .Family_物联网
  • .halo勒索病毒解密方法|勒索病毒解决|勒索病毒恢复|数据库修复
  • .NET Framework 的 bug?try-catch-when 中如果 when 语句抛出异常,程序将彻底崩溃
  • .Net各种迷惑命名解释
  • .NET开发者必备的11款免费工具
  • .project文件
  • /*在DataTable中更新、删除数据*/