Hacker News new | past | comments | ask | show | jobs | submit login

This feels like a giant step towards the past.



Using PHP is a giant step towards the past.

PHP will never fully be utilized as an OO language by the vast majority of its user base due to its syntactically terrible standard library and history as a functional language.

As such, this addition makes plenty of sense.


Functional language? Did you mean to say procedural language?

I can assure you that PHP is not a functional language (despite all my efforts to make it one).


1) its only a step backwards if you're currently using a better language. its a step forward for other people who are way behind, or for people who have no web development experience and want to get started. it a decent and very popular learning language. if someone starts writing about goto in their php tutorials for beginners, we'll have a problem.

2) php is procedural, not functional. (edit: whoops, beaten to this punch)


PHP will never fully be utilized as an OO language because it's a stupid idea to write web pages with an OO language.

Web pages are just not suited to OO. Encapsulation can be done via functions - adding OO to it gets you nothing except longer code.

Making things more complicated does not make them better.


I almost agree with this. I'm experimenting with Kohana for my latest code, and even though this is supposed to be the lean, fast OO framework, there's a LOT of boilerplate associated. Less than a third of my code is actually get-things-done code, as opposed to more than two thirds last time I was using a home-grown, not-especially-OO framework.

Maybe some other framework does this better, though.


This is a giant step towards the past.

Welcome to 1980.


    10 PRINT "WELCOME TO 1980"
    
    20 GOTO 10


Rather goto 1980


while() loops are just goto's with some syntactic sugar..


While loops are restricted gotos with syntactic sugar.


Now that I come to think of it, it actually doesn't matter for PHP.

While loops limit the scope of variables inside the loop. For C++, that means a variable declared inside cannot be used outside - logical, and OOP.

But PHP has no concept of privacy or scope, even its "rules" may be broken (though not guaranteed to always work) and come out with the right results. Anything will compile, and usually the results are as expected.

So if you have a while loop with no concept of scope or local variables, I guess the restrictions are gone. A number of nested loops with breaks; and continues; all over end so long as the concept of limited data scope/access is not present as in PHP are exactly equivalent to goto as it is.

I guess a language as, shall we say, 'relaxed' as PHP is well-matched with relaxed keywords like goto.


No, thats not what he means. He means that gotos are unstructured, and you can do anything with them, like jumping into a loop.

Although, PHP's gotos don't allow they, and PHP still only admits structured control flow.




Consider applying for YC's W25 batch! Applications are open till Nov 12.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: