Table of Contents
回复讨论(解决方案)
Home Backend Development PHP Tutorial 求PHP大牛指导提高

求PHP大牛指导提高

Jun 23, 2016 pm 02:16 PM

PHP 编程 面向对象 程序员

今天参加了一个Coding Dojo(编程道场),之后自己有一些疑惑,希望大牛能够给予指导。
我是个PHPer,现在在一家电商公司,目前是一个大牛和我一个程序员,我们用ThinkPHP框架,每次做功能的时候都感觉自己做得挺多,但是做完后却各种发现自己做的东西没有技术含量,没有用到面向对象思想,也没有用到设计模式,只是一些逻辑上的设计和解决问题,现在不知道自己该怎样在PHP方面有所提高,我是不是应该有意识地多写一些面向对象思想的程序呢?我之后应该如何提高自己,希望PHP大牛能够不吝赐教,小弟感激不尽~

回复讨论(解决方案)

我现在的状态跟你描述的差不过 我提供个思路:抽时间把现在项目按照面向对象的思路重新写一遍(抛开TP框架),从底层架构开始能做多少做多少  我觉得这样一定可以有所提高.

当你在做问答题时,才有可能发挥自己的想象
而使用框架只不过是在做填空题

但“没有用到面向对象思想”是不对的,你完成的正是对象的某些方法的具体实现

在框架的基础上,思考你是怎么依赖框架的,也就是说你为什么可以用框架这么做?

例如每次写业务逻辑你都是写一个controlle和action,然后就可以通过url来进行访问,有没有思考过从url请求到action中都经过了些什么逻辑处理?能否把这些逻辑理清楚呢?能否认识到这些逻辑之间是怎么样相互交互的?

多提出一些自己理所当然的知道一些事的真正原因是什么?慢慢的才会提高,也就是不仅知其然还要知其所以然。

小刀砍大树这句话常说吧,现在如果有电锯,还拿小刀去砍大树的人真是笨死了
但电锯是怎么把大树砍倒切割的,其原理还是要从小刀上理解??纵向发力叫做切、砍,横向发力叫做锯
纵向力费力,横向力省力,横向锯的次数与木头厚度成正比,而频率(就是次数/时间)跟发力(能量)有关
所以加入电力提高锯的频率(单位时间的次数)达到省时省力的目的

拿着电锯(工具,框架)确实能提高工作效率,以此累积的工作经验却是在这个工具上的,例如怎样握着电锯不容易脱手……
但想理解工作原理却是难事,最终还是要拿小刀来理解到底是怎样把木头切开的
如果只懂用电锯,去到一个新的木场没有电怎么办??

如果把解决问题建立在某个工具而不用考究它的原理,那必须确保你以后遇到该问题身边都有这个工具
例如宅人,打算一辈子不离开城市,那他只需要知道路牌这个工具就行,不需要懂什么迷路看星星/指南针辨认方向的知识(唉,现在的城市能看见星星也不容易);但如果想到处游历,又不确定去到一个新地方有没有路牌这东西,还是从低层次掌握基础知识比较好

如果你想学习提高理论技能,还是把手上的“高级的、优秀的”工具抛开吧
不确定一定能有混凝土预制件的话,还是学学怎么和稀泥的好

反正几十年来我没听说过巴西、朝鲜、伊拉克的球员会抱怨场地不好、草地绊脚的

小刀砍大树这句话常说吧,现在如果有电锯,还拿小刀去砍大树的人真是笨死了
但电锯是怎么把大树砍倒切割的,其原理还是要从小刀上理解??纵向发力叫做切、砍,横向发力叫做锯
纵向力费力,横向力省力,横向锯的次数与木头厚度成正比,而频率(就是次数/时间)跟发力(能量)有关
所以加入电力提高锯的频率(单位时间的次数)达到省时省力的目的

拿着电锯(工具,框架)确实能提高工作效率,以此累积的工作经验却是在这个工具上的,例如怎样握着电锯不容易脱手……
但想理解工作原理却是难事,最终还是要拿小刀来理解到底是怎样把木头切开的
如果只懂用电锯,去到一个新的木场没有电怎么办??

如果把解决问题建立在某个工具而不用考究它的原理,那必须确保你以后遇到该问题身边都有这个工具
例如宅人,打算一辈子不离开城市,那他只需要知道路牌这个工具就行,不需要懂什么迷路看星星/指南针辨认方向的知识(唉,现在的城市能看见星星也不容易);但如果想到处游历,又不确定去到一个新地方有没有路牌这东西,还是从低层次掌握基础知识比较好

如果你想学习提高理论技能,还是把手上的“高级的、优秀的”工具抛开吧
不确定一定能有混凝土预制件的话,还是学学怎么和稀泥的好

反正几十年来我没听说过巴西、朝鲜、伊拉克的球员会抱怨场地不好、草地绊脚的
这比喻。。。。。

了解底层,然后自己写框架

我以前跟楼主类似,
为解决这两个问题,
我主要采用2个方法,
1,再学一次c++

2,自己写了一个框架,并把自己的博客用自己的框架不断完善

希望楼主能够得到满意的答案

多写是当然的,可以去尝试一下其他框架和cms。

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Explain JSON Web Tokens (JWT) and their use case in PHP APIs. Explain JSON Web Tokens (JWT) and their use case in PHP APIs. Apr 05, 2025 am 12:04 AM

JWT is an open standard based on JSON, used to securely transmit information between parties, mainly for identity authentication and information exchange. 1. JWT consists of three parts: Header, Payload and Signature. 2. The working principle of JWT includes three steps: generating JWT, verifying JWT and parsing Payload. 3. When using JWT for authentication in PHP, JWT can be generated and verified, and user role and permission information can be included in advanced usage. 4. Common errors include signature verification failure, token expiration, and payload oversized. Debugging skills include using debugging tools and logging. 5. Performance optimization and best practices include using appropriate signature algorithms, setting validity periods reasonably,

How does session hijacking work and how can you mitigate it in PHP? How does session hijacking work and how can you mitigate it in PHP? Apr 06, 2025 am 12:02 AM

Session hijacking can be achieved through the following steps: 1. Obtain the session ID, 2. Use the session ID, 3. Keep the session active. The methods to prevent session hijacking in PHP include: 1. Use the session_regenerate_id() function to regenerate the session ID, 2. Store session data through the database, 3. Ensure that all session data is transmitted through HTTPS.

Describe the SOLID principles and how they apply to PHP development. Describe the SOLID principles and how they apply to PHP development. Apr 03, 2025 am 12:04 AM

The application of SOLID principle in PHP development includes: 1. Single responsibility principle (SRP): Each class is responsible for only one function. 2. Open and close principle (OCP): Changes are achieved through extension rather than modification. 3. Lisch's Substitution Principle (LSP): Subclasses can replace base classes without affecting program accuracy. 4. Interface isolation principle (ISP): Use fine-grained interfaces to avoid dependencies and unused methods. 5. Dependency inversion principle (DIP): High and low-level modules rely on abstraction and are implemented through dependency injection.

How to automatically set permissions of unixsocket after system restart? How to automatically set permissions of unixsocket after system restart? Mar 31, 2025 pm 11:54 PM

How to automatically set the permissions of unixsocket after the system restarts. Every time the system restarts, we need to execute the following command to modify the permissions of unixsocket: sudo...

How to debug CLI mode in PHPStorm? How to debug CLI mode in PHPStorm? Apr 01, 2025 pm 02:57 PM

How to debug CLI mode in PHPStorm? When developing with PHPStorm, sometimes we need to debug PHP in command line interface (CLI) mode...

Explain late static binding in PHP (static::). Explain late static binding in PHP (static::). Apr 03, 2025 am 12:04 AM

Static binding (static::) implements late static binding (LSB) in PHP, allowing calling classes to be referenced in static contexts rather than defining classes. 1) The parsing process is performed at runtime, 2) Look up the call class in the inheritance relationship, 3) It may bring performance overhead.

How to send a POST request containing JSON data using PHP's cURL library? How to send a POST request containing JSON data using PHP's cURL library? Apr 01, 2025 pm 03:12 PM

Sending JSON data using PHP's cURL library In PHP development, it is often necessary to interact with external APIs. One of the common ways is to use cURL library to send POST�...

See all articles