Live data from Hacker News

Ask HN: How to become a better programmer?

news.ycombinator.com

51–60 of 63 posts

Re: Ask HN: How to become a better programmer?

#51
post #43

Earlier quoted context omitted.

But im not deriding Python per-se (indeed I believe it is a fantastic language and the vast majority of my code is in Python). However when you consider it in the situation of a Web App (i.e. running under Apache or another web server) it loses most of the advantages. Not to make it worse - but if you know PHP there is no huge benefit for switching to Python :) Which is what the OP is asking "should I learn a new lan…

I wrote a PHP app back in the day. It was small and messy, had code strewn all throughout the HTML. Hell, I didn't even know how to run a PHP script without loading an URL in the web browser. That's not necessarily a fault of the language, but the books available for PHP taught me how to code that way. And the community was in a perpetual state of newbishness. At least in 2005, the IRC channels were dominated by peop…

> As for your contention that Python is not good for web apps, that's just straight retarded and doesn't deserve a further response.

Im not sure that contends a good reverse argument ;) but anyway... (I do stand by the statement somewhat though; it was never designed to be a web language but as a general purpose successor for ABC, any web implementations are incidental and I still contend that it cant beat purpose built "for the web" languages :))

It's a difficult call all round. I used to code PHP that way - but one good book (I forget which) and some experience with Frameworks cured me of it. It's probably similar for other languages; the person I know best who swears by Django does pretty much the same thing (horrible code)

Not good for web apps is perhaps not the point I was making (it got confused in trying to be concise). More Im saying that if the OP is sat there knowing some PHP and wondering where to go next if his aim is to make a web app I would say: go make a web app in PHP. There is no killer advantage that makes Python better for the web than PHP (for me PHP is better for the web - but that is a somewhat subjective choice).

if his prime aim is to learn a new language - and he also wants to make a web app RoR is a good choice. Again because it is tailored for the web.

If he wants to learn a language and wants something general purpose which also will do him for web work Python is a great choice.

To make things even less clear; if you want to do something specialist Python is probably your "best foot forward".

The problem with Web apps is that the web server is by far the greatest leveller. It removes any clear advantage Python has over PHP :)

I am mid/high experienced in Ruby, Python and PHP and I personally would say PHP was the best choice for a basic web app with Python bringing up a very close rear :)

Re: Ask HN: How to become a better programmer?

#52
post #26

Since nobody suggested it, go to college/university and learn about data structures, lists and processor architecture. It will help you become a much more insightful programmer.

This advice is so bad I think it just gave me cancer. The OP is asking "what abilities are required to effectively build complex web apps and services?" 99.9999999999% of data structures in web programming are arrays and hashes. Look those up on wikipedia and read it, then you are done, now get to work. Processor architecture??? Is that really to be taken seriously? Not only was it previously not relevant to the OP's…

Great list. Four years at school for theory is an increasingly inefficient investment in time and money. A high school senior starting today and ending in four years would learn a lot more about cutting-edge programming by reading HN and following up with lots of experimentation than by going to school.

Re: Ask HN: How to become a better programmer?

#53
post #25

I wouldn't concentrate so much on certain programming languages, instead I would concentrate on designing programms. I don't know your background. I guess you are learning on your own, so I would recommend http://www.htdp.org or http://ocw.mit.edu/OcwWeb/Electrical-Engineering-and-Compute... . Some people will recommend Structure and Interpretation of Computer Programs. This book maybe the best on programming, but I…

Good advice and helpful links. I would add picking up a few good books on Design Patterns.

Re: Ask HN: How to become a better programmer?

#55
post #12

Earlier quoted context omitted.

Between starting with Ruby on Rails or Django with Python, is one better to start with than the other?

Personally I tried Ruby on Rails and I did not like it. There was too much magic going on and it was confusing to a beginner like myself. I thought about Django but I got the impression that it is just "Python on Rails", so I stayed away from that too. I ended up going with web.py, and I enjoy it. I understand what is happening and what all the pieces of my program do. It's not for everybody. There are fewer plug-ins…

i disagree a little with the advice above as a recommendation for the original poster. i'm not saying that web.py is better or worse than django or ror, but i think that as a "learning experience" it's probably better to go with one of the larger packages. learning to use a big package will teach you a lot. once you have that understanding, sure, go with web,py and cut your own path.

Re: Ask HN: How to become a better programmer?

#56
post #47
post #46

Earlier quoted context omitted.

This is probably one of the reasons they experimented with removing the down-voting on comments. Some people, rather than vote on relevance or insight of the comments feel they should be enforcing their own arbitrary standards.

I think the issue is in looking on down votes as a bad thing :) who cares? You did make a silly comment and people are pointing that out (relevance is fairly subjective; I suspect a number of people read the cancer comment and then stopped reading it as "not relevant") Sometimes people down vote poorly or for the wrong reasons, I agree. I think this case was justified - but for the cancer comment I myself wouldn't ha…

It was a quote from Futurama.

But I have no regrets about the rest. I don't want to see this guy going in the wrong direction, and the suggestion of learning about chip design was just way beyond bad.

But why bother. Hacker news is becoming an echo chamber. I should stick to LISP being my answer to every question.

Re: Ask HN: How to become a better programmer?

#57

Earlier quoted context omitted.

Since nobody mentioned yet... lisp is a great language to learn just to expand your horizons. Don't expect to actually develop websites in it (though clojure might be a good bet for more complex web apps), but it _will_ make you a better programmer.

"Don't expect to actually develop websites in it" I just tried to develop a website with SBCL and Hunchentoot, and it works relatively well for small examples. There's pretty good MySQL support, and it's all pretty fast. I couldn't figure out how to get a long-running SBCL process to keep even on memory usage. I saw a talk from a guy who works at ITA software [1] where he said they blow away their SBCL instances and…

It's about the tool for the job. Most websites just don't have that much server code to justify a bigger hammer. And lisps definitely take a stronger arm to swing.

Right now I'm re-learning PHP, and I'm shocked at both how prone to shortcuts it is, and how practical most of these shortcuts are. It's truly a tool for the job. I have yet to see if the cool toys like first order functions are actually usable, but I wouldn't be surprised at all if they were. All that's missing for most people is a feel of what can be done - and that's exactly what a couple of months of lisp can do.

Re: Ask HN: How to become a better programmer?

#58
You need a sound understanding of CSS, HTML and javascript. Although you may have been messing about with them a lot, try and get an in depth understanding of CSS selectors, what semantic HTML mark up is, and how to write quality code in javascript -- unobtrusive javascript is something to look up.

Javascript is really worth learning in depth. It has some quirks that will gently introduce to some useful topics such as JSON, closures, elements of functional programming, prototype based inheritance, and so on. Further, it will help you understand how to get more out of other dynamic languages too; python, ruby, etc. Douglas Crockford has some great videos on Javascript that are worth looking up.

You're not restricted to client-side programming with Javascript either. For instance, look up nodejs - a nascent server-side javascript framework that looks quite promising. It will really make you think if you've just been a PHP guy up to now!

Try and get a handle on PHP's more advanced aspects - many of which have only really arrived in recent versions. Classes, name spaces, closures and so on. Although I'd really suggest another dynamic language altogether; python is a good choice, but ruby is splendid too.

Once you're confident with that stuff you may want to go in a slightly different direction. Try Java, C, Clojure or Erlang. Try reading some more general computer science books.

I hope that helps. Good luck and all the best.

Re: Ask HN: How to become a better programmer?

#59
post #26

Since nobody suggested it, go to college/university and learn about data structures, lists and processor architecture. It will help you become a much more insightful programmer.

This advice is so bad I think it just gave me cancer. The OP is asking "what abilities are required to effectively build complex web apps and services?" 99.9999999999% of data structures in web programming are arrays and hashes. Look those up on wikipedia and read it, then you are done, now get to work. Processor architecture??? Is that really to be taken seriously? Not only was it previously not relevant to the OP's…

"Processor architecture??? Is that really to be taken seriously?"

Sure. You can get big speed-ups by exploiting the storage hierarchy, and by writing less-branchy code that does not bamboozle the branch predictor.

These can be studied from the top-level functional perspective. The low-level details can be ignored.

Re: Ask HN: How to become a better programmer?

#60
post #51

Earlier quoted context omitted.

I wrote a PHP app back in the day. It was small and messy, had code strewn all throughout the HTML. Hell, I didn't even know how to run a PHP script without loading an URL in the web browser. That's not necessarily a fault of the language, but the books available for PHP taught me how to code that way. And the community was in a perpetual state of newbishness. At least in 2005, the IRC channels were dominated by peop…

> As for your contention that Python is not good for web apps, that's just straight retarded and doesn't deserve a further response. Im not sure that contends a good reverse argument ;) but anyway... (I do stand by the statement somewhat though; it was never designed to be a web language but as a general purpose successor for ABC, any web implementations are incidental and I still contend that it cant beat purpose bu…

How is Rails "tailored for the web" in a way that Django is not? Marketing?
Post reply on HN