Closed markrogoyski closed 7 years ago
The PHP standard seems to be vendor\project as the root namespace. Regardless of what vendor is, the standard seems to be two names in the root to avoid any possibility of a name collision.
So \MathPHP\Math might be a good candidate if it were to change.
Looking at a bunch of popular PHP projects, Monolog, Slim, Symfony, PhpAmqpLib, etc., none of them seem to use a vendor namespace; they just have project name as the root namespace. Maybe \MathPHP is fine.
The PHP group kindly requests that projects not put PHP in the name of their projects: PHP License
There are a lot of very popular projects with the name PHP in it:
Just to name a few.
MathPHP is short and descriptive, and there is no PHP distribution code included, so I don't see an issue, other than not kindly complying to the kind request like most other popular projects =).
Does anyone have a favorite mathematician who does not have a prominent project named after them? Godel, Fisher, Gauss, Decartes, ...
Based on other popular PHP projects, and keeping things simple, descriptive, and concise while still being PSR-4 compliant for autoloading, I'm leaning towards \MathPHP.
How about just Markrogoyski\Math
? As it's a personal project, you're the vendor.
Looking at other popular projects that skip the personal name for the vendor name as well, I imagine the reasoning is to get better adoption.
For example:
use Monolog\Logger;
seems more professional than:
use Seldaek\Monolog\Logger;
And I imagine that is the reason those projects choose to do it that way and skip the personal namespace.
Also, while I may have started this project, there are multiple people who are contributing a great deal of code. To continue using Monolog as an example, it has 250 contributors, even though it is a 'personal project' of Seldaek's. I wonder if it would have grown to as big as it is if he put his name in front of it.
I'd vote for MathPHP
, especially if you are considering opening this up to an organizational project.
I've created a new branch namespace that has the root namespace changed from \Math
to \MathPHP
.
Unless someone has a strong objection and reason against this, I'm going to merge this into master for the next release (v0.4.0).
With that release and the changed namespace, if you currently have MathPHP checked out as a git repo rather than installed via Composer, you'll probably have to rerun composer to update the Autoloader.
Monolog
is a unique name in comparison to Log
, while LogPHP
wouldn't be that unique. Adding the language you're writing in to the namespace doesn't really make it more unique.
My thought was from a "marketing" and "branding" perspective. Finding a name that seems exciting would be important. Also, MathPHP could be limiting in the long run. If the boost library were instead called MathCPP, it may never have grown as big as it has. Imagine if someone gets FFT working. There might be a person who would like to add audio processing to a library, but one called MathPHP might not seem like an option.
OK. I'm in no rush to make any major changes. When I chose the basic \Math
namespace it was because I couldn't find any other library using it, so namespace collision is not an immediate issue.
FFT always seemed very mathy to me =)
Regarding uniqueness, PHPUnit, PHPDoc, CakePHP, PHPExcel, etc., they are all short and to the point. Need to work on Excel in PHP: PHPExcel. Need unit testing in PHP: PHPUnit. That was my reasoning. Need math in PHP: Math PHP. Short, descriptive, obvious, and doesn't take up half a line on your namespace use statements :)
Summarizing some of the discussion:
Pros of using \Math
Cons of using \Math
Pros of using \MathPHP
Cons of using \MathPHP
Pros of a new unique name
Cons of a new unique name
Nice summary. I feel if you're going to make a change, now is the time to do it, and do it once, before the project gets to large. I'm guessing adoption is not very broad at this time. 42 installs according to getcomposer...which is actually up a lot from a few months ago.
Nerds (putting myself in this camp) frequently overlook the power of marketing. I'm certainly function over form. However, the better the project can be "sold", the larger the base of talent who will use, comment, and contribute. I feel the impact of a tagline like "Leibniz - A Powerful Math Library For PHP" would certainly set us apart from all the other results that pop up when you search for "Math" in the composer directory. Your project, your call.
Good point on the marketing aspect.
Please post any suggestions for a rebranding.
If a new name were to be chosen, I think it would need to meet these criteria:
I wouldn't be so strict on the "Easily identifiable" bullet. "Romanesco" could work, as it's a type of broccoli with a highly fractal appearance (Math Related). Fanciful names that hint at an association without clubbing you over the head are good IMO.
Some ideas, since I originally started this library by working on stats functions:
Math-based names
Beakerboy suggested mathematicians:
Mathematician-based names
Fractals are a neat idea. It gets you a name and a logo at the same time!
https://github.com/thephpleague/fractal
fractal is already a php library, not that you were suggesting that as a name.
@kelunik It's funny that you say LogPHP
wouldn't be that unique, since before Monolog came around log4php
was the standard PHP logger that was used at the time. =)
http://logging.apache.org/log4php/
Slightly off topic, but it was brought it by @Beakerboy, the current project byline is Modern Math Library for PHP. The suggestion of A Powerful Math Library For PHP has a good ring to it. Any other ideas for a concise, impactful description of the project for the byline?
👎 No need to change.
Symfony and laravel are massive frameworks and don't have PHP in their name.
The two issues are whether to change the namespace, and whether to change the project name.
Project Name MathPHP, as it is, is concise and descriptive, and in the tradition of other PHP projects. For example:
MathPHP follows a similar pattern:
I think my preference would be to continue with this name, but if someone has an amazing idea for an alternative name, I'm open to suggestions.
Project Namespace
I don't know of any other project using \Math
as a root namespace, so I don't think there is a collision issue. But it is generally the convention for the top-level namespace to match the project name, so I think changing \Math
to \MathPHP
makes sense. And right now it is still development releases, so there should be no issue with causing a significant backwards-incompatible change, rather than doing it after a v1.0.0 stable release.
So right now I'm leaning towards keeping the project name as it is, and changing the root namespace from \Math
to \MathPHP
to match the project name.
Thoughts?
Symfony
and Laravel
are also both not super generic terms, like Math.
The root namespace has been changed from \Math to \MathPHP in the latest release (v0.11.0).
Be sure to run composer update
to update your autoloader after doing a git pull if you have the git repo checked out.
There was a suggestion that \Math might be too generic and possibly collide with other projects. So perhaps change the root namespace to the project name \MathPHP.
Thoughts?