search
HomeBackend DevelopmentPHP Tutorial求PHP大牛指导提高

PHP 编程 面向对象 程序员

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

回复讨论(解决方案)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Statement
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
The Continued Use of PHP: Reasons for Its EnduranceThe Continued Use of PHP: Reasons for Its EnduranceApr 19, 2025 am 12:23 AM

What’s still popular is the ease of use, flexibility and a strong ecosystem. 1) Ease of use and simple syntax make it the first choice for beginners. 2) Closely integrated with web development, excellent interaction with HTTP requests and database. 3) The huge ecosystem provides a wealth of tools and libraries. 4) Active community and open source nature adapts them to new needs and technology trends.

PHP and Python: Exploring Their Similarities and DifferencesPHP and Python: Exploring Their Similarities and DifferencesApr 19, 2025 am 12:21 AM

PHP and Python are both high-level programming languages ​​that are widely used in web development, data processing and automation tasks. 1.PHP is often used to build dynamic websites and content management systems, while Python is often used to build web frameworks and data science. 2.PHP uses echo to output content, Python uses print. 3. Both support object-oriented programming, but the syntax and keywords are different. 4. PHP supports weak type conversion, while Python is more stringent. 5. PHP performance optimization includes using OPcache and asynchronous programming, while Python uses cProfile and asynchronous programming.

PHP and Python: Different Paradigms ExplainedPHP and Python: Different Paradigms ExplainedApr 18, 2025 am 12:26 AM

PHP is mainly procedural programming, but also supports object-oriented programming (OOP); Python supports a variety of paradigms, including OOP, functional and procedural programming. PHP is suitable for web development, and Python is suitable for a variety of applications such as data analysis and machine learning.

PHP and Python: A Deep Dive into Their HistoryPHP and Python: A Deep Dive into Their HistoryApr 18, 2025 am 12:25 AM

PHP originated in 1994 and was developed by RasmusLerdorf. It was originally used to track website visitors and gradually evolved into a server-side scripting language and was widely used in web development. Python was developed by Guidovan Rossum in the late 1980s and was first released in 1991. It emphasizes code readability and simplicity, and is suitable for scientific computing, data analysis and other fields.

Choosing Between PHP and Python: A GuideChoosing Between PHP and Python: A GuideApr 18, 2025 am 12:24 AM

PHP is suitable for web development and rapid prototyping, and Python is suitable for data science and machine learning. 1.PHP is used for dynamic web development, with simple syntax and suitable for rapid development. 2. Python has concise syntax, is suitable for multiple fields, and has a strong library ecosystem.

PHP and Frameworks: Modernizing the LanguagePHP and Frameworks: Modernizing the LanguageApr 18, 2025 am 12:14 AM

PHP remains important in the modernization process because it supports a large number of websites and applications and adapts to development needs through frameworks. 1.PHP7 improves performance and introduces new features. 2. Modern frameworks such as Laravel, Symfony and CodeIgniter simplify development and improve code quality. 3. Performance optimization and best practices further improve application efficiency.

PHP's Impact: Web Development and BeyondPHP's Impact: Web Development and BeyondApr 18, 2025 am 12:10 AM

PHPhassignificantlyimpactedwebdevelopmentandextendsbeyondit.1)ItpowersmajorplatformslikeWordPressandexcelsindatabaseinteractions.2)PHP'sadaptabilityallowsittoscaleforlargeapplicationsusingframeworkslikeLaravel.3)Beyondweb,PHPisusedincommand-linescrip

How does PHP type hinting work, including scalar types, return types, union types, and nullable types?How does PHP type hinting work, including scalar types, return types, union types, and nullable types?Apr 17, 2025 am 12:25 AM

PHP type prompts to improve code quality and readability. 1) Scalar type tips: Since PHP7.0, basic data types are allowed to be specified in function parameters, such as int, float, etc. 2) Return type prompt: Ensure the consistency of the function return value type. 3) Union type prompt: Since PHP8.0, multiple types are allowed to be specified in function parameters or return values. 4) Nullable type prompt: Allows to include null values ​​and handle functions that may return null values.

See all articles

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

DVWA

DVWA

Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool