![]() In the original Bell Labs Unix, a two-disk setup was customary, where the first disk contained startup programs, while the second contained users' files and programs. The root of the entire tree is denoted /. Instead of addressing separate volumes such as disk partitions, removable media, and network shares as separate trees (as done in DOS and Windows: each drive has a drive letter that denotes the root of its file system tree), such volumes can be mounted on a directory, causing the volume's file system tree to appear as that directory in the larger tree. The filesystem appears as one rooted tree of directories. The rest of this article uses Unix as a generic name to refer to both the original Unix operating system and its many workalikes. Also, the filesystem provides access to other resources through so-called device files that are entry points to terminals, printers, and mice. Īs in other operating systems, the filesystem provides information storage and retrieval, and one of several forms of interprocess communication, in that the many small programs that traditionally form a Unix system can store information in files so that other programs can read them, although pipes complemented it in this role starting with the Third Edition. It was also one of the first parts of the system to be designed and implemented by Ken Thompson in the first experimental version of Unix, dated 1969. ![]() Note : PHP Constants don’t use the $ prefix as the variables do.In Unix and operating systems inspired by it, the file system is considered a central component of the operating system. This is to easily differentiate between constants and variables in a program. See, how we’ve kept the name of constants in ALL CAPS. Global constants can be defined in a common file which is included in each request of our program. There are two types of constants you can find in PHP language – Global and Class-based. So what kind of values are supposed to be constants? They are Database Credentials, API Keys and Mathematical constants as well. Obviously the latter approach is better because it is definitive.Ĭonstants as the name intends are meant to store the values which don’t change throughout the program. Consider for example following snippet: $i = “Apple iPhone 6S (32GB, Rose Gold)” Ĭan you guess in the above code, what is $t? No? Okay, let’s try following code: $item = “Apple iPhone 6S (32GB, Rose Gold)” Ĭan you guess now? Exactly! This is how you differentiate ambiguous variables from absolute variables. So what is “Ambiguity”? It’s simply naming a variable in a way so that you can’t guess what exactly it stores. ![]() Ambiguous names are the biggest reason for unreadable and ugly code. So can you guess what’s wrong with $n1, $n2, $my_name and $my_var ? One word – “Ambiguity”. It improves consistency across our whole development stack. I’d even go further to say that we should follow same conventions when defining Array Keys and Database Field Names as well. A data can be of any type, be it String, Integer, Floating point values or Boolean, Arrays. Note: Here we are covering conventions in a MVC design pattern and it should be easily followed by an intermediate level developer.įirst of all, what is a variable? A variable is what stores data. For convenience we’ll use PHP as the example language because it is most popular web development language out there and a lot of newbies easily mess-up their code by not following conventions. This article highlights how to make your code beautiful and manageable by following a small set of conventions. I have seen developers feeling hesitant to touch the code of peer members just because of the differences in naming conventions. So it becomes necessary that you follow a specific set of naming conventions in your project or even on the whole Agency level, so that every team member can easily grasp the inners of code by simply looking at a small chunk of code and takeover the further development tasks if in any case you need to switch developers. But as you know, web development is not meant for a single person’s job, there is always a Team effort somewhere down the line. In the field of web development we call it as the DNA of the code. Every developer follows the practices he feels convenient and you may even identify the code written by a particular developer. In Web Development world, keeping a definite naming convention is a tough job.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |