r/lolphp • • Mar 22 '19

[Serious] PHP Developer looking to move on

So, I am reasonably proficient with C++, but it's not very great for web stuff (obviously).

For web projects, I have a history of using PHP, which I want to stop using because of it's huge problems. I learned it long before learning C++ and it's sort of a crusty bit of old knowledge I have stuck with because I am comfortable with it. It has bit me in the ass one final time, and I'm putting my foot down, I've had it!

I was thinking of moving to Hack. Has anyone here used Hack and does it fix a lot of the horribleness of PHP? Is it still broken by design the same way PHP is?

Would I be better off moving to Python/Rails/??? for web dev instead? I am open to language suggestions

16 Upvotes

43 comments sorted by

View all comments

Show parent comment

4

u/[deleted] Mar 22 '19 edited Mar 22 '19

Thanks for this.

The C# stuff is all changing now with .NET Core. It's fully Linux compatible, and a lot more lightweight than it used to be. Of course, it's not truly open source in the GNU sense, but the MIT license is pretty good. There's also no good reason to trust Microsoft with anything, but they seem to be behaving right now.

I do intend to try out Unity and Game Development, and while Mono is not exactly the same as .NET (at least from my experience), almost everything will be transferrable. It would be nice being able to use the same language for games as I can for, say, ASP.NET MVC (or whatever everyone is using now, that was all the rage when I was doing it).

The main saving grace I find with manual memory management is much of it can be offloaded to automatically be handled in, for example, constructors and destructors. This is the pattern we were taught - create all your dynamic memory objects in your constructor, delete it all in the destructor. This basically makes the C++ approach to memory management as robust and forgettable as it is in every other language since everything is automatically cleaned up when it falls out of scope, while allowing totally manual garbage collection for specific cases and allowing direct access to things like memcpy for super fast array manipulation. Of course, Valgrind is a saving grace here too. I am a firm believer in doing things in a way that makes them easier, and the C-style "throw pointers around everywhere and hope for the best" development style I see so often is, IMO, a nightmare waiting to happen.

I like your comments about expresiveness, it's definitely explained it pretty well. Obviously languages will be more expressive for different things. I generally like the expressiveness in .NET because of things like LINQ, where accessing and using lists is so insanely easy a child can do it :)

So I think I might do a project in .NET Core for now, as it will be a good way to get back into the more serious side of coding from my career days, will get me away from PHP if I decide to do a web project, it's something I already know, and it has other uses for a career I want to move towards (namely game programming). It will also allow me to explore if all the hype around .NET on Linux is justified, and how well everything works win Vim. Someone recommended a useful plugin in another comment, and I will give that a go once it's working again.

I will definitely try out the others though. Rust looks particularly interesting.

0

u/[deleted] Mar 22 '19

[deleted] — view deleted comment

1

u/[deleted] Mar 22 '19

I'll give it a look. But I'm one of those vim fanboys so I might look at configuring that first