一 初始code,便是C++
做技术有几年,从最初认识C++,写一个“Hello World”,到能写一个简单的函数。后来自学PHP,慢慢写第一个自己的Blog,后来接触各类MVC框架(Laravel、Yii、ThinkPHP等),一路走来磕磕碰碰,幸好,技术因为开源所以才让人狂热。
#include<stdio.h>#include<iostream>using namespace std;int main() { cout << "Hello World!" << endl; return 0;}
或许大家都是如此,从给这个世界打招呼开始,慢慢进入到一个充满魔幻和陷阱的码农世界。c++是我初始的编程语言,教学用的是坑害了很多朋友的严蔚敏老师所著清华大学出版的错误百出的教程。虽然错误很多,但我依然很喜欢,可能源于我对黑客世界的好奇,想着有那么一天也许自己能像电影中的Hacker一样,瞬间就能入侵某些机构或组织的计算机,盗取一些机密文件之类的,当然,这是开玩笑,但确实是很好奇。
二 为什么默默的选择了java
学习c++算是一个开始,我不知道我们学校当时为何这么安排,写了一年的c++之后,我对编程的兴趣不那么强烈了,因为我所写的代码,只能是在windows的命令窗口运行,没有色彩,完全不知道自己写这些在干什么。
后面学习数据结构,这门课程,用的是C语言教的,古人云,师傅领进门,修行靠个人,数据结构老师讲的很仔细,但我听得云里雾里,无奈,只好一遍一遍的把书上的代码敲出来演示,那时候,确实没有理解为什么要那么写。
数据结构和算法是最神奇的学问,对我而言如此。买了很多的资料,花了很多的时间,慢慢发现,原来并不是那么难,只是自己没有想到如何把抽象的问题具体化。每一种抽象的数据,只要能和现实生活中的某些场景对应上,或者能够在纸片上画出这种结构,那么实现起来并不难了。
当J2EE遇到我的时候,我已经学完了java的基础知识,相较于C++,我发现自己更喜欢java,虽然c++和java都是OOP,但是java理解起来不那么难,java的类,看上去代码层次更明确。这种清晰的代码设计,在我以后的学习中,给了我很大的帮助。
/*** 第一个类*/class FirstClass { private String hello; public void setHello(String hello) { this.hello = hello; } public String getHello () { return this.hello; } public static void main(String[] args) { FirstClass firstClass = new FirstClass(); // 创建firstClass的实例 firstClass.setHello("Hello World!"); System.out.println(firstClass.getHello()); }}
在人生的道路上,一切都不可预测。java的世界很庞大,光是SSH(Struct+Spring+Hibernate)框架就学习了大半年,然而,学到的仅仅是皮毛,或许,做一个简单的web站点很easy,一旦遇到复杂的业务和逻辑,确实不能很容易的拿下。
说起J2EE,我深受益处的便是DI,这在后来学习PHP的框架的时候起到了很大的作用。所以,语言是相同的,这句话一点也不假,至少在我目前的水平来说如此。
三 PHP不是拍黄片
在某一档相亲节目中,问男嘉宾是干什么的,男嘉宾很诚实的回答说:“搞php的。”瞬间全场灯光熄灭,主持人问一个女嘉宾,为什么要灭灯,女嘉宾说php就是拍黄片(貌似女嘉宾知道的很多啊)。
echo 'PHP不是拍黄片!';
呃,本应该是这样开场的:
echo 'Hello World!';
戏谑一番,玩笑一番。php的学习成本要比java低很多,一开始我是拒绝学习它的。只因为有一个人要做一个网站,卖点一些杂七杂八的东西,想想觉得jsp就可以做了,但是那人说要WordPress来做。好吧,没用过,就开始尝试吧。
于是,我的php之路就这样开始了,学习php的一些基础知识,在w3school.com和php.net上看php的api,先写了一个简单的网站,是交友社区,当时美其名曰“杏林之恋”(www.xllian.com,原来的网站,现在没有维护,已经关闭了)。
学习技术很享受其过程。
2016-5-5 17:59:33发布
后续补充。
nodejs真的很牛逼
专栏后续写:
-
php知识总结
-
面试题归纳
-
java的知识总结
-
SSH框架
-
spring MVC
-
springmvc + mybatis
-
基于dubbo的SOA服务
-
kafka + zookeeper
-
nodejs学习总结
-
翻译文件
2016-5-6 08:55:18 更新

PHP and Python each have their own advantages, and the choice should be based on project requirements. 1.PHP is suitable for web development, with simple syntax and high execution efficiency. 2. Python is suitable for data science and machine learning, with concise syntax and rich libraries.

PHP is not dying, but constantly adapting and evolving. 1) PHP has undergone multiple version iterations since 1994 to adapt to new technology trends. 2) It is currently widely used in e-commerce, content management systems and other fields. 3) PHP8 introduces JIT compiler and other functions to improve performance and modernization. 4) Use OPcache and follow PSR-12 standards to optimize performance and code quality.

The future of PHP will be achieved by adapting to new technology trends and introducing innovative features: 1) Adapting to cloud computing, containerization and microservice architectures, supporting Docker and Kubernetes; 2) introducing JIT compilers and enumeration types to improve performance and data processing efficiency; 3) Continuously optimize performance and promote best practices.

In PHP, trait is suitable for situations where method reuse is required but not suitable for inheritance. 1) Trait allows multiplexing methods in classes to avoid multiple inheritance complexity. 2) When using trait, you need to pay attention to method conflicts, which can be resolved through the alternative and as keywords. 3) Overuse of trait should be avoided and its single responsibility should be maintained to optimize performance and improve code maintainability.

Dependency Injection Container (DIC) is a tool that manages and provides object dependencies for use in PHP projects. The main benefits of DIC include: 1. Decoupling, making components independent, and the code is easy to maintain and test; 2. Flexibility, easy to replace or modify dependencies; 3. Testability, convenient for injecting mock objects for unit testing.

SplFixedArray is a fixed-size array in PHP, suitable for scenarios where high performance and low memory usage are required. 1) It needs to specify the size when creating to avoid the overhead caused by dynamic adjustment. 2) Based on C language array, directly operates memory and fast access speed. 3) Suitable for large-scale data processing and memory-sensitive environments, but it needs to be used with caution because its size is fixed.

PHP handles file uploads through the $\_FILES variable. The methods to ensure security include: 1. Check upload errors, 2. Verify file type and size, 3. Prevent file overwriting, 4. Move files to a permanent storage location.

In JavaScript, you can use NullCoalescingOperator(??) and NullCoalescingAssignmentOperator(??=). 1.??Returns the first non-null or non-undefined operand. 2.??= Assign the variable to the value of the right operand, but only if the variable is null or undefined. These operators simplify code logic, improve readability and performance.


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

WebStorm Mac version
Useful JavaScript development tools

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

SublimeText3 Linux new version
SublimeText3 Linux latest version

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.