Home Backend Development PHP Tutorial 菜鸟编程十大好习惯_PHP

菜鸟编程十大好习惯_PHP

Jun 01, 2016 pm 12:37 PM
top ten app program programming rookie planning set up

假如你和我一样是一只正在学习编程的菜鸟,那么下面的十个好习惯与你共勉之。


  1、设计规划

  现在是模块化程序设计的天下,应用程序要实现的目标就是金字塔尖,进行程序设计规划的意义就在于,对构成金字塔的基础模块进行划分,规划得越详细,模块分工越明确,越容易明白下一步该做什么,这好比搭积木的游戏,你可以把你的积木块组合成各种各样的形状,但首先要熟悉每个积木块的功能。

  2、有备无患

  实战之前,先找几个样例程序研究研究,最起码明白怎么开头,怎么结尾,别打无准备之仗。

  3、葵花宝典

  做一份所用程序语言的精简列表,包括基本数据类型、各类运算符说明、基本语句结构、常用关键词(保留字)、常用函数(控件)说明等等。

  4、自由独立

  为你的应用程序建立一个单独的目录,这样既方便应用程序文件的管理,而且如果你要给程序搬“家”,卷起铺盖就可以走人了。

  5、见名知意

  程序再小,用的变量也不会少,变量起名应当见名知意是个老话题了,好处是显而易见的。推荐程序员使用“匈牙利命名法”,它会使你的起名工作变得轻而易举,而且相当专业。

  6、对称之美

  中国人讲究对称之美,用在编程里也很合适,如果程序里用到A循环嵌套B判断,B判断又包含C循环之类的结构,记着使用缩进法,让A:ENDDO对齐A:DO,B:ENDIF对齐B:IF……诸如此类,依次缩进,总之对称就等于美观加易读。

  7、多加注解

  对程序中自定义的变量、函数、子程序加以功能性的注释说明,别嫌麻烦。如果过了三月五月,连自己写的东西都看不明白了,那才大麻烦。

  8、环境保护

  如果应用程序需要修改系统设置,记着应用开始前先保存设置,应用结束后要恢复设置,千万别污染环境。

  9、拿来主义

  一个人的力量是有限的,大家的力量是无限的,平时多看些技术资料,如果碰巧有好的经验,巧的方法,用得上的段子,不妨拿来。

  10、忍者无敌

  当你认为程序代码写的“百分百”正确,而程序编译执行百分百有毛病,你基本属于晕菜的时候,千万要忍,歇口气,重头来,别放弃!相信最终的胜利是属于你的!

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

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

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)

Shazam app not working in iPhone: Fix Shazam app not working in iPhone: Fix Jun 08, 2024 pm 12:36 PM

Having issues with the Shazam app on iPhone? Shazam helps you find songs by listening to them. However, if Shazam isn't working properly or doesn't recognize the song, you'll have to troubleshoot it manually. Repairing the Shazam app won't take long. So, without wasting any more time, follow the steps below to resolve issues with Shazam app. Fix 1 – Disable Bold Text Feature Bold text on iPhone may be the reason why Shazam is not working properly. Step 1 – You can only do this from your iPhone settings. So, open it. Step 2 – Next, open the “Display & Brightness” settings there. Step 3 – If you find that “Bold Text” is enabled

Clock app missing in iPhone: How to fix it Clock app missing in iPhone: How to fix it May 03, 2024 pm 09:19 PM

Is the clock app missing from your phone? The date and time will still appear on your iPhone's status bar. However, without the Clock app, you won’t be able to use world clock, stopwatch, alarm clock, and many other features. Therefore, fixing missing clock app should be at the top of your to-do list. These solutions can help you resolve this issue. Fix 1 – Place the Clock App If you mistakenly removed the Clock app from your home screen, you can put the Clock app back in its place. Step 1 – Unlock your iPhone and start swiping to the left until you reach the App Library page. Step 2 – Next, search for “clock” in the search box. Step 3 – When you see “Clock” below in the search results, press and hold it and

Can't allow access to camera and microphone in iPhone Can't allow access to camera and microphone in iPhone Apr 23, 2024 am 11:13 AM

Are you getting "Unable to allow access to camera and microphone" when trying to use the app? Typically, you grant camera and microphone permissions to specific people on a need-to-provide basis. However, if you deny permission, the camera and microphone will not work and will display this error message instead. Solving this problem is very basic and you can do it in a minute or two. Fix 1 – Provide Camera, Microphone Permissions You can provide the necessary camera and microphone permissions directly in settings. Step 1 – Go to the Settings tab. Step 2 – Open the Privacy & Security panel. Step 3 – Turn on the “Camera” permission there. Step 4 – Inside, you will find a list of apps that have requested permission for your phone’s camera. Step 5 – Open the “Camera” of the specified app

Do Not Disturb Mode Not Working in iPhone: Fix Do Not Disturb Mode Not Working in iPhone: Fix Apr 24, 2024 pm 04:50 PM

Even answering calls in Do Not Disturb mode can be a very annoying experience. As the name suggests, Do Not Disturb mode turns off all incoming call notifications and alerts from emails, messages, etc. You can follow these solution sets to fix it. Fix 1 – Enable Focus Mode Enable focus mode on your phone. Step 1 – Swipe down from the top to access Control Center. Step 2 – Next, enable “Focus Mode” on your phone. Focus Mode enables Do Not Disturb mode on your phone. It won't cause any incoming call alerts to appear on your phone. Fix 2 – Change Focus Mode Settings If there are some issues in the focus mode settings, you should fix them. Step 1 – Open your iPhone settings window. Step 2 – Next, turn on the Focus mode settings

Remove duplicate values ​​from PHP array using regular expressions Remove duplicate values ​​from PHP array using regular expressions Apr 26, 2024 pm 04:33 PM

How to remove duplicate values ​​from PHP array using regular expressions: Use regular expression /(.*)(.+)/i to match and replace duplicates. Iterate through the array elements and check for matches using preg_match. If it matches, skip the value; otherwise, add it to a new array with no duplicate values.

What is programming for and what is the use of learning it? What is programming for and what is the use of learning it? Apr 28, 2024 pm 01:34 PM

1. Programming can be used to develop various software and applications, including websites, mobile applications, games, and data analysis tools. Its application fields are very wide, covering almost all industries, including scientific research, health care, finance, education, entertainment, etc. 2. Learning programming can help us improve our problem-solving skills and logical thinking skills. During programming, we need to analyze and understand problems, find solutions, and translate them into code. This way of thinking can cultivate our analytical and abstract abilities and improve our ability to solve practical problems.

Location not available on iPhone: Fix Location not available on iPhone: Fix Jun 02, 2024 pm 05:19 PM

Suppose you're about to go on a hike you planned a long time ago, but the location seems to have stopped working on your phone? While it may not seem like much, the wrong location settings can be very problematic. Start searching for restaurants near you from a weather app, the wrong location settings can be very frustrating. In this case, these fixes will be useful. Fix 1 – Enable location settings You must enable location settings on your phone. Step 1 – Start the process by opening the Settings page. Step 2 – Later, open the Privacy & Security settings. Step 3 – Next, open the Location Services settings. Step 4 – Enable the “Location Services” option. Go back to the offending app and check if it can access the location. Fix 2 – Enable airplane mode and test enabling

Collection of C++ programming puzzles: stimulate thinking and improve programming skills Collection of C++ programming puzzles: stimulate thinking and improve programming skills Jun 01, 2024 pm 10:26 PM

C++ programming puzzles cover algorithm and data structure concepts such as Fibonacci sequence, factorial, Hamming distance, maximum and minimum values ​​of arrays, etc. By solving these puzzles, you can consolidate C++ knowledge and improve algorithm understanding and programming skills.

See all articles