Skip to content

added a paragraph about experimental features #2622

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

fabpot
Copy link
Member

@fabpot fabpot commented May 8, 2013

Q A
Doc fix? no
New docs? yes
Applies to 2.3+
Fixed tickets n/a

As Symfony 2.3 will freeze most of its API, we need a way to explicitly mark things as being experimental.

The goal of experimental features is to be able to gather feedback from our users as early as possible, by keeping the possibility to change things based on this feedback.

The first feature that will be marked as experimental in 2.3 is the simplification of the security customization (see symfony/symfony#6069 -- and Seldaek/symfony#3).

@lsmith77
Copy link
Contributor

lsmith77 commented May 8, 2013

i guess we can then provide a similar solution to @deprecated for @experimental ?

@fabpot
Copy link
Member Author

fabpot commented May 8, 2013

Also note that I don't want us to abuse this. It should only be used for big new features that are difficult to think of without some real-world usage.

@mweimerskirch
Copy link
Contributor

I suppose "subsequent versions" does not include 2.3.x, but it might be worth specifying.

@fabpot
Copy link
Member Author

fabpot commented May 8, 2013

So, to make things clear with the security example; we have two options:

  • include it as experimental in 2.3;
  • wait for 2.4 to include it and gather feedback from user using the bleeding edge.

@gregquat
Copy link
Contributor

gregquat commented May 8, 2013

Personnally I would include it in the 2.3, specified as experimental, since it would allow to gather feedback before releasing the 2.4 and consequently to have a better final feature.

@hhamon
Copy link
Contributor

hhamon commented May 8, 2013

Can't we have a 2.3-experimental branch so that developers will not risk to use experimental features in their critical projects? The main problem is that we have to maintain 2 branches: 2.3 and 2.3-experimental.

Otherwise, why not creating a new SymfonyExperimentalBundle that contains all experimental features? If these features are approved by the community then we can move them from the bundle to the core in 2.4, 2.5... The main problem is how to deal with namespaces without breaking BC when moving everything to the core.

@hhamon
Copy link
Contributor

hhamon commented May 8, 2013

Or what about a symfony-experimental third party repository/package like we have for Twig extensions?

I don't think mixing experimental features in 2.3 is a good idea. Having a third party bundle/repository/package is probably better. This package will have to be explicitly added to the composer.json file by the developer if he wants to use experimental features.

@gregquat
Copy link
Contributor

gregquat commented May 8, 2013

It makes sense to add it as a third part bundle but if the goal is to have as many feedback as possible, you'll have to find a way to encourage web dev to use these features.

@fabpot
Copy link
Member Author

fabpot commented May 8, 2013

I do like @hhamon idea. We can have a symfony-experimental repository that mirror the namespace of the main symfony repository but where everything is prefixed with experimental like in Symfony\Bundle\SecurityBundle\Experimental\....

@hhamon
Copy link
Contributor

hhamon commented May 8, 2013

We can always advertise for installing a third party dependency that contains such experimental API in the documentation, blog post and even in the code with commented code.

@hhamon
Copy link
Contributor

hhamon commented May 8, 2013

The Experimental subnamespace is a good idea too. That way we're clearly aware of using experimental code. Then, when this code will be considered stable we will move it to the core by just removing the Experimental part of the namespace. Migrating the codebase in a project should be easy that way.

@fabpot
Copy link
Member Author

fabpot commented May 8, 2013

That being said, I'm not sure it is worth it (creating another repository). I don't expect using this experimental thing that often: the PR on security, perhaps the one about the request context. I don't have any other example for which we would have used this (perhaps the proxy thing too).

@hhamon
Copy link
Contributor

hhamon commented May 8, 2013

The Cache component that was discussed several months ago too?

@mdarse
Copy link

mdarse commented May 8, 2013

I like this approach, it make sense to keep new feature out of core until they are ready. Merging early into core would discourage to make BC breaks on non final stuff.

@victorpuertas
Copy link

I like the @hhamon approach that not mixed experimental features with stable features. If you want use experimental, you change your composer file.

@joyarzun
Copy link

joyarzun commented May 8, 2013

2.3 should be considered completely stable, because it is a LTS. Developers and organizations seek this in this kind of releases. Please correct me if I'm wrong.

@pablocubico
Copy link

As a Symfony developer I agree with @jonsxaero , I want the main channel to be reliable. Having a separate repository for experimental features seems like a good choice.

@stephpy
Copy link
Contributor

stephpy commented May 8, 2013

I'm agree with @hhamon and @jonsxaero. Experimental features have not to be on 2.3 LTS

@beberlei
Copy link
Contributor

beberlei commented May 8, 2013

I disagree a bit with previous speakers, marking features experimental is a very explicit and good way to include unfinished functionality even in an LTS release. Python did this with import from __future__ for a long time and given the coupled release cycle of all the components to each other (no seperate releases), it would be near to impossible to experiment with APIs, which is often necessary.

Without something like experimental, new features have to become stable between any minor release (2.3 -> 2.4 etc). This is a timeframe much too small for some things.

@hhamon
Copy link
Contributor

hhamon commented May 8, 2013

@beberlei how would you do an equivalent of import from __future__ with Symfony in this case?

@beberlei
Copy link
Contributor

beberlei commented May 8, 2013

@hhamon just mark the API as @experimental as PHPs object model is too static to do much else. If its just new objects (compared to changing existing ones as well) one could think about adding something to the debug autoloader to prevent this, if not enabled.

@joyarzun
Copy link

joyarzun commented May 8, 2013

All releases, except LTS, are good to include new features and experiment with them, but in my opinion LTS is focuses on stabilizing everything as we can and give a long support. I insist that stabilizing is a reason to take into account by developers and organizations to adopt this new release. Therefore, we should not mix stable and experimental features in 2.3. Maybe It's a good idea to create a separate experimental bundle.
sorry for my english.

@loalf
Copy link

loalf commented May 8, 2013

What about modifying the autoloader slightly to try to load classes in an Experimental namespaces, so, if you try to load Symfony\HttpKernel\Kernel.php it will try to load Symfony\Experimental\HttpKernel\Kernel.php, if it doesn't exist, it falls back to Symfony\HttpKernel\Kernel.php.

You should be able to turn on and off this behaviour somehow.

@beberlei
Copy link
Contributor

beberlei commented May 8, 2013

@loalf That is hackery :-) and it violates PSR-0, breaking composer and such

@loalf
Copy link

loalf commented May 8, 2013

@beberlei you expect this kind of things from experimental stuff, no? ;) Yeah, you are right, discard it.

@applestump
Copy link

What about cases where experimental features break BC of existing functionality? Are we talking here of only new features which don't change the existing API?

@gunnarlium
Copy link
Contributor

@experimental seems immediately intuitive. It would make testing experimental features dead easy. I would like to see some tool support that can warns against @experimental the same way as for @deprecrated, though.

@hhamon
Copy link
Contributor

hhamon commented May 8, 2013

@gunnarlium the problem with @experimental is that most developers won't pay attention about it and they will use experimental features without being aware of it. That's quite risky in my opinion.

@merk
Copy link
Contributor

merk commented May 8, 2013

What will be the commitment of an experimental feature in 2.3 LTS? Are you going to backport any changes made in subsequent versions if something changes?

I think given that experimental means that there is no guarantee of stability of the code, that it should have to be specifically imported from somewhere else (another repository or namespace like Symfony\Experimental) means that the developer has to make a conscious decision to opt into unstable code in a stable branch.

@marekkalnik
Copy link
Contributor

I agree with @hhamon. Most devs will rely on IDE autocompletion and won't even notice the @experimental tag. IMHO, from a user point of view, a separate branch/repository is the safest solution.

@beberlei
Copy link
Contributor

beberlei commented May 9, 2013

This is impossible for code that extends existing classes.

Preventing accidental use of experimental code could be done in the Debug autoloader (just for dev mode): https://gist.github.com/beberlei/1ee7d78c181ca1abf796

But this would still require some mechanism for collaborators to check if experimental is enabled or not. So its not perfect

@hhamon
Copy link
Contributor

hhamon commented May 9, 2013

It looks quite hacky for me.

If I may compare this problem to the car industry, I would say that when you buy a car, you buy a car ready for production use. You don't buy a car that has experimental airbags. This is for your own safety.

My opinion is that it should be the same for Symfony. The 2.3 branch should just contain the stable API which is safe. If you want to live on the bleeding edge you have to install a 3rd party package that provides the non stable API.

@fabpot
Copy link
Member Author

fabpot commented May 10, 2013

No need to create yet another repository for experimental features as it would be only interesting for big ones (and we don't have that many of them). I prefer to wait for the next version to include these features.

Thanks for your comments.

@fabpot fabpot closed this May 10, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.