News for hackers. Stuff that matters.
Re:The self-hating web developer by austenallred on Sunday July 19, 2015 @03:10AM (#9910304)
The "language hate" in programming is truly cancerous.

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.

Re:The self-hating web developer by prophet_ on Sunday July 19, 2015 @03:41AM (#9910369)
"Just do stuff."

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

Re:The self-hating web developer by austenallred on Sunday July 19, 2015 @01:18PM (#9911903)
Somehow this turned into a thread of people debating the merits and faults of PHP. There's a place for that, to be sure, but that's not really the point.

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.

Re:The self-hating web developer by steveax on Sunday July 19, 2015 @01:49PM (#9912059)
Or as a friend says: "the worst dancer in the world is better than the best non-dancer"
Re:The self-hating web developer by harryf on Sunday July 19, 2015 @01:55PM (#9912100)
Exactly. For me the real art of programming lies in the getting stuff done. KISS, YAGNI ... the smartest programmers I've ever worked with - the ones I'd want to work with again - were masters of getting results on-time or even before-time with clever, minimalistic solutions.
Re:The self-hating web developer by spion on Sunday July 19, 2015 @05:12AM (#9910561)
I think its a double-edged sword.

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...

Re:The self-hating web developer by thomasahle on Sunday July 19, 2015 @06:56AM (#9910771)
Haskell us perfectly fine to start with. It's just Haskell + zsh + git + archlinux + vim + cool-tech aren't things you should learn all at once. Heck, 12 years in, and I'm still lot fluent in all of those.

We can still tell people about cool stuff, just encourage them to take one step at a time, in their own time.

Re:The self-hating web developer by EugeneOZ on Monday July 20, 2015 @05:02AM (#9914782)
Advice to start learning programming from Haskell or Lisp or C++ is arrogance.
Re:The self-hating web developer by codygman on Monday July 20, 2015 @12:31PM (#9917150)
How so? I'd appreciate you expanding on it, as well as responding to the existence of these:

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...

1: http://realmofracket.com/

2: http://landoflisp.com/

Re:The self-hating web developer by thomasahle on Tuesday July 21, 2015 @07:08PM (#9926537)
I know Haskell is the introductory programming language of choice at many British universities like Oxford and Cambridge. In the US C, C++ and Scheme (functional) are all in the top 6 most common ( http://cacm.acm.org/blogs/blog-cacm/176450-python-is-now-the... ) so I don't see at all why those shouldn't be good choices.
Re:The self-hating web developer by warkid on Monday July 20, 2015 @07:35AM (#9915285)
Pefectly fine I one takes full responsibility for own advice.
Re:The self-hating web developer by crimsonalucard on Sunday July 19, 2015 @10:44AM (#9911333)
Haskell may not be the wisest language to start with. It's different from almost everything out there.
Re:The self-hating web developer by codygman on Sunday July 19, 2015 @01:55PM (#9912103)
I feel learning one Algol derived language such as Python followed by Haskell is a good solution. Perhaps even better (of not more painful) would be to learn C followed by Haskell.
Re:The self-hating web developer by novarac23 on Sunday July 19, 2015 @05:11AM (#9910559)
The conveyor belt metaphor is one of the best that I have ever heard.

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.

Re:The self-hating web developer by noir_lord on Sunday July 19, 2015 @06:22AM (#9910708)
The hatred of PHP amongst a certain type is hilarious, they automatically assume that if you chose PHP (or worse program in it because it was what you inherited as well) you are a "lesser programmer".

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.

Re:The self-hating web developer by imakesnowflakes on Sunday July 19, 2015 @07:32AM (#9910861)
> if you chose PHP (or worse program in it because it was what you inherited as well) you are a "lesser programmer".

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.

Re:The self-hating web developer by joesmo on Sunday July 19, 2015 @11:22AM (#9911447)
Your post is a perfect example of what the author is referring to: stupid people in the community trying to make others feel inferior for programming in a certain technology. When it comes to PHP, such posts are inevitable (that's how I know PHP is actually a good, useful language). About the people who post them, I will assume that you:

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.

Re:The self-hating web developer by facetube on Sunday July 19, 2015 @12:33PM (#9911694)
FWIW, PHP 4.x was completely awful for large and/or OOP codebases due to the totally insane copy-by-default semantics, the need to use &= perfectly at every call site that returned an instance of a class, and a handful of reference-counting bugs that caused interpreter crashes and still weren't fixed when 5.x matured.

It's definitely gotten better; I feel like a lot of people who swore off PHP forever are remembering version four.

Re:The self-hating web developer by noir_lord on Sunday July 19, 2015 @12:48PM (#9911760)
> 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.

Re:The self-hating web developer by facetube on Sunday July 19, 2015 @09:48PM (#9913646)
Oh, almost certainly worse, unless Rasmus Lerdorf is going on another mailing list tirade and flaming them directly.
Re:The self-hating web developer by stickfigure on Sunday July 19, 2015 @01:19PM (#9911911)
There are objective differences between programming languages and it's reasonable to have strong opinions about the relative merits and demerits of each. Yes, it's toxic when people who have no real-world experience with a language or platform rant about it, because this tends to be useless bile. But that does't mean PHP is just as good as anything else.

If you only know a single programming language, you should have some inner doubts, no matter what that language is. This is healthy.

Re:The self-hating web developer by shkkmo on Sunday July 19, 2015 @02:11PM (#9912172)
Of course languages are different. Some are better for some things than others. Choosing a language without knowledge of its tradeoffs is not a vary good idea.

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.

Re:The self-hating web developer by noir_lord on Sunday July 19, 2015 @07:50AM (#9910896)
You can assume whatever the hell you want it doesn't really matter to me since I'm well aware of 1 and 2.
Re:The self-hating web developer by EugeneOZ on Monday July 20, 2015 @05:08AM (#9914799)
Calm down about "gotchas", please, it's already annoying . Every language has gotchas and trade offs. Modern PHP is really much superior than even early versions of PHP 5, not even talking about PHP 4. You can write very clean code in PHP and very smelly in C - it's all up to you.
Re:The self-hating web developer by k0doque on Sunday July 19, 2015 @05:48AM (#9910637)
I totally agree, and this is why I am quite angry with the "basic is bad for your brain" statement from Djiktra. I understand the sentiment, but the idea that starting with very basic "non-rigorous" language is not only a waste of time but will even hold you back make me lost several years on my programming career.
Re:The self-hating web developer by noir_lord on Sunday July 19, 2015 @06:13AM (#9910681)
I see where he was coming from but I initially learnt BASIC (on a ZX-81) then moved to Pascal (Turbo Pascal on DOS) then Delphi with side branches into C and a some other languages.

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.

Re:The self-hating web developer by damcedami on Sunday July 19, 2015 @05:56AM (#9910648)
> it doesn't matter if it's vim or emacs or notepad

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.

Re:The self-hating web developer by Roboprog on Sunday July 19, 2015 @03:02PM (#9912403)
I think they meant "at first". Later, of course, it will matter.
Re:The self-hating web developer by sillygeese on Sunday July 19, 2015 @11:39AM (#9911508)
Momentum is the thing that truly matters.

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.

Re:The self-hating web developer by austenallred on Sunday July 19, 2015 @01:08PM (#9911855)
> why use php for x years?

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.

Re:The self-hating web developer by sillygeese on Monday July 20, 2015 @08:49AM (#9915612)
Alright, why use it for even five days, when you could be using something that's not a dead-end (or detrimental) for your development as a programmer?

You can get moving with a good language instead, which was my point.

Re:The self-hating web developer by justwannasing on Sunday July 19, 2015 @08:03AM (#9910924)
Well, now you know one who started out writing machine code. And I'll tell you, don't learn PHP and Rails is a joke and doesn't scale well. But any noob switching to Haskell to do a simple web app is equally insane.
Re:The self-hating web developer by kelseydh on Sunday July 19, 2015 @08:52AM (#9911026)
Rails may not scale well, but it's incredibly fast for pumping out CRUD apps. I've seen noobies in Rails move much faster than Node.js projects. Likewise I'm sure someone has seen the opposite.

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.

Re:The self-hating web developer by austenallred on Sunday July 19, 2015 @01:11PM (#9911877)
The point is that for your first project it just doesn't matter.
Re:The self-hating web developer by justwannasing on Sunday July 19, 2015 @12:46PM (#9911746)
I find that those who start out with PHP cause they have to are working for companies who presume you need PHP and a database for anything related to the web but could never explain to you a technical reason for it.
Re:The self-hating web developer by PopeOfNope on Sunday July 19, 2015 @06:06PM (#9912993)
What's your favorite web language, then?
Re:The self-hating web developer by justwannasing on Sunday July 19, 2015 @08:18PM (#9913394)
We don't use a "web language" unless you include our use of javascript. We make custom sites using C cause we can and it does everything any other language does. We just might switch to Go cause it already contains the libraries we wrote for C years ago but Go makes it more universal to those outside our company.
Re:The self-hating web developer by arpa on Monday July 20, 2015 @05:17AM (#9914845)
Well... Why not assembly for custom sites? (C is a joke, etc)
[dead]
Re:The self-hating web developer by justuk on Sunday July 19, 2015 @07:28AM (#9910849)
PHP is perfect for newbies. It's flexible. Has lots of functions built in. Several mature frameworks available. It's in active development. Hugely popular so lots of people to ask. Easy to set up a dev environment. No need to learn server admin as almost all hosting services supports it. I could go on and on.
Re:The self-hating web developer by Udo on Sunday July 19, 2015 @09:41AM (#9911156)
As someone who did a lot (and still does some) server-side development in PHP, I disagree about the newbies part, I think it's deceptive.

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.

Re:The self-hating web developer by sillygeese on Sunday July 19, 2015 @11:35AM (#9911489)
It's certainly convenient for getting started, but I think he wants to say that the drawbacks of choosing PHP outweigh the benefits.

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.

Re:The self-hating web developer by noir_lord on Sunday July 19, 2015 @07:51AM (#9910898)
I don't think you are going to change his mind, he seems very set on it.
Re:The self-hating web developer by lowmagnet on Sunday July 19, 2015 @08:11AM (#9910934)
Php is still a super effective lever for people starting out. It has some really bad technical warts but it has the shortest path to "shit's on screen" amongst web-based scripting languages.

I may not like it, but it has its place.

Re:The self-hating web developer by imakesnowflakes on Sunday July 19, 2015 @09:09AM (#9911075)
>but it has the shortest path to "shit's on screen" amongst web-based scripting languages

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

http://flask.pocoo.org/

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.

[dead]
Re:The self-hating web developer by dang on Sunday July 19, 2015 @03:52PM (#9912586)
Personal attacks are not allowed on Hacker News, no matter how thick-headed someone else may seem.
Re:The self-hating web developer by meowface on Sunday July 19, 2015 @04:57AM (#9910528)
>The "language hate" in programming is truly cancerous.

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.)

Re:The self-hating web developer by pests on Sunday July 19, 2015 @07:26AM (#9910837)
I love PHP. I really do. Everyone knows about its flaws in syntax, function names, argument order, and so on, but as someone who learned PHP and used only it for years certain paradigms and programming styles it uses really messed me (and I think others) up when switching languages:

- 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