Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.php > #19040
| Path | csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail |
|---|---|
| From | Arno Welzel <usenet@arnowelzel.de> |
| Newsgroups | comp.lang.php |
| Subject | Re: Always use class aliases? |
| Date | Wed, 6 Jul 2022 20:02:22 +0200 |
| Lines | 40 |
| Message-ID | <jim11eFs1maU1@mid.individual.net> (permalink) |
| References | <t9rjld$tja$1@gioia.aioe.org> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=UTF-8 |
| Content-Transfer-Encoding | 8bit |
| X-Trace | individual.net yzDAhsjMeXqK0hOuIepgBgN5C+FJtnGuxZE9OlLWeibMLF6rl6 |
| Cancel-Lock | sha1:iB/wO3G3a5yIWpDh5B67uGtMHis= |
| Content-Language | de-DE |
| In-Reply-To | <t9rjld$tja$1@gioia.aioe.org> |
| Xref | csiph.com comp.lang.php:19040 |
Show key headers only | View raw
Flash: > https://www.exakat.io/en/6-good-practices-for-use/ > "Any call to a fully namespaced should be avoided, and at least aliased. > Firstly, this shorten the code, keep it easier to read. This may also be > called ‘Avoid long classes name in code’. > .......... > ............. > ....." > > But in some cases, I consider it something a little excessive. > For example > > --- SCRIPT --- > <?php > use MyClass as MyClass; // little excessive? > // ... > --- END SCRIPT --- > > What do you think? This makes no sense at all. You don't need an alias if you use the class at it is: <?php use MyClass; Aliases are only needed if you want to use a class as *another* name in your code: <?php use SomeNamespace\SomotherNamespace\LongClassName as MyClass; -- Arno Welzel https://arnowelzel.de
Back to comp.lang.php | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Always use class aliases? Flash <new@flash.foto> - 2022-07-03 10:23 +0200
Re: Always use class aliases? Ace of diamonds <he12091983@gmail.com> - 2022-07-06 09:19 -0700
Re: Always use class aliases? De ongekruisigde <ongekruisigde@news.eternal-september.org> - 2022-07-07 11:35 +0000
Re: Always use class aliases? Arno Welzel <usenet@arnowelzel.de> - 2022-07-06 20:02 +0200
Re: Always use class aliases? Flash <new@flash.foto> - 2022-07-07 11:46 +0200
Re: Always use class aliases? Arno Welzel <usenet@arnowelzel.de> - 2022-07-10 04:39 +0200
Re: Always use class aliases? "He, who travels time to time" <he1983912@aol.com> - 2022-09-22 07:13 -0700
csiph-web