框架VS自已!!想问一下自已写程序运行效率是不是没有框架高?
框架VS自已!!想问一下自已写程序运行效率是不是没有框架高?
我看到好多人提到框架,为什么要用框架?就是为了开发速度快?
如果排除开发速度,协同原因,那自已写原生态代码运行效率上就没有框架的高吗?
困扰很久,不知是用框架还是不用框?观摩中国知名的CMS有那几个用ZD,YII,TP 等主流框架的,好象没有?
希望能解一个凝惑,(千万不要跟我说开发速度快协同好原因)
回复讨论(解决方案)
运行速度:
每个语句的执行都是要花费时间的
被执行的代码越少,速度越快!这是浅显的道理
框架有其固定套路,代码量一定比原生的多
运行效率:
对于常见功能,框架多做了优化处理
如果你的水平低于框架开发者,那就不好说了
适用范围:
原生态代码适合于小量、需求多变的场合
框架适用于批量、需求相对不变的场合
框架还有一个好处就是便于后期维护!(规则被定死了)
原生态的万一程序员走了(其实国内很多程序员的编写规范都不是很好),维护起来很麻烦!
是不是可以这样理解运行的代码越少效率就越高呢
任何语言当然是越少执行效率越高了。框架的作用只是将程序和页面等进行分层,提供单一入口,提供基本函数和方法以及一些公用类库,但程序功能还是需要自行编码实现的。往往,框架中的很多类库可能根本用不到或者不适用,还需要进一步改造。框架只是提供了一种开发的遍历,如果给你打好了房基,你只需要在这个基础上开始盖房子就好了。
自已写,成本比较高,用别人的框架,可以加快开发的进度,但同时也带来一定的风险,主要是安全问题
自已写,成本比较高,用别人的框架,可以加快开发的进度,但同时也带来一定的风险,主要是安全问题 你自己写的原生代码比别人的框架安全性更高吗?
如果主流框架不适合自己的需求,并且自己做的是小项目那就可以自己写框架的,这样可以避免很多不必要的代码,关注与自己的项目功能就行了
自已写,成本比较高,用别人的框架,可以加快开发的进度,但同时也带来一定的风险,主要是安全问题 你自己写的原生代码比别人的框架安全性更高吗?
框架的安全问题多主要是因为它是开放的,攻击者往往可以看到源码.而自己写的代码因为没有足够的测试可能漏洞更多一点,但是因为它不对外开放的原因,漏洞被发现的机会要小得多.(注:半吊子程序员写的包含常识性错误的代码除外)
。。。。。。。。。。。。。。。。。。这个主题的生命力真长久
如何最快的建网站,一般般的就行,现在连入门都没有机会
谢谢!各位的回答!那我还是决定用YII框架,网上说这个框架效率很高,是不是有这么一回事呢

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Laravel simplifies handling temporary session data using its intuitive flash methods. This is perfect for displaying brief messages, alerts, or notifications within your application. Data persists only for the subsequent request by default: $request-

The PHP Client URL (cURL) extension is a powerful tool for developers, enabling seamless interaction with remote servers and REST APIs. By leveraging libcurl, a well-respected multi-protocol file transfer library, PHP cURL facilitates efficient execution of various network protocols, including HTTP, HTTPS, and FTP. This extension offers granular control over HTTP requests, supports multiple concurrent operations, and provides built-in security features.

Laravel provides concise HTTP response simulation syntax, simplifying HTTP interaction testing. This approach significantly reduces code redundancy while making your test simulation more intuitive. The basic implementation provides a variety of response type shortcuts: use Illuminate\Support\Facades\Http; Http::fake([ 'google.com' => 'Hello World', 'github.com' => ['foo' => 'bar'], 'forge.laravel.com' =>

Do you want to provide real-time, instant solutions to your customers' most pressing problems? Live chat lets you have real-time conversations with customers and resolve their problems instantly. It allows you to provide faster service to your custom

Article discusses late static binding (LSB) in PHP, introduced in PHP 5.3, allowing runtime resolution of static method calls for more flexible inheritance.Main issue: LSB vs. traditional polymorphism; LSB's practical applications and potential perfo

PHP logging is essential for monitoring and debugging web applications, as well as capturing critical events, errors, and runtime behavior. It provides valuable insights into system performance, helps identify issues, and supports faster troubleshoot

Laravel simplifies HTTP verb handling in incoming requests, streamlining diverse operation management within your applications. The method() and isMethod() methods efficiently identify and validate request types. This feature is crucial for building

The Storage::download method of the Laravel framework provides a concise API for safely handling file downloads while managing abstractions of file storage. Here is an example of using Storage::download() in the example controller:
