8 ms·
Show HN: Enlight – Learn to code by building projects
- forg0t_username 9y agoThe animation of what you're going to build before even clicking on it is super neat, kudos!
- deleted 9y ago[deleted]
- shamdasani 9y agoJust a GIF ;)
- warent 9y agoThe [nodejs chat application](https://tryenlight.github.io/nodejs-chat https://tryenlight.github.io/nodejs-chat) should at least briefly run through the perils of XSS and ways to sanitize inputs. The chat app lets you inject arbitrary javascript/html/css which noobs may not consider at all. Otherwise, great idea! Should help a lot of people
- deleted 9y ago[deleted]
- shamdasani 9y agoGood point - will add something on that soon. I by no means am a professional programmer, just a hobbyist sharing what I've learned.
- s4vi0r 9y agoWhy the `var`s everywhere in the example? They should really be `const`s
- deleted 9y ago[deleted]
- inimino 9y ago`var` still works everywhere, right?
- akvadrako 9y agoCurrent coding examples should be using the current best practice, which is const. If you want to support old browsers without compiling the JS, you are going to have a lot more issues than const/var and is not for beginners.
- rapind 9y agoIt's actually pretty easy to support older browser's without getting into the packaging mess if you don't need a modern framework. Learning webpack is a distraction from learning programming and would overwhelm a lot of the audience IMO.
- inimino 9y agoThe difference between `var` and `const` is irrelevant for beginners. `var` also happens to be the standard on deployed browsers and existing code, and every beginner should recognize it. It’s the least substantive thing you could pick to criticize about this code.
- ColinFCodeChef 9y agoThe gap between a professional and hobbyist is nowhere near as wide as one might think. Great idea, keep at it.
- warent 9y agoUnrelated: you joined >400 days ago and this appears to be your first post? Cool!
- inimino 9y agoTyping `<script>alert(0)</script>` into the chat box shows the injection hazard. In fact this is caused by using jQuery, which (inexcusably) runs embedded scripts when adding HTML to the page. The simplest solution to this entire class of bugs is simply to not use jQuery and use the better-designed DOM methods instead, which is probably a more modern approach anyway. Using innerHTML would solve the script injection, but you probably want to use innerText or createTextNode instead, since supporting HTML tags in a basic chat app seems more bug than feature. The server side should be safe already as it looks like there’s no persistence.
- foota 9y agoinnerHtml wouldn't eliminate xss vectors though, things like load=something could bypass this.
- inimino 9y agoYes, it's not completely safe. In a beginner tutorial, if you allow arbitrary HTML you should state that it shouldn't be done that way in a real app.
- shamdasani 9y agoThanks for the heads up. DOM methods are more clear and better. Will update the tutorial soon.
- hxtk 9y agoWould running inputs through a markdown engine on the server side fix this, assuming it didn't break some other design requirement?
- girvo 9y agoMarkdown allows HTML, though. You have to pick your engine or configuration carefully there, but the idea is sound.
- mncolinlee 9y agoThere once was a coder from Texas Who browsed websites on his Nexus. He used Dev Console Exploited a loophole And found a bevy of XSS.
- laurentdc 9y agoI would add some depth to some of the beginner/intermediate tutorials. For example, in the to-do list project you could introduce something like localStorage to make it persistent. It's only a few more lines of code but opens up a whole new topic.
- deleted 9y ago[deleted]
- shamdasani 9y agoMakes sense. I added localStorage to the text editor, but adding depth to other projects enhances not only the app, but now the user knows more features to implement in their future projects. Thank you.
- klokoman 9y agoThis looks fun, good job
- shamdasani 9y agoThanks :)
- holychiz 9y agofeature request: add discussion page for project discussion, getting help, suggestions, etc.
- shamdasani 9y agoThat's the plan. Any suggestions for forum software? Discourse? Flarum? Trying to implement it before the new year.
- KajMagnus 9y agoYou might want to check out EffectiveDiscussions too: https://www.effectivediscussions.org https://www.effectivediscussions.org. It's like Discourse + StackOverflow (Q&A) + Slack (chat) + HackerNews. (I'm developing it.) Later this week I'll release a slightly new version that'll make it the probably fastest forum software out there :- ) But Discourse is more stable & well tested. Here're some features you might like, if you like HackerNews: https://www.effectivediscussions.org/-32/how-hacker-news-can-be-improved-3-things https://www.effectivediscussions.org/-32/how-hacker-news-can... Discord (chat) is fairly popular too. But maybe not so great for Q&A because everything scrolls up-and-away in a pure chat.
- Roverlord 9y agoThis is interesting stuff, good luck! Is it being used on any good public sites yet, would love to see how it gets used in the wild.
- the-dude 9y agoHN?
- tuvtran 9y agoShameless plug but once I made a repository of projects to learn programming: https://github.com/tuvtran/project-based-learning https://github.com/tuvtran/project-based-learning
- shamdasani 9y agoGreat job! You think some Enlight projects would fit well there?
- whatyoucantsay 9y agoThose project listings look brilliant!
- metahost 9y agoA question. For the database side of things, do mainstream chat apps use the PubSub model? If not, what then?
- JCSato 9y agoYou're a class act, shamdasani. Thanks for sharing. :)
- shamdasani 9y agoGlad to hear :)
- sifex 9y agoAnother shameless plug for http://sudo.org.au/ http://sudo.org.au/. We do exactly this, thanks for sharing shamdasani! :)
- fernly 9y agoChrome thinks "This page is in [Luxembourgish]" ... wtf?
- sondh 9y agoI subscribed via MailChimp and got a link to go back to http://enlight.ml http://enlight.ml but a MacKeeper ad popped up. I tried again in incognito and it showed some other generic ads. Probably a bug?
- shamdasani 9y agoYep that’s a bug. Will fix shortly. Enlights old domain was enlight.ml until freenom took away the domain. I guess that’s what happens when I use a free domain :/
- psergeant 9y agoWhat would make these dramatically more fun for me is the examples instead being exercises
- JonasJSchreiber 9y agoFantastic! Conveys complex problems in a simple, easy to consume manner. Well done!
- wherewulf1 9y agoLearning to program right now. This is highly motivating!
- shamdasani 9y agoGlad to hear
- graniter 9y agoI get a number of people asking me how to become a programmer as a second career. For most of them, I wouldn't recommend going to college for it, but instead learn it on the side. Project-based learning I think is the best because it matches more "real world" programming and it's fun to see the results of your work. This seems like a good resource that fits right into that approach. I'll be passing this on to others. Good job!
- fergie 9y agoIts 2017. "Don't go to college" has always been really bad advice, and has never been more so than right now. If you go to college and do well in CS, you will have tech companies asking you to join them. You will also be equipped to takle unsolved problems, and make new services. Go to college.
- brownra04 9y agoWhat would you recommend for someone who already went to college in an unrelated field but is looking at CS/programming as a second career? Is the degree that important, or would an alternative path serve a returning student better?
- meebs 9y agoIf you can afford to go back to college you have enough money to do Recurse Center or something more practical than college.
- fergie 9y agoYes, a degree make a massive difference, particularly if you aspire to work in an established technology environment. Decide what you want to do, and then work out what you need to do to get there. If you dont want to do a degree- what then do you do? Basically you have to somehow get experience. But if an employer is willing to take you on without any experience, then that is probably not a place that you want to work. They will have low standards and poor pay and conditions, and therefore churn out poor products. So it is unlikely that this will create a "stepping stone" that will get you where you want to go. To cut a long story short, since getting up to speed is realistically going to take you a year or two anyway, you might as well go to college. I dont mean to sound grumpy here, but I just feel that there is concerted effort from some quarters to talk down the value of a good education when clearly if you look at Silicon Valley, education is valued really highly.
- ThePawnBreak 9y agoI think project based learning is the only way to actually learn programming. It's why most people suggest new programmers to "just build something they want" (which I think is bad advice). It's easy to envision a person reading 20 books and taking 3 MOOCs on programming not being able to tic tac toe game. It is far more difficult to envision someone who built 10 projects not being able to program. What I dislike about the projects linked is that they give you all the code, rather than just giving you the challenge. Shameless plug: I started a blog about programming challenges (projects, not algorithms) where you just get the tests and you have to write the code. The first (and only, for now) project is a URL shortener: https://cmocanu.github.io/blog/post/url_shortener/ https://cmocanu.github.io/blog/post/url_shortener/
- shamdasani 9y agoI understand where you are coming from. I think having code exercises and a more step by step process is something Enlight can improve upon. I love your URL shortner tutorial. Feel free to contribute a project or two to Enlight! Thanks for the feedback.
- KajMagnus 9y agoThis looks interesting. Do you want some feedback about the homepage? This: "Subscribe to email list: Join 1,000+ developers and get notified of new projects" makes me wonder: what kind of projects will I get notified about? Can I get notified only about certain types of projects that I'm interested in? And how often will I get notified, is that configurable? Once a week, or every 2nd week, is probably enough for me. My inbox gets too many notification emails already. I'd definitely sign up for notifications, if I could choose to receive only notifications about stuff similar to Discourse, Slack, StackOverflow, Disqus, wiki software, Diaspora, Facebook, Scuttlebutt, which I'm particularly interested in. Nice initiative :- )
- shamdasani 9y agoThank you for the feedback. I will definitely consider this in the future (when I make my own mailchimp like service) as users would benefit from this.
- Pranz 9y agoThere's a gradual color change in the header of https://tryenlight.github.io/guide https://tryenlight.github.io/guide, which is fine and all except the text isn't legible when the color is red.
- shamdasani 9y agoThanks for letting me know.
- Taniman 9y agoS-H-A-M then Dasani like the water company nothin to it.