Along the years I have come to admire more and more those who take what they do know and put the effort into just that: building something.
The idea of purpose is key here.
Once you have a purpose, a goal, finding the right tool for the job is no longer that difficult and you will suddenly realise that a lot the languages/frameworks people have been evangelising to you may make no sense at all.
"If you don’t know where you’re going, any road will get you there." - Lewis Carroll
The point is that getting started is the most important thing, and moving forward is the next most important thing. I'm not saying if someone comes to you and says, "I want to build a web app" one should say, "Do it in PHP." But if someone says, "I'm building my first web app in PHP" the most damaging thing you could say is, "lol you're coding like a noob. You should be doing that in {language x}."
I see happening all the time. Coding in PHP is better than not coding because you're terrified of not doing things "the right way," and that often is the alternative. Let him or her finish a project in PHP before you try to turn the ship around and make him or her learn Rails. Or JavaScript or Python, or Java or whatever. Just start.
On one hand, it does have the disastrous effects described in the article. On the other, those kind of comments from some FP programmers did turn my attention to FP languages. Turns out, there is this amazing group of people that are trying to build an entire ecosystem that stands on solid mathematical foundations. That was really exciting stuff for me. For years I've been watching our profession struggle with brilliant but ad-hoc creations, every single time being crushed by its accumulating weight of crutches and of the impossibility to reason about things once they grow to a certain size. Now it seems like we're really close to fixing this (that is, even outside of academia).
But maybe there is a way of getting people's attention without causing unnecessary extra damage. We (as a profession) ought to be able to do better than that...
We can still tell people about cool stuff, just encourage them to take one step at a time, in their own time.
Teaching Haskell to a 10 year old[0]
Realm of Racket[1]
Land of lisp[2]
0: https://superginbaby.wordpress.com/2015/04/08/teaching-haske...
It's fine to start out with anything, I did pascal/visual basic in high school. Then did Java/PHP in college. First year of college I did contract work in PHP and in WordPress. It was fun the first year or so and I love that I could have that "instant gratification" moments that PHP is famous for. Then as I grew and learned about things like concurrency, algorithms, HTTP, networking I found myself wondering off to other languages such as Ruby. Then I learned Ruby and now for a year already am doing Rails and Angular and truly enjoy it.
The thing to note here is back in a day when I was doing PHP , I heard a lot from community members and other software engineers saying something like "PHP SUCKS" and stuff like that, but I did not care because everything I wanted to build in that time I could do with procedural PHP or some OOP php or some Wordpress magic. When I realized and knew `why` I want to learn other stuff everything became clear.
I choose to use PHP despite been capable of using most any language I wanted, over the years I've used and forgotten many languages and for the requirements I have PHP was a good fit.
Also modern PHP really isn't like old PHP, composer, PSR's, The FIG folks, decent frameworks (Symfony in particular along with Laravel), huge numbers of usable libraries.
Yeah the language has issues but then a) what language doesn't b) with experience you can avoid them.
When you get down to it I only care about providing value whether that is to myself or my customers and they really don't care what language was used as long as it works.
If you choose php, I will assume that you.
1. Either is not aware of that php has a million gotchas that you need to avoid at every step. Take a look at the ever growing (!) list at /r/lolphp.
2. You don't see the significance of the aforementioned gotchas. For eg, you can show things like php's registerglobals to a newbie, and he will be impressed by how convenient it is. He won't see how bad it actually can be. This is not because he is a "lesser programmer", but due to a case of "unknown unknowns". Note that you can have 10 years of PHP experience and can still be like this.
> Also modern PHP really isn't like old PHP, composer, PSR's, The FIG....
These things does make a difference. But only on the surface, not deep down where it is really rotten.
1. Are incredibly stupid (register globals has been deprecated for years) 2. Are incredibly closed minded because you make comments like "These things does make a difference. But only on the surface, not deep down where it is really rotten" 3. Can't actually program in PHP and have not written large production apps in it 4. Probably can't actually program any language because you don't realize every single language has a million gotchas
My assumptions may be wrong, but it really doesn't matter. That's the problem with assumptions ... the damage is already done.
It's definitely gotten better; I feel like a lot of people who swore off PHP forever are remembering version four.
I think that's a valid point however I'm not sure if that is better or worse when they are attacking something.
If you only know a single programming language, you should have some inner doubts, no matter what that language is. This is healthy.
The issue the parent is comments is judging someone based on their use of a language without knowing if that person has any knowledge of the tradeoffs is doing them a disservice. Spewing that judgement on the internet is actively harmful.
These days I'm a web dev mostly using PHP and a lot of Python, I feel no need to justify my choices anymore, I could write a HTTP stack in C if I wanted to but I choose not to.
Ruby looks interesting, Go looks interesting, all this stuff is good stuff, I hate the attitude of "because X exists I must defend my choice of Y to the death", nothing is lost personally when someone else uses another language.
Yes! it matters if it's plain vanilla notepad, notepad++ would be better, you don't want to see someone else code opened in notepad, tabs and spaces and newlines will mixed like spaghetti.
That's certainly true. You learn by doing stuff. But PHP actually is a bad language, and the guy would be better off starting with something else.
Why use PHP for X years until you realize you need to move on, when you could start out with something you can still use even after that point? Even worse, he could get stuck using PHP because it's comfortable and he's used to dealing with its brokenness.
You don't have to use it for years. It doesn't take that long to grasp, then you can start learning other stuff. The important thing is to get moving.
You can get moving with a good language instead, which was my point.
I'm not here to tell you Rails is better than alternatives, but as programmers we need stop being so scathing in our opinions about other languages or frameworks.
Has it ever occurred to you that somebody may have started learning PHP, or Ruby/Rails, or Perl, or Java, simply because that was the only viable option available to them within the trajectories of their lives that would allow them to make a living? I know people learning Ruby who out of economic necessity had to switch to PHP to land a good paying job. This is particulary true in smaller cities where opportunities are far more scarce.
Switching to PHP is not a choice that I would personally want to make, but I do not judge or think less of programmers who end up doing this when they're first starting out because they have to.
Doing PHP right is challenging, and for bigger apps it requires more insight into the internals of the server and the client than, say, a comparable application written for Ruby on Rails. PHP certainly gives you enough rope to hang yourself, and while I personally do enjoy the length of rope it gives me, it's also very clear that newbies have no chance of making the right decisions given this tool.
I started out with Java, moved on to Python, and now I'm using Clojure. Every language & ecosystem -combination is some sort of trade-off, but one could reasonably make the case that Clojure is the best trade-off currently available.
Whatever he does, he should not get stuck using PHP because there are much better tools available.
I may not like it, but it has its place.
Let us see. You follow the shortest path to make a service/web app. I use your service/app. You get hacked. (By the way, has the php community yet have a clue how the php.net site got hacked, like, I don't know, 2 years back?), I am fucked.
Who wins?
Instead, what if you put in the effort to actually educate yourself about the stuff you need to know before you put a service online? What if you actually use a language that is not a complete mine field. What if you actually use a language that will actually tell you that you are wrong, right to your face, instead of conveniently working half of the time?
And the funny thing is that it is not even the shortest path to "shit on screen". Check out how easy it is in python to put stuff on screen
The worst thing right now is people who are actually promoting php to new comers! My earlier comment was removed from here, because I told not to start programming careers with PHP.
I agree with you... except when it comes to PHP. PHP is more toxic than language wars are. (I am aware of the irony in that statement.)
- arrays are hashmaps/multi-dimensional aka one-size fits all (no need for more complicated data structures)
- everything is single-request and single-process (no lifetime management or persistent state, lower need to worry about memory leaks, no threads or processes, no real timers or async)
- copy on write
I know several people who started programming only to get twisted and turned around by experienced developers saying, "Don't learn PHP" then "Rails is a joke and doesn't scale well." I talk to them a week later, and they're trying to build a simple web app in functional Haskell, and their environment is all messed up because they are using a zsh configuration they don't understand and github is telling them to put stuff in their .bashrc.
Especially when you're getting started, it just doesn't matter. Open up a text editor - it doesn't matter if it's vim or emacs or notepad, and start building something - it doesn't matter if it's PHP or Node.JS or Rails or LISP. Just do stuff. Then take on the next challenge, and grow from there. You don't start out hacking the Linux kernel.
Momentum is the thing that truly matters. Learning and creating is like a conveyor belt - if you stop the conveyor belt to move the things around and make sure that you're doing everything right, progress stops, and you're probably going to do more harm than good. Keep the conveyor belt running at all costs.
Discouraging that momentum because the language isn't "good enough" is like telling someone who is learning to ride a bike that they should jump on a motorcycle. No one would question that motorcycles are better than bicycles, but you probably don't want to start on one.
My general rule of thumb is that if you don't know why something is better yet, you should generally avoid using it. If you don't know how to write CSS, you don't need LESS or SASS or Gulp or Bower or whatever. Once you write a project in CSS, the need for SASS becomes obvious, and you appreciate it.
Of the several programmers I know, I don't know any who started out writing machine code. Most started out writing PHP (some Java), but they got the ball rolling and learned quickly.