• 0

Why PHP syntax cannot be more like Python or Ruby?


Which PHP Syntax Do You Prefer?  

21 members have voted

  1. 1. Which PHP Syntax Do You Prefer?

    • C++/Java Style (Current Syntax)
      17
    • Expressive (e.g. Ruby, Python, etc.)
      2
    • PHP Shorthand (with curly braces, colons, etc.)
      2


Question

PHP 7 is probably one of the most exciting release we all have been waiting or. The new features and efficiency gain is very exciting.

Popular programming languages like Python and Ruby syntaxes are what I call carpal tunnel friendly programming languages. Because these language syntaxes don't require semi-colons, rarely you need to press shift and overall gets more done with less keystrokes.

Some argue that curly braces, etc. makes the code more readable, etc. But look at all the popular and successful apps written in Ruby and Python. They are quite readable too.

Wouldn't it be nice if PHP's syntax was less like Java/C++ and more like Python?

Edited by roosevelt
Link to comment
Share on other sites

14 answers to this question

Recommended Posts

  • 0

Dumb question possibly, but if you like Python or Ruby syntax, then why not just use Python or Ruby. It's quite possible that I have missed something obvious here :blush:

 

Also, I think there should be a 'I don't have a syntax preference' in the poll.

Link to comment
Share on other sites

  • 0
35 minutes ago, Fahim S. said:

Dumb question possibly, but if you like Python or Ruby syntax, then why not just use Python or Ruby. It's quite possible that I have missed something obvious here :blush:

 

Also, I think there should be a 'I don't have a syntax preference' in the poll.

I agree, I don't give a damn about syntax.

I like one thing about php, it has a lot of functions built in, I remember having to import libraries for even simple things in other programming languages...

 

But at the end, it doesn't matter what programming language is used, it all depends on the programmer. The worst thing to exist is programming code without comments to explain things when it's no longer easy to see what the code is doing :rofl:

Link to comment
Share on other sites

  • 0
2 hours ago, Seahorsepip said:

I agree, I don't give a damn about syntax.

I like one thing about php, it has a lot of functions built in, I remember having to import libraries for even simple things in other programming languages...

 

But at the end, it doesn't matter what programming language is used, it all depends on the programmer. The worst thing to exist is programming code without comments to explain things when it's no longer easy to see what the code is doing :rofl:

No what is worse is every line being commented because nobody taught said programmer what self-documenting code is ;)

 

 

If it isn't obvious on what the code does, comment it. If you need to do that for everything you ever write, you have a problem. 

 

Link to comment
Share on other sites

  • 0
4 hours ago, roosevelt said:

What do you use nowadays?

For web services, my current combo is Scala and Akka HTTP.

 

On the client side, I'm currently doing a fair bit of Swift (iOS).

 

In the recent past I've done a lot of Java for Android. I don't have an Android project on at the moment, but I'm looking to switch to Kotlin for the next project if I have the chance.

Link to comment
Share on other sites

  • 0

I still don't know what is the hate towards PHP. I've used it myself in the past, and seldomly use it today in gains of ASP.NET MVC and JavaScript, 

 

While it is true it is a pain debugging, it is pretty easy to use and allows you to do lots of stuff in a breeze. The upcoming PHP 7 release is awesome and it will be very beneficial to all the community. 

Link to comment
Share on other sites

  • 0
13 hours ago, adrynalyne said:

No what is worse is every line being commented because nobody taught said programmer what self-documenting code is ;)

 

 

If it isn't obvious on what the code does, comment it. If you need to do that for everything you ever write, you have a problem. 

 

I meant to say that :p

Quote

...when it's no longer easy to see what the code is doing ...

 

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.