不使用 PHP 框架的原因? [已关闭]

问题描述 投票:0回答:2

我一直使用框架(Agile Toolkit)开发网络软件,它在所有情况下对我都有帮助,但有一个问题始终困扰着我:

什么情况下不建议使用框架?

所以向其他资深框架开发人员提出一个问题 - 您什么时候会使用

raw good PHP
而不是您选择的框架进行编码?

php frameworks atk4
2个回答
78
投票

人们建议不要使用框架的原因有很多。

  • 通过自己编写,您会学到很多东西。我一直在自己工作,学到了很多以前不知道的关于 PHP 的不同知识。总的来说,这是一次很棒的学习经历,可以在面试或简历中使用。它表明您对这门语言非常感兴趣,最重要的是它背后的理论,而不仅仅是盲目的实现。
  • 框架中有很多你不需要的东西,通过制作你自己的框架,你只能得到你想要的东西。该框架是根据您自己的需求专门定制的。我不喜欢任何框架如何处理模板,这是我制作自己的模板的最大触发因素。
  • 另外,我对此并不确定,但从逻辑上思考......您自己的框架,仅根据您的需求量身定制,将比任何其他框架快得多。考虑其他框架在加载时必须执行的所有设置以及涉及的数据库查询。您可以节省所有负载。
  • 如果您要制作一个不需要扩展的小项目,例如一个简单的投资组合网站,那么框架只会带来不必要的工作。

这里还有一篇非常好的文章,介绍了其他细节。本文的作者首先讲述了他如何一直是框架的大力支持者。

http://jpst.it/jiYX

除非我开始做一些自由职业,否则我总是会努力创建自己的框架。我不断更新我的框架并学习越来越多的东西。你永远不会听到任何人说绝对使用或绝对不使用框架,因为这完全取决于使用。

编辑:程序员网站上也有一个关于此的问题:https://softwareengineering.stackexchange.com/questions/49488/when-not-to-use-a-framework

编辑#2:最后一篇关于为什么不需要框架的文章:http://www.amberweinberg.com/you-dont-need-a-framework-if-you-have-a-good-developer/


7
投票

首先阅读为什么使用 PHP 框架以及 然后决定为什么不使用 PHP 框架

为什么要使用 PHP 框架?

为什么我需要使用流行的框架?

PHP 框架(cake/smarty):如何使用以及何时使用?

# File Name: adf-ci-option-2-build-pipeline.yml
# Purpose: Build pipeline for the development Azure Data Factory 
#           Automatically triggered on completion of a pull request and merge to main branch
#           Validates the Data Factory resources 
#           Generates the ARM template and publishes for consumption via Release pipeline
# Build Pipeline Name: ADF CI Option 2 Build Pipeline

trigger:
- main

pool:
  vmImage: ubuntu-latest

variables:
  subscriptionId: ''  # Use your subscription ID
  resourceGroup: ''                      # Use the resource group for the development data factory
  dataFactory: ''                       # Use your development data factory name
  PackageFolder: ''                                  # Use the GIT folder under which you have the package files
  adfRootFolder: ''                                       # Use the GIT folder under which you have the ADF resources. If it's root leave as blank

steps:

# Installs Node 
- task: NodeTool@0
  inputs:
    versionSpec: '14.x'
  displayName: 'Install Node.js'

# Installs the npm packages saved in your package.json file in the build
- task: Npm@1
  inputs:
    command: 'install'
    workingDir: '$(Build.Repository.LocalPath)/$(packageFolder)' #replace with the package.json folder
    verbose: true
  displayName: 'Install npm packages'

# Validates all of the Data Factory resources in the repository. You'll get the same validation errors as when "Validate All" is selected.
- task: Npm@1
  inputs:
    command: 'custom'
    workingDir: '$(Build.Repository.LocalPath)/build' #replace with the package.json folder
    customCommand: 'run build validate $(Build.Repository.LocalPath)/$(adfRootFolder) /subscriptions/$(subscriptionId)/resourceGroups/$(resourceGroup)/providers/Microsoft.DataFactory/factories/$(dataFactory)'
  displayName: 'Validate Data Factory Resources'

# Generate the ARM template into the destination folder, which is the same as selecting "Publish" from the UX.
- task: Npm@1
  inputs:
    command: 'custom'
    workingDir: '$(Build.Repository.LocalPath)/build' #replace with the package.json folder
    customCommand: 'run build export $(Build.Repository.LocalPath)/$(adfRootFolder) /subscriptions/$(subscriptionId)/resourceGroups/$(resourceGroup)/providers/Microsoft.DataFactory/factories/$(dataFactory) "ArmTemplate"'
  displayName: 'Generate ARM template'

# Publish the artifact to be used as a source for a release pipeline.
- task: PublishPipelineArtifact@1
  inputs:
    targetPath: '$(Build.Repository.LocalPath)/$(packageFolder)/ArmTemplate' #replace with the package.json folder
    artifact: 'ArmTemplates'
    publishLocation: 'pipeline'
  displayName: 'Publish ARM tempate'
© www.soinside.com 2019 - 2024. All rights reserved.