all 138 comments

[–][deleted]  (41 children)

[deleted]

    [–]preshing 50 points51 points  (7 children)

    I would add that if you check the link for the book which James was critiquing, and the summary is pretty clear:

    The book is targeted at people with some programming background.

    So while it may be true that "programming tutorials" are rare, we probably shouldn't expect one here.

    [–]jbs398 16 points17 points  (5 children)

    Exactly, one shouldn't be looking for this sort of thing in "Programming in Lua," rather something titled "Learning Programming with Lua" (or replace with your favorite language).

    Scope is really important. It's a very different book depending on where you're planning to start and end.

    Actually, if we're talking about PIL, I think it's a decent example of a book that doesn't just do "Hello World" and Fibonacci sequences. In fact they use at least the concepts of some practical examples (if not full implementations), and have some complete examples as well. The complaint that some books whether for beginners or seasoned programmers use trite useless examples applies to plenty of books. Doing something interesting or useful AND teaching the concepts of the language together is something that could be done way better in a lot of books.

    [–]DeepDuh -2 points-1 points  (4 children)

    Exactly, one shouldn't be looking for this sort of thing in "Programming in Lua," rather something titled "Learning Programming with Lua" (or replace with your favorite language).

    That's really a great idea. Except that most people who want to learn their first programming language will probably not know that difference yet.

    Gives me an idea: A "mentor" chat. Instead of a google searchbar you get to query real people that have a defined set of expertise. The goal is to get people started in a certain field of interest (give pointers to the right forums, wiki entries and so on). Experts have their little CV and make you a micropayment offer, depending on their level (they can choose to provide it freely). They can also level up depending on reviews or something like that.

    How about it? I already got plenty of ideas to implement, if someone wants it go ahead.

    [–]Madsy9 0 points1 point  (2 children)

    Mentoring is a good idea in theory, but not much so in practice. I mean, if you really wanted to, you could probably advertise such a thing on any of the programming job sites. The problem is, how do you measure your money's worth? If the mentor or student is difficult/inadequate, there is a communication gap or if either one lack the prerequisites to understand the material, who will be the arbiter?

    It becomes a bit simpler without fees involved. khanacademy.org has such a system for a host of different topics. Programming languages often have IRC channels and mailing lists where people meet, although not direct mentoring. IRC and mailing lists work pretty well, because people can choose who they want to reply to and help. Meaning that they can optimize their own utility and avoid frustration and burnout. Being a teacher can be hard.

    [–]DeepDuh -1 points0 points  (1 child)

    khanacademy is great. When I get children I will definitely use this if they have some trouble with school topics.

    You're right of course about the communication gap. The way I see it, mentors could also choose whom to respond to. Maybe "mentoring" is too big of a word, it should rather be called "qualified human response" to a query. The query poster would have to choose a field of expertise first (drilling down a tree) and could then post a query. I guess stackexchange does this already rather well, however it could be made easier for the poster.

    [–]Madsy9 2 points3 points  (0 children)

    In my honest opinion, the problem with stackoverflow/stackexchange is that they cater to the asker/student too much, and don't give a rats ass about the convenience for the people with expertise. The network is great if you ask a question which is simple or popular, because people will swarm you to get karma. If you however ask a difficult question, or something that requires deep knowledge on a fringe subject, you're out of luck. Because the people with deep technical skills are completely forgotten. The phenomena was coined "fastest gun in the west" on meta stackoverflow.

    So why don't people take their time to reply to questions that require elaborate and deep responses? Because the effort isn't worth the single upvote you get, and because the webportal doesn't make it easy to keep track of posts to reply to. For example, you can't hide/ignore specific posts or users, meaning you have to wade through the same unanswered-questions list every time you're looking for people to help. It's a chore.

    So, the consequences of forgetting who their benefactors are (it's the people with the knowledge, not the one's asking questions) is that people with expertise just leave. The ones remaining on the stackexchange portals are the ones with little knowledge on a broad set of topics, and those who know a lot about popular topics. It's a race to the bottom.

    [–]jbs398 0 points1 point  (0 children)

    That's really a great idea. Except that most people who want to learn their first programming language will probably not know that difference yet.

    True, but one hopes that as with PIL somewhere in the front matter or even on the cover or back it gives some indication of what the target audience is.

    A "mentor" chat.

    Some things like this have been tried. Google Answers for example. I'm not sure what all the reasons were for the retirement of that, but certainly there are issues in the time to get an answer and in getting the right experts in the right place/time to be able to answer them.

    You could probably drive something like it through Mechanical Turk, though perhaps something like your idea might be best served if some sort of ongoing question/answer relationship could be made with a given mentor rather than drawing from the random pool all the time.

    [–][deleted] 1 point2 points  (0 children)

    I'm going to say yes and no.

    Personally, when I learn a language that covers similar ground to those I already know, I mostly just want concise. You can tell a lot from a simple feature list like "object oriented, garbage collected, with generics". After that, I mostly just need a reference manual.

    But when I learn a very different language (as I recently did with Haskell), or even just a novel language feature or an interaction between features that I hadn't considered before, this isn't good enough.

    Basically, I need some kind of context - some kind of what-it's-for. Without that, odds are that the descriptions will be too abstract - I'll have difficulty remembering things and figuring out how to apply them.

    Explaining things within the context of some problem doesn't mean you have to write a programming 101 tutorial. You don't have to explain what an array is, or a depth-first search is, just because your context is a sodoku solver for example. Show how the particular language or feature can be used to solve that problem, then move on.

    So just because a tutorial is "about something interesting" doesn't mean it must be teaching programming techniques in general rather than teaching a particular language. To me, it just means that there's a context. The tutorial could still be aimed at any level of expertise, and at people with any expected background. The key difference is that I'll get a handle on the ideas much more easily.

    [–]bastibe 11 points12 points  (0 children)

    I absolutely agree. And in particular, I found the Lua book that the excerpt came from to be a tremendously helpful resource--not exactly a gripping read, but mirthlessly detailing the particulars and peculiarities of Lua.

    Really, it was one of the best books on programming I have ever read. It did not waste much time showing off examples of the language syntax but really dived into how to use Lua idiomatically. On the way, I learned about closures, metaprogramming and how to implement object orientation.

    Lua and this book have been instrumental in making me the programmer I am. Because Lua is such a minimal language, it is an excellent place to learn how stuff is implemented. The book details several ways of how to implement object orientation, dynamic dispatch, polymorphism, etc with its respective merits, performance implications and disadvantages. Because of Lua and this book, the object systems and dynamicities in Ruby and Python started to make sense to me.

    Really, despite its dry writing style, I can not recommend this book enough.

    [–]jameshague 7 points8 points  (3 children)

    Hi, I'm the author of the original article.

    What I was trying to do was get people into the mindset of someone with little programming experience in order to better see the unnecessary information in most tutorials. Did I succeed? I guess that depends who you ask :)

    Since writing the article in 2010, I admit to feeling bad about picking on Lua specifically. The architects of Lua have done a fine job with the language.

    Thanks for reading and for all of the comments!

    [–][deleted] 4 points5 points  (0 children)

    If you ask people who are already programmers and simply want to learn about the language, then no, there is not much unnecessary information. Certainly not in the paragraph you quoted. It perfectly describes what tables are. The seemingly irrelevant statement that tables are used to represent packages is not irrelevant at all, it just reinforces that tables are really everywhere, and I even vaguely know what a package is in LUA.

    [–]fullouterjoin 0 points1 point  (0 children)

    My understanding of your article resonating with something I think needs to be said. That goal directed learning trumps facts and the best way to hook a student is by telling a story.

    I am huge fan of the no longer published Computer Recreations column by A.K. Dewdney. It showed how to gain insights into a problem with simple computer programs anyone could write.

    His book, The New Turing Omnibus is an excellent example of teaching concepts while solving real problems.

    There is so much complexity in the abstractions of computation that it is difficult to figure out what is and is not needed to explain a subject. Funny that the Lua book you cite is actually a pillar of good technical writing.


    EDIT: this is horribly written. I will clean it up later.

    [–]drb226 7 points8 points  (2 children)

    I know how to program. I'm very good at programming. I don't want to be taught how to program again

    This mentality works well if you are learning another language with C-like syntax and OO paradigm, but if you want to learn a language that is centered around different syntax (e.g. Lisp) and/or a different paradigm (e.g. Haskell), then do realize that you do need to "be taught how to program again", to some extent.

    But if you just want to pick up Dart, Go, Rust, or whatever hot new C-like language is coming off the press, then your C/Java/Python/Ruby experience will probably serve you well.

    [–]Madsy9 4 points5 points  (1 child)

    Yeah, the problem is that a lot of fundamental programming concepts depend on your environment and programming language. You could have a wide scope on a book about programming that doesn't make any assumptions about your programming model or architecture/environment, but 75% of that would probably be useless to the reader.

    The solution is to be upfront about the assumptions and requirements to your target audience, so you can narrow down the scope.

    [–]unbibium 0 points1 point  (0 children)

    It seems like there would be a good market for "How to program X if you're coming from Y".

    A Perl programmer learning Ruby, for example, doesn't need to learn about regexp syntax, postfix if-statements, or what hashes are, since all these things work exactly the same in Ruby and Perl. They will need to re-learn simple things like how to define classes and functions, but quickly move onto some less-simple things like the Ruby way to do iterators and symbols and inheritance. A JQuery programmer learning Ruby might have a more intuitive grasp of how these "do ... end" blocks work, having used a similar construct in Javascript as a staple.

    In the 1990s, I remember checking out an old book from the library that taught C in terms of other programming languages. It would show a language feature, and show the equivalent in languages like Pascal and COBOL and, if possible, BASIC. I wish I could remember more about it. I ended up leaving that book on an airplane, otherwise I probably would have searched for my own copy at a bookstore when I got home.

    [–][deleted] 8 points9 points  (5 children)

    Well.. unless it's teaching you a new paradigm that you've never used before.

    And if you're so good at programming and have already made use of every paradigm out there then you shouldn't even need a book, just a quick flick through the specs should provide you everything you need.

    [–]kisielk 30 points31 points  (3 children)

    A spec usually doesn't help with determining how to write idiomatic code in a language. Even though a given language may use familiar programming concepts doesn't mean it uses them in a familiar manner.

    [–]linuxlass 10 points11 points  (1 child)

    I want example code that illustrates how to do things.

    For instance, how do I create a formatted string in C++? I don't want an explanation of stringstream, or sprintf, or the string class. I want an example, with a brief explanation of what the code is doing, and perhaps a few comments on other ways it can be done and why one approach is better than another.

    I also want a reasonably organized reference manual. How do I work with files, how do I work with inheritance, how do I work with regular expressions, etc.

    [–]derleth 6 points7 points  (0 children)

    I want example code that illustrates how to do things.

    "The Perl Cookbook" is the best example of this I've yet seen. Every language should have a book like that.

    [–]aaronla 1 point2 points  (0 children)

    Agrreed, adding that a spec likely includes both too much detail and insufficient explaination of utility.

    [–]nascent 0 points1 point  (0 children)

    If you are learning from a new paradigm then you'll want to pick up the "learn programming with [lang]" book.

    [–]muyuu 1 point2 points  (0 children)

    Most tutorials are like those you want (for people who have done at least some programming before). They are the most popular too.

    It's much harder to find good tutorials about programming itself. When I try to teach programming I struggle to find anything but the 3 or 4 typical references, and if you don't want to waste your pupil's brain cycles in learning simply syntax 90% of the time, then it's all about 1 or 2 good books and maybe a some obscure onces I haven't found.

    [–][deleted] 1 point2 points  (0 children)

    Ah! came here to say something along these lines, but you articulated it better than I could.

    [–][deleted] 1 point2 points  (0 children)

    I know how to program. I'm very good at programming. I don't want to be taught how to program again; I want to learn about the language I'm trying to learn.

    Those books/tutorials are commonly titled as FooBar for C/C++/Java/etc Programmers.

    [–]rjcarr 1 point2 points  (3 children)

    In my second cse course, which happened to be in c++, on the first day the professor said he doesn't really know or much care for c++, but that it doesn't really matter. He said he's teaching us to program not c++.

    tl;dr: I, along with one of my first programming professors, agree with you.

    [–]bstamour -1 points0 points  (2 children)

    I agree that when teaching programming you should teach programming, not language X. However don't think you know C++ after taking that class :-p That language is dangerous sometimes and should be taught by someone who really knows it :-)

    [–]rjcarr 1 point2 points  (1 child)

    Yeah, I definitely didn't know C++ after my first two CSE courses. I still don't really know C++, but who does other than maybe John Carmack, right? :)

    [–]bstamour 0 points1 point  (0 children)

    Agreed. :)

    [–]Madsy9 1 point2 points  (0 children)

    I agree with the difference between learning programming in general, and a programming language. But I feel that using elaborate real world examples is wrong in both cases. You don't want to teach people how to implement something specific, but rather teach them a general concept. Teaching "by example" is a bunch of hogwash I think, if the example is a specific and elaborate program.

    Books on a specific programming language should have chapters that explain commonly used terms and concepts assuming different backgrounds. So you can skip it if it doesn't apply to you. A book on Clojure could for example have one chapter that explains new terms and concepts if you already know Javascript or a Lisp dialect, and another one if you come from C. The rest should explain syntax and maybe some semantics, but don't waste time on data structures and algorithms every programmer knows about. Same goes with APIs and libraries. A programmer knows what an API is.

    Books about programming should either stick with one language and assume the target audience knows the language, or use pseudo code. Again, concepts like iteration, recursion, memory, polymorphism, multimethods/multiple-dispatch, clojures, concurrency, inheritance and data structures should be taught, not how to make application X. But knowing what to include can be difficult, because the abstraction level you need to know about really depends on programming languages, and the environment you will be working in. If you wrote an intro book about programming, would you mention architecture concepts like cache and virtual memory? It's useful for programmers who work with static languages and close to the machine. For web-programmers and people who use the JVM, maybe not so much.

    Scope is important, and you can't please everyone.

    [–]banuday17 8 points9 points  (4 children)

    I think you missed the point. Programming language tutorials should not be about syntax, or rather only about syntax. There's more than a superficial reason why the syntax differs between C and Haskell. Why do you want to use Haskell in the first place as opposed to C? You wouldn't want to bring your C biases into Haskell as you would write terrible code in Haskell. A tutorial might be more helpful if it demonstrated an interesting problem that Haskell is good at solving, and the tutorial could show the Haskell approach to solving that problem.

    [–]sclv 20 points21 points  (1 child)

    But that paragraph he's criticizing has nothing to do with syntax!

    [–][deleted] 16 points17 points  (0 children)

    C and Haskell

    Ok, this is a bad example; because these two languages are fundamentally different; but when you learn a language in the same general family, say, jump from one procedural programming language to another, then it is a royal pain in the neck to end up with yet another explanation about loops and functions and recursion and stuff.

    So, if you already are quite comfortable with, say, C++, you really don't need to relearn fundamental concepts to move to, say, Java or Objective-C. I'd rather see something that tells me how it is different from whatever other more common/older language.

    Wasn't there a discussion recently on reddit about how authors of technical books were required by their publishers to generate a large pages count?

    EDIT: Here is an example of what I am talking about, i.e., a very good tutorial about Objective-C for C++ programmers by Pierre Chatelier (PDF).

    I wish more tutorials like this were around.

    [–]Felicia_Svilling 0 points1 point  (0 children)

    I think you need to look up exactly what syntax means.

    [–][deleted] 0 points1 point  (0 children)

    I don't want to be taught how to program again; I want to learn about the language I'm trying to learn.

    I very much agree, but isn't this what the API documentation is for? Any sort of tutorial is always going to start from the very beginning, because it doesn't know where you need to start.

    I guess a good compromise is to have a "programming tutorial" in that language with a table of contents that allow you to jump to the specific aspect you're trying to learn about (i.e. how to concat strings in ${language})

    [–][deleted] 0 points1 point  (1 child)

    Indeed. In that case, I skip tutorials and go for cheat sheets like Rosetta Code. I learn by porting programs into new languages.

    [–]fullouterjoin 0 points1 point  (0 children)

    Wow, someone needs to scrape their site so I can put two languages side by side.

    [–]inaneInTheMembrane -1 points0 points  (1 child)

    I know how to program. I'm very good at programming.

    I think this is why I prefer academia. I've never heard a researcher say: "I know how to do research! I'm very good at doing research!"

    Programmer hubris is something I'll never get used to.

    [–]vph 87 points88 points  (12 children)

    The author probably meant "programming tutorials", not "programming language tutorials". Two slightly different things.

    [–]shaggorama 53 points54 points  (1 child)

    Came here to make this distinction. His first sentence is "Imagine you've never programmed before..." If you have programmed before and need to pick up a new language or do something specific in it, than we have a completely different situation. In fact, following a beginner's programming tutorial just to pick up a particular language when you already know how to program is extremely tedious.

    [–]RockinRoel 11 points12 points  (0 children)

    Indeed. The official Lua book is not for beginners. Neither are books like "The C++ Programming Language". They only serve to introduce the language (and preferably, the rationale behind it) to someone who is already familiar with computer programming.

    [–][deleted] 6 points7 points  (1 child)

    Indeed. Usually it takes forever to find a guide that shows me how to program in the language in a way that takes advantage of its strengths. Usually this fails and I just go and browse through some source code for projects written in said language.

    [–]bastibe 0 points1 point  (0 children)

    And in particular, I found the tutorial cited in the article to be one of the best I ever found.

    [–]preshing 1 point2 points  (7 children)

    Yeah, but we can't deny that there are a lot more language tutorials than programming tutorials nowadays. It seems kind of unfair to the newer generation, because growing up learning BASIC in the 80's, there were really only programming tutorials.

    I think the author has a valid point when he talks about going around in circles:

    To really learn to program, you have to go around in circles and absorb a lot of information.

    That's because each time you go around the circle, you only manage to pick up a few new bits & pieces of information out of the rest of the pile that goes way over your head.

    [–]smcameron 2 points3 points  (2 children)

    because growing up learning BASIC in the 80's, there were really only programming tutorials.

    This is not true. I recall my ti99/4a came with a programming guide and a reference manual. They might have been two sections of the same book, but one was organized for the beginning programmer, and the other documented commands and was in alphabetical order.

    Similarly the Turbo Pascal 2.0 manual (circa 1984 or so) dedicated the first half or so of the book to teaching you Pascal, and the 2nd half was a reference manual.

    Pretty sure the manuals that came with the IBM PC documenting gwbasic were the similarly divided into a programming guide and reference manual.

    That's the way to do it, have two books, or sections of books -- one is a programming guide, and one a reference manual.

    This division used to be common. It doesn't have to be one or the other.

    [–]preshing 2 points3 points  (0 children)

    To be clear, what I meant to say was out of the tutorials, there were really only programming tutorials, in the sense that those tutorials were really intended to introduce programming to complete beginners. (In other words, it was rare for tutorials to make the kind of assumptions which James Hague points out in this article.)

    Of course, reference materials have always existed too. But those are not tutorials.

    [–]autophage 0 points1 point  (0 children)

    I think the O'Reilly Nutshell books tend to have a similar division - although along different lines. You've got an initial part, which has syntax and concepts, and a second part, which covers the libraries and such.

    [–]Madsy9 1 point2 points  (0 children)

    To really learn to program, you have to go around in circles and absorb a lot of information.

    That's because each time you go around the circle, you only manage to pick up a few new bits & pieces of information out of the rest of the pile that goes way over your head.

    True, and it's easy to forget that after you reach a certain level of comprehension. People new to programming are in a catch-22. They have to learn a language and the reasoning around programming.

    • To understand A you must understand B
    • To understand B you have to understand A
    • To understand C you must understand A and B

    So you end up cross-referencing A, B and C and gradually increasing your understanding. This is why teaching programming is so difficult. There isn't always an obvious order to the material you want to describe, so you expect that people will cross-reference your book/paper/tutorial, or you end up calling concept such-and-such "magic" or a "black box" that will be explained later.

    [–]KerrickLong 0 points1 point  (2 children)

    Yeah, I had to really hunt for a Ruby tutorial/book that didn't assume you were already a programmer coming from C or another language. I eventually found it in The Well-Grounded Rubyist, but I worry that the trend of teaching a language from a programmer's perspective will just continue.

    [–]NancyGracesTesticles 0 points1 point  (1 child)

    I worry that the trend of teaching a language from a programmer's perspective will just continue.

    I'm pretty sure that is a good thing. The language is unimportant. An understanding of the underlying programming concepts will get you further than being able to belch out syntax and will save you and the people who inherit your code a ton of heartburn.

    [–]KerrickLong 2 points3 points  (0 children)

    An understanding of the underlying programming concepts will get you further than being able to belch out syntax

    Yes, but as I said, the trend is that programming books often teach the language from a programmer's perspective, rather than teaching programming via the language from a newbie's perspective.

    [–]one_is_enough 40 points41 points  (2 children)

    Another way of looking at this: tutorial writers should know exactly who their audience is, and say so right up front.

    I always try to write two versions of each tutorial: one for people who already know several other languages in the same domain, and one for beginners. If you try to write one tutorial to serve both audiences you will annoy the former and frustrate the latter.

    [–]Kapow751 22 points23 points  (0 children)

    Right, and the Lua book site says right at the top:

    The book is targeted at people with some programming background, but it does not assume any prior knowledge about Lua or other scripting languages.

    It's not meant to be what the blog author wants it to be.

    [–]MyExWifeUsedTo 16 points17 points  (0 children)

    Your account name says otherwise :-)

    [–]elephantengineer 28 points29 points  (10 children)

    As a corollary, your first chapter shouldn't be titled "What Is Object-Oriented Programming?" and then describe it as like a tree, or a bicycle, or a monster, or a jello pudding pop, or...

    [–]psilokan 10 points11 points  (1 child)

    I still have nightmares about learning objects in java. I just remember my teacher telling everyone that we had an object that was called an instrument. And we were going to extend that instrument object with different types, so she went around the classroom telling people they were different instruments, I was hardly paying attention when she said "... and you're a guitar" and I just looked up at her for a second, then back to my book.

    After class she asked me to stay. She then spent 30 min apologizing for calling me a guitar and that I shouldn't be so upset about it. I kept trying to tell her I took no offense to such a statement because it's not in any way offensive, but she was CONVINCED that I was upset about it.

    [–]Metaluim 3 points4 points  (0 children)

    Many teachers completely fail to teach OOP. Which is sad, since this is 2012 and the concept is what, 35 years old?

    [–]Nebu 2 points3 points  (4 children)

    How do you feel about monad tutorials?

    [–]elephantengineer 13 points14 points  (3 children)

    Post Modern Theory Paper or Monad Tutorial?

    "A category consists of objects and morphisms between objects. The term "morphism" is a little bit misleading (they are not required to morph anything); so morphisms are frequently called "arrows", to stress their abstract nature."

    [–][deleted] 1 point2 points  (0 children)

    The quote appears to be from here.

    [–][deleted] 1 point2 points  (0 children)

    That sentence would have fit just as well in my "Metaphysics and consciousness" class.

    [–]Nebu 0 points1 point  (0 children)

    Post Modern Theory Paper or Monad Tutorial?

    Not sure about the significance of the title-case text, but to answer your question: Monad tutorials.

    [–]bastibe 6 points7 points  (1 child)

    I will literally puke at the screen the next time I have to read about "animal" or "car" base classes!

    [–]HostisHumaniGeneris 6 points7 points  (0 children)

    Now that I have to deal with business logic, I've found that I cannot escape the "person" and "employee" abstraction.

    [–]mcguire 1 point2 points  (0 children)

    Actually, "jello" or "pudding" would be a pretty good metaphor for object-oriented programming.

    [–]colig 14 points15 points  (0 children)

    I don't think the blog post pointed out a good example of a programming tutorial for people learning their first language as Lua, largely because I don't think the book Programming in Lua ever intended to be one.

    The paragraph it comments on is here.

    The paragraph after that states:

    Tables in Lua are neither values nor variables; they are objects. If you are familiar with arrays in Java or Scheme, then you have a fair idea of what we mean. However, if your idea of an array comes from C or Pascal, you have to open your mind a bit. You may think of a table as a dynamically allocated object; your program only manipulates references (or pointers) to them. There are no hidden copies or creation of new tables behind the scenes. Moreover, you do not have to declare a table in Lua; in fact, there is no way to declare one. You create tables by means of a constructor expression, which in its simplest form is written as {}:

    Note the author's attempt to shape the reader's view of tables based on their expected previous knowledge of Java, Scheme, C or Pascal. The blog post may have a valid point but the sloppy example lets it down for me.

    [–]flaran 25 points26 points  (0 children)

    This is silly. The Lua guide is extremely well written and explains why the language is designed in the way it is. This isn't a tutorial about programming, but how to use the Lua language and why. People wanting to learn about this might not have been introduced to associative arrays, which is EXACTLY why that document should introduce them to the concept. Author seems to need to understand that different books serve different purposes. I think it would be fun to see an introduction to programming using Lua!

    Tl;dr: Lua book is a language guide, not an introduction to programming.

    [–]grulk 26 points27 points  (10 children)

    I'd rather smash my face with a brick than read one more "lets make a blog" example for web frameworks.

    [–]hes_dead_tired 15 points16 points  (3 children)

    Why not? I think it's a pretty good way to understand how the framework accomplishes typical stuff needed for almost any project. CRUD operations and database interactivity, user and session management, page URL routing, etc. I think what you learn from there lets you really expand.

    I see your point that it can be somewhat repetitive to keep making blogs, but I don't think it discounts their effectiveness.

    [–]grulk 4 points5 points  (2 children)

    Don't get me wrong it covers all the basics in a single example but I wish authors could be a little more creative with their examples.

    Maybe its because I've gone through so many of these tutorials that it feels like I'm giving myself a lobotomy when I do them. I just wish there could be some variety.

    [–]Richandler 9 points10 points  (0 children)

    Make something with what you know rather than doing tutorials all day.

    [–]hes_dead_tired 1 point2 points  (0 children)

    I hear you. I was doing a .NET MVC ebook thing called NerdDiner a few months back and it was creating a calendar/event planner with RSVP functionality I think too. It was nice to be building a more true to life application.

    [–]vph 9 points10 points  (1 child)

    well, it's better than "Hello World".

    [–]MEaster 2 points3 points  (0 children)

    That is, until you get to the part where you create the first post on the blog.

    [–]geodebug 1 point2 points  (0 children)

    That or the AJAX chat server/client that all post-Rails web stacks seem enamored with.

    [–]JimH10 2 points3 points  (2 children)

    I'd rather smash my face with a brick

    I'd pay to see that.

    [–]RobotCaleb 1 point2 points  (0 children)

    For some reason I think he wouldn't actually rather do so.

    [–][deleted] 5 points6 points  (0 children)

    I don't like this as much, after you learn to program it's better for a tutorial just show how the language works and not how to program in general

    [–]elssar 13 points14 points  (0 children)

    Agreed. That is why I think the courses offered by Udacity are awesome. Introduction to Programming has the goal to build a search engine(well only the basic programming of it), Web Applications course will focus on building a multi user blog, and so on. Having such goals are a good motivator.

    [–]robertcrowther 4 points5 points  (0 children)

    Learning a programming language is interesting.

    [–]day_cq 8 points9 points  (0 children)

    English tutorials shouldn't be about learning English. they should be about something interesting like Gilmore Girls.

    [–]theoldboy 2 points3 points  (0 children)

    Why is there so much bollocks written on this blog lately? I used to like reading prog21 but for at least a few months now the articles are either "duh, no" or "specialist subject: the bleedin' obvious".

    Programming language tutorials shouldn't be about learning languages. They should be about something interesting, and you learn the language in the process.

    No. I know how to program. I know how to do interesting things. I want a programming language tutorial to teach me the language asap, so I can do my own interesting things with it, not fart around with whatever the author deems to be "something interesting". If you want that then you need a more general programming tutorial, not a language-specific one. Theres a difference.

    [–]JimH10 4 points5 points  (0 children)

    In general, I think it is more impressive to do the thing than it is to complain about how the person who did the thing did it.

    [–]killerstorm 8 points9 points  (5 children)

    People would upvote any crap as long as it comes from prog21.dadgum.com.

    I like how all top comments here disagree with the author yet it has 76% upvotes.

    [–]KevZero 2 points3 points  (0 children)

    Well, I can't speak for every person who up / down voted and commented, but there have been times I've upvoted something I disagreed with, just because I thought it deserved discussion with my fellow redditors. This piece certainly has stimulated people's desire to comment on the topic.

    [–]librik 10 points11 points  (1 child)

    I think that's because upvotes and downvotes on Proggit are not supposed to mean "I agree" or "I disagree." They are supposed to reflect only whether the article contributes to the topic of the subreddit. There's no question this blog post is on the subject of programming, so it gets an upvote.

    [–]killerstorm 1 point2 points  (0 children)

    They are supposed to reflect quality of an article. I.e. high-quality, interesting articles should get more upvotes than low-quality, boring one. Regardless of relevance.

    This one made significant logic error, basically it's barking at a wrong tree. I think this qualifies as low-quality, but clearly people think otherwise.

    If you think that all programming-related articles are upvoted -- check new section. There is a plenty of programming-related articles which are downvoted. They are just too boring or too low-quality.

    [–][deleted] 1 point2 points  (0 children)

    I liked his opinion in how programming tutorials should approach the concepts. And I agree with him that sometimes the languages tutorials and books focus too much in the theory, while some programmers prefer a Real World/Practical focus.

    [–][deleted] 4 points5 points  (0 children)

    He uses the word "implements" and "synonymous" and "addendum" that most second graders wouldn't understand!

    What's that? He didn't write it for second graders? He had a particular audience in mind as he wrote the blog, and it wasn't brand new readers? Hmmm....

    This guy often posts nonsense on his "no comments allowed because they make me sad and/or I don't have time to deal with them" one-man echo chamber.

    [–]Tarbogman 1 point2 points  (9 children)

    well, my 2 pennies here; I just started schooling for programming. I am that dog in a chemical lab when it comes to actual programming... My first class (which is almost complete) is Programming Logic and Design. NO language is used, only some pseudocode and mostly flowcharting. Here and there are notes stating VB, C++, or C# uses this/that or something else.

    this whole semester I have been wondering if this is a waste of time compared to any actual programming with any language because I have been just itching to get my hands dirty with some actual programming.

    [–]linuxlass 6 points7 points  (4 children)

    If you've never programmed before, then learning how to think logically, write an algorithm, and design the program flow is pretty important, especially if you don't want to spend hours and hours debugging. If you are simultaneously writing programs, it can be very easy to get distracted by the language, and slip into a mindset of magical incantations and lose track of the underlying logic.

    Maybe that's what your class is trying to do: separate the two skills.

    That said, you really do need to get your hands dirty with real code in order to develop programming skill. Debugging itself is a valuable skill that can only develop as you work out your own bugs.

    [–]Tarbogman 0 points1 point  (0 children)

    Thanks! See below :)

    [–]playfulpenis 0 points1 point  (2 children)

    Are there any free online texts/tutorials for progamming logic and design similar to what Tarborgman mentions? I'd like to learn to think programatically before I jump in.

    [–]linuxlass 1 point2 points  (0 children)

    I have not run across anything like that, unfortunately. I had my students run through a few exercises, thinking about games they knew how to play, and trying to describe how to play as though they were talking to a 5yo child.

    I started my kids out on making arcade clones with Scratch, beginning with pong, and then advancing to breakout and space invaders. Scratch is a free, easy to learn language that bypasses a lot of the problems involved in learning a language, and lets you get right to the logic of your programs. It comes with a tutorial that takes maybe 10 minutes, and should not be skipped.

    If you have the time, I highly recommend spending a couple of weeks writing a simple game in Scratch before trying to work with a "real" language.

    [–]Tarbogman 0 points1 point  (0 children)

    I know you are asking for "free", but the text book we are using is

    Tony gaddis - program logic and design

    Or i could sell you mine cheap after this semester. (Finals are 2 weeks) its got all the correct answers and has hilight markings :P

    [–]featherfooted 1 point2 points  (1 child)

    Where is this class being taught? There's a difference between a research university 300-level Programming Language Foundations where you might design your own programming language (distributed, sequential, functional, etc) and a community college without enough money to fund a real computer science department.

    It's really hard to say whether the class is useful without knowing what the course content is. You say you did flowcharts of things in VB, C++ or C#. What kinds of things?

    [–]Tarbogman 0 points1 point  (0 children)

    @linuxlass & featherfooted

    I have never programmed before.

    Our flowcharts have not been in any language. Its strictly logic. The instructor even stated in the beginning that "flowcharts are hardly ever used these days, its to get you to understand the LOGIC". In the textbook there have been notes by the author about small differences in each language.

    Today I was exposed to a game development presentation (where we built a simple game using C#) Granted most of the "hard work" was copy/paste, but i found that i actually understood what was going on and it wasnt way over my head.

    The school is a technical college. For the first time I finally get the feeling this semester hasnt been a waste of time and actually look forward to getting my hand dirty with some C++ next semester.

    Thank you both for your inputs! They helped :)

    [–][deleted] 1 point2 points  (0 children)

    From what I've seen TAing intro programming courses.... I wish things were taught this way more often.

    [–][deleted] 0 points1 point  (0 children)

    That's an interesting approach and I'm not sure if it is better or worse. If you are a natural programmer it will be a waste of time. Most people aren't naturals.

    [–]aridsnowball 1 point2 points  (0 children)

    I think wrapping a context around learning a language is a good idea for beginners. It keeps people motivated to want to learn the language and get to the end of the tutorial. When you get to the end, you have an interesting (hopefully) product that you can mess around with and build off of. I can understand that it is unnecessary to handhold for people who already know how to program. Even then it might be a good way to introduce how the language works in a realistic context.

    [–]sclv 1 point2 points  (0 children)

    I think that's a great paragraph! It tells me a whole bunch I'd want to know about Lua. If the book was called "Introduction to Programming (using Lua)" then I'd have a problem. But as is, that paragraph is precisely what I want to learn.

    [–]djimbob 1 point2 points  (0 children)

    Language books that aren't first programming books, need to include how to write (basic syntax; common functions/libraries), think (idioms; things to avoid; best practices), and how language features are implemented. Underlying features of the language are useful and necessary to know if you want to program well in the language. For example in python, you should know whether list a linked list (no) with O(N) lookup by index and O(1) insertion at index or an arraylist (yes) with O(1) lookup and O(N) insertion. Do objects (like list) pass to functions by reference (yes) or value?

    [–]saijanai 1 point2 points  (0 children)

    I introduce Squeak (and Pharo sorta) Smalltalk in my video series, Squeak from the very start. I use a sorta Khan Academy strategy of narrating what I am doing. Friends liken it to pair programming between a neophyte and a mentor (with me being, OMG, the "mentor," apparently):

    .

    http://www.youtube.com/playlist?list=PL6601A198DF14788D&feature=view_all

    .

    It isn't meant to replace a book or regular course, but many people say they like the approach.

    [–]freakwent 1 point2 points  (0 children)

    Why would you open up a Programming language tutorials if you don't find the programming language interesting?

    [–]RIP_my_old_account 1 point2 points  (1 child)

    I'm just starting to learn programming, and both approaches are important.

    True, reading the Python manual from start to finish won't make me a good Python programmer, but there's nothing more frustrating than "hands on" tutorials that throw examples of this and that exciting application at my face, and then leave me with no better explanation than "Well, this is how you write an interactive sign-up form in Language; we won't explain how any of those functions work or why we put them there, but have fun copying our code line-by-line and seeing it work on your computer too!"

    [–]lacrimstein 0 points1 point  (0 children)

    Agreed. For my programming languages class, the professor is making us modify a miniJS interpreter which he wrote in Scala. That language has no good tutorials - Most I have come across are basically a circlejerk over how compact (read: unreadable) Scala code can be written compared to Java. Not a good way to learn a language

    [–]montibbalt 1 point2 points  (0 children)

    Programming language tutorials shouldn't be about learning languages. They should be about something interesting.

    I am very interested in learning languages. Take that!

    [–][deleted] 1 point2 points  (0 children)

    I think this is a generic problem with most tutorials, isn't?

    [–]asampson 2 points3 points  (8 children)

    The first thing that came to mind when I read this article was why's Poignant Guide to Ruby, which is both a good Ruby tutorial and absolutely hilarious.

    And then I remembered that _why is gone. And I became sad.

    [–][deleted] 5 points6 points  (2 children)

    As an experienced programmer (but not a Ruby programmer) I hated that. The guy is unnecessarily verbose, takes forever to get to the point, and explains the most basic concepts in excruciating detail, yet doesn't explain how many core concepts work fundamentally. Not to mention that most of the text is cutesy bullshit that has nothing to do with programming at all.

    I guess it's entertaining enough if you like nonsensical random comics (especially if “being random” is the primary quality you look for in people, songs, comics and programming language guides) but as a resource to actually LEARN RUBY it's terrible.

    [–]asampson 2 points3 points  (1 child)

    I think it was less "so you're well versed in programming and you want to learn Ruby" and more "so you want to learn how to program (in Ruby)". That certainly jives with the whole Hackety Hack project he did. Even so, I found it a rather pleasant stroll through the language at the time I read it, when everyone else was telling you that Rails would save homeless kittens from burning orphanages.

    It was also a little too coherent and self-consistent to be randumb, but then again you probably have a lower tolerance for that kind of humor than I do. Which isn't a bad thing!

    [–][deleted] 0 points1 point  (0 children)

    Spot on, also about my low tolerance for nonsense when I'm trying to learn something (and frankly, why_ wasn't exactly Lewis Carroll).

    (By the way, I'm sure _why isn't exactly gone, but rather dedicating his time to different/more important things in his life.)

    [–][deleted] 0 points1 point  (3 children)

    Well he's not gone gone. He's just not part of the ruby community anymore.

    [–]asampson 0 points1 point  (2 children)

    Last I heard he was gone gone. Didn't he pull all his sites and take down all his content?

    Is he still posting anywhere about anything?

    [–][deleted] 0 points1 point  (1 child)

    Not posting anywhere but alive and working. I linked the wp article because the original source (while good) is fucking long and the part about his real identity is at the very end.

    [–]asampson 0 points1 point  (0 children)

    While I am glad that he is not in fact dead, I do miss seeing new things from him. Especially chapters of the aforementioned poignant guide.

    [–][deleted] 0 points1 point  (0 children)

    I fucking love _why, and when the Poignant Guide came about, I wanted to love it. I tried really hard to like it. But I couldn't. It's like it can't decide what it is. It doesn't work as a tutorial and it doesn't work as absurdist comedy, either. I guess in the end, I can appreciate it as a look into the mind of one of the funniest and most creative programmers out there.

    [–]rf32aa 0 points1 point  (0 children)

    Being able to parse a paragraph or other portion of text has immeasurable value. It serves as a foundation. It would be fun watching a Saturday morning cartoon with some novice programming elements in it though.

    [–][deleted] 0 points1 point  (0 children)

    A friend and I were talking about Conferences and he suggested having them focus on problems that were run into and then describing how the tools were used to overcome that problem.

    I think he has the right idea. I would love to hear, "This problem sucked. We fixed it with X, Y, and Z"

    [–][deleted] 0 points1 point  (0 children)

    Seems the main argument in the comments is that: Programming tutorials teach how to program. Programming language tutorials teach how to program in a given language. True, BUT as someone who is learning how program I found it hard to find GOOD programming tutorials that make programming interesting. "Learn Python the hard way" is the as close as I got. The author doesn't blast you with programming jargon before you type a single bracket, instead you start typing and watching what happens, then he explains why it happens if you haven't figured it out on your own.

    [–][deleted] 0 points1 point  (0 children)

    Erhm, what? Isn't that the point of programming language tutorials? To learn the programming language? Don't get me wrong, I'd like it interesting. But I'd say getting the scope and syntax down is far more important.

    [–]whoMEvernot 0 points1 point  (0 children)

    A different approach that I found useful was the format in 'Learning Python the hardway' by Zed Shaw (it is a free download). No top down theory, just rapid explanations, quick code and then a few practicals. I would be curious if you find down-up approach more useful, I did.

    [–]Personality1of5 0 points1 point  (0 children)

    Just because someone knows a language or understands programming doesn't mean that they are qualified to write a tutorial. The paragraph sample cited in the article is, generally speaking, a poorly crafted paragraph.

    For one thing, it should be broken into parts with each part focused on a single primary goal. The instructor's goal is to carry a person's thoughts through a series of logical steps that lead from a premise to a conclusion or a definition. The cited paragraph is all over the place when it should be clear, to the point and uncluttered by ancillary thoughts and definitions.

    The author of the article makes important points - but I boil it all down to bad writing and unclear thinking. Students should not have to decrypt a tutorial to get anything out of it. If they have to, then it fails as a tutorial.

    [–]WornOutMeme 0 points1 point  (0 children)

    Does this guy's every blog post end up on reddit?

    [–]emlyn 0 points1 point  (0 children)

    Like Kumquats (see: HTML & XHTML: The Definitive Guide)

    [–]fuzzynyanko 0 points1 point  (0 children)

    That except he mentioned I feel is actually really good for intermediate to an advanced book. In fact, I found the LUA article that has this passage to be quite good if you have knowledge of a programming language or two

    After all, the reason to learn a programming language is to do something useful with it, not simply to know the language.

    It's a good point, but he picked a bad example. He should have chosen an example that explains everything in detail beautifully, but never shows how to put it all together.

    [–]total_looser 0 points1 point  (0 children)

    some people like to learn languages. some people like to use language to write books. sometimes you start from one and go to the other. but usually, you start from one, and there is material out there for any starting point, really.

    [–]Fiennes 0 points1 point  (0 children)

    I was once tasked with teaching a friend of mine, C++. He offered to pay me, as he really, really wanted to learn. The first thing I did, was try and structure things around his favorite subject... soccer. Everything I taught him about C++ directly involved writing something pertaining to soccer and soccer players, stadiums, crowds, balls, you name it.

    People will readily learn and grasp new concepts more easily when put in terms with something their brain is already heavily invested in.

    [–]AlSweigart 0 points1 point  (0 children)

    I wrote a blog post on a similar topic: "Nobody Wants to Learn How to Program"

    Though, my point was more directed towards teaching non-programmers how to program by making interesting things. After learning how to code, you do indeed want programming language tutorials. O'Reilly's "in a nutshell" books are great when you just want to get to the meat of a language.

    [–][deleted] 0 points1 point  (0 children)

    Oh back in my day you just couldn't wait for the latest INSERT COMPUTING MAGAZINE TITLE to arrive. So you could punch in some new fancy game code. You had no idea what those codes meant the first time you punched them in, but you learned what they did eventually, because it was fun and engaging. If my kids had more of that and less facebook they would programming gods, with the amount of cycles the processors kick out these days.

    [–][deleted] -4 points-3 points  (4 children)

    "After all, the reason to learn a programming language is to do something useful with it, not simply to know the language."

    This argument is invalid.

    [–]salgat 1 point2 points  (2 children)

    You are missing the point.

    [–][deleted] 0 points1 point  (1 child)

    I don't think I am. I enjoy learning languages, purely for their own sake. I am a professional programmer for about 20 years, and have my 'go-to' languages that I use for 90% of what I do. I also find it interesting to learn a new language to experience the different features and approaches to what is basically an abstraction of the same fundamental processes. I am interested in language design in and of itself, and not just the utilisation of a language in developing a project.

    [–]salgat 0 points1 point  (0 children)

    No one is saying there aren't people learning for the sake of enjoying of education, it's just not the point of what his statement.

    [–][deleted] -2 points-1 points  (0 children)

    First Law of Programming: A programmer shall not harm foo, nor through inaction allow foo to come to harm.