rfc:shortsyntaxforfunctions

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
rfc:shortsyntaxforfunctions [2011/06/01 14:41]
sean Add link to existing functionality
rfc:shortsyntaxforfunctions [2017/09/22 13:28] (current)
Line 8: Line 8:
  
  
-This RFC is a parody on shortsyntaxforarrays RFC.+This RFC is a parody on [[https://​wiki.php.net/​rfc/​shortsyntaxforarrays | shortsyntaxforarrays RFC]].
  
 ===== Introduction ===== ===== Introduction =====
Line 14: Line 14:
 In some cases it is necessary that you have to declare a lot of functions. Especially when you work with classes and their methods, the function declaration tends to make the code looking ugly. If you take a look at other languages (Brainfuck, Brainfork, Feckfeck, Smallfuck, Ook! and Spoon), they don't have such syntax at all! It's all short and readable and easy to type! Maybe PHP should adopt this behaviour to make code more readable and maintainable. ​ In some cases it is necessary that you have to declare a lot of functions. Especially when you work with classes and their methods, the function declaration tends to make the code looking ugly. If you take a look at other languages (Brainfuck, Brainfork, Feckfeck, Smallfuck, Ook! and Spoon), they don't have such syntax at all! It's all short and readable and easy to type! Maybe PHP should adopt this behaviour to make code more readable and maintainable. ​
 The purpose of RFCs are to work collaboratively towards a specification and finally an implementation of an idea. The purpose of RFCs are to work collaboratively towards a specification and finally an implementation of an idea.
 +
 +===== Syntax =====
 +
 +We might just replace the current **function <​name>​(<​parameters>​) {<​body>​}** syntax with something shorter and better.
 +I'd personally propose to use dashes and dots for everything of the above. It's short and you can read it really fast.
 +
  
 Example code: Example code:
Line 32: Line 38:
 . .
 </​code>​ </​code>​
-===== Syntax ===== 
- 
-We might just replace the current **function <​name>​(<​parameters>​) {<​body>​}** syntax with something shorter and better. 
-I'd personally propose to use dashes and dots for everything of the above. It's short and you can read it really fast. 
- 
 ===== Proposal and Patch ===== ===== Proposal and Patch =====
  
 No patch is available yet. I'm working on it, though. No patch is available yet. I'm working on it, though.
- 
-This functionality is already available with Prep: https://​github.com/​andreiz/​prep/​tree/​master/​examples/​whitespace 
  
 ===== Changelog ===== ===== Changelog =====
rfc/shortsyntaxforfunctions.1306939310.txt.gz · Last modified: 2017/09/22 13:28 (external edit)