Live data from Hacker News

Steal the Code

zachholman.com

11–16 of 16 posts

Re: Steal the Code

#11
I would agree with you, in regards to HTML, CSS, & JS. Im a semi-web developer ,and I like to look at markup of some of my favorite devs, to see how they did a certain layout, or how they made that cool effect, etc... good post

Re: Steal the Code

#13
I've long been considering putting together a directory of projects whose code is fantastic for learning from. There's just too much code out there, and it would be nice to see lists of "great iPhone code to learn from", "effective and architecturally sound Ruby on Rails projects that scale", etc. This would really require some assistance from the community, but long term I think it would highlight code from quality hackers, and improve the status quo of programmers out there.

Any such thing already exist?

Re: Steal the Code

#14

I've long been considering putting together a directory of projects whose code is fantastic for learning from. There's just too much code out there, and it would be nice to see lists of "great iPhone code to learn from", "effective and architecturally sound Ruby on Rails projects that scale", etc. This would really require some assistance from the community, but long term I think it would highlight code from quality…

As a programming novice, I think that's a great idea. (I haven't seen anything like it... the closest might be stack overflow, where the best solutions generally get voted to the top, but it tends to be fairly narrow in scope.) It would be especially great if some or all of the code was annotated with something like docco http://jashkenas.github.com/docco/

Re: Steal the Code

#16
I have been trying to teach myself programming for a couple years now, because I got sick of getting a great idea and then having to 1) explain it to the development team, 2) waiting for development 3) iterating through modifications.

So as a new programmer with no ambition of paying another fortune for 'university training' I entered the rabbit hole of learning from online resources, videos and books.

The signal to noise ratio is abominable, simply because a new programmer doesn't know stink-code from unstink-code. Horrible, exploitable examples of all languages flourish on high traffic sites and sites that rank high for "$language tutorial". these get re-pasted on 10,000 s of sites and become 'the way it is done'. You might get some comments in the original post that the author didn't properly secure the code, but rarely will you get that commenter to show the proper way to do it.

The gap between 'hello world' and real programming resources is only getting worse, and it affects the quality of Internet programming in general.

You can find a 1000 great tutorials on making cool online forms and widgets using jQuery - but they almost ALL will add the caveat "obviously for sake of brevity i'm not sanitizing data - you will want to take care of that". well, maybe we don't need any more tutorials that don't go into the details securing your data, because I'd venture to guess many newbies (like myself in the beginning) will download the demo script and upload it to our shared host and say 'done'. That leaves a lot of vulnerable low hanging fruit that is then re-copied by more people entering programming, and perpetuates the stinkcode that is so ubiquitous that it becomes 'standard'.

This leads to another problem newbatroids will face - seeing the same type of applications in tutorials built by the same language over and over. JavaScript (and the awesome jQuery library) is NOT simply an easy way to make cool photo sliders. We sure don't need any more tutorials on making cool photo sliders and other UI candy with client-side programming languages and libraries that have immense power to do other things-very very cool things. The lack of compelling, interesting examples of what JavaScript can do really limits the overall advance of web development, since newbatroids don't know it's not just for making Fancybox widgets or cool rollover effects or menus and aren't shown the real power of the language. The problem is that these are very common entry points for new programmers. JavaScript can be an incredible tool to teach programming since it's everywhere - free - and full of problems that must be fixed which teach the new programmer the difference between stink and unstink code. Crockford's series of videos and books really opened my eyes to the bigger picture.

Another problem newbatrons will face is the inability to decouple UI and 'design' from the programming logic, and by necessity then needing to learn how to do both - which starts to really - really - really - suck after a few big projects. It's easy to say 'split your code into a model, view and controller', but a newbariffic probably isn't a part of team and is hammering together some frankenstein-esque 'thing' made up of photoshop slices, PHP code (maybe formed into functions) and probably cut and paste jquery UI plugins from online resources. maybe they have experienced the fun of the nervous breakdown when a client is asking for heavy modification of a wordpress template and wants it to be pixel perfect with proper typography, and cool features that lead our young programmer into hacking away at variable-quality plugins that may or may not break on the next update.

In terms of online free resources/tutorials, it's huge. But there's also a vast gap between the proverbial 'hello world' and real deal programming. I would venture to say many new programmers start with a WAMP like environment, tool around with Wordpress or some other easy publishing platform and then find themselves really struggling to make the leap to 'proper' programming.

For one, I would like to see you smart guys help out us wannabe-programmer marketing turds by showing us how to set up a proper development environment - and i mean everything from the machine i run locally - and the software i use to make software - to 'cloud' based hosting to explaining at least where to start conceptually so i can do my own informed research. Do tutorials in real-world development environments. use linux and the command line. force newbatronics to understand how to properly code from 'hello world' and not even allow a messy windows based environment or plug and play platforms unless that's clearly as far as the programmer wants to go - and for many that's far enough.

Probably the most informative exercise I did was building a web app - then trying to hack it from as many ways as i could imagine. I spent a great deal of time learning about client-side security by continuously hacking my own applications and trying to anticipate how a skilled hacker would utilize the seemingly infinite attack surface exposed by bad client-side programming - i was amazed and horrified at how easy it was - and mobile hasn't even really hit yet, but hold on to your hats with that one. but that exercise taught me so much about programming in general, that it changed the way i conceptualized 'programming'. I thought it was about objects and functions and operators whatnot - but realized how much of it is policies and structure and scope. That could have been stressed more in my opinion from the popular online programming sites, but i guess it's easier to get traffic with the headline '50 mindblowing jQuery photo sliders' rather than 'stop using global variables and learn about function scope'.

Post reply on HN