Live data from Hacker News

Hello Ruby – Almost there

blog.helloruby.com

111–120 of 128 posts

Re: Hello Ruby – Almost there

#111
post #89
post #76

Earlier quoted context omitted.

> When I started Ruby, I often didn't understand why something I wrote worked. Can you remember any examples? I can't think of very much in plain Ruby that's non-obvious.

Local Jump Errors everywhere. But I remember specifically using open(url), parsing some HTML, and writing out a CSV. Today there are libraries to make that trivial for an experienced Rubyist, but this was Ruby 1.8.0. FasterCSV was still just around the corner, there was no hpricot yet. And you're working with blocks right out of the gate. The little 40 line program (including whitespace) took me quite awhile. It read…

I'm curious how many of your criticisms are reflective of Ruby as of today, rather than the Ruby that upset you when you were starting. I learned Ruby literally eighteen months ago, have never written code against 1.9 to say nothing of 1.8, and everything in this thread is totally foreign to me.

Re: Hello Ruby – Almost there

#112
post #22

I'm not sure whether Ruby is a good intro to programming. It doesn't have first-level functions, instead it has blocks (which can take parameters to serve the same use as functions but aren't). What would syntactically be a reference to a method in other languages instead invokes the method with no arguments. It doesn't have namespaced imports, instead its imports effectively behave like includes (i.e. the "dump truc…

This is a book for teaching young kids. Trying to start them off with a language like Java or C# would be a terrible idea; not because they are bad languages, but because they have such a high learning curve. With something like Ruby we can start the child right off with puts 'Hello World' Immediately they have a positive feedback cycle. At this stage they don't need to know that a top level object has been implicitl…

> Trying to start them off with a language like Java or C# would be a terrible idea

I'm not sure how you got the idea that I argued for Java or C#. I only mentioned them to rule out the argument that being widely used is a necessary or sufficient quality when determining what language you should teach to a beginner.

In the same vein I think we can also agree that Pascal is a horrible choice although it is still frequently used as an introduction to programming.

Re: Hello Ruby – Almost there

#113
post #39

Earlier quoted context omitted.

For PHP you only need a run-of-the-mill sub-$1/month webspace provider and FTP. And that also gives you a way to share your projects with friends. For JavaScript you only need a browser.

I think PHP is harmful and should never be a first language. JavaScript is getting good enough to be a good first choice, though, and it is very easy to get up and running with.

We don't disagree.

Re: Hello Ruby – Almost there

#114
post #63
post #22

I'm not sure whether Ruby is a good intro to programming. It doesn't have first-level functions, instead it has blocks (which can take parameters to serve the same use as functions but aren't). What would syntactically be a reference to a method in other languages instead invokes the method with no arguments. It doesn't have namespaced imports, instead its imports effectively behave like includes (i.e. the "dump truc…

oh wow. there are a couple of things here I strongly disagree with. > Ruby isn't widely used in practice. Rails, Chef, Puppet, Homebrew, Cocoapods, Vagrant, Jekyll... The list goes on. > Ruby programmers tend to be very emotionally invested in their programming language. replace Ruby with any programming language and the statement it's true. human beings just work this way. > I'm not sure what the "best" first progra…

> Rails, Chef, Puppet, Homebrew, Cocoapods, Vagrant, Jekyll...

Most of these are primarily tools that can be used without being a Ruby programmer (even if treating the DSLs as black magic is worrisome). Rails is popular but despite how vocal its users tend to be it's not as widely used as you may think it is. Ruby is disproportionately widely recognized considering its actual "market share" (just like e.g. Haskell).

> replace Ruby with any programming language and the statement it's true. human beings just work this way.

Different programming language communities are different. I've met plenty of dispassionate PHP, C#, Java and JS programmers. I've yet to meet a Ruby programmer who doesn't hold the opinion that Ruby is the best thing since sliced Jesus, every language should always be replaced with Ruby and that Ruby is pretty damn close to perfect. I haven't met any dispassionate Python programmers either, but they tend to be far more nuanced about their opinion of Python.

Heck, the Ruby community came up with Haml so it could pretend to write Ruby when writing HTML, Sass (proper Sass, not the new-fangled more conservative SCSS) so it could pretend to write Ruby when writing CSS and CoffeeScript so it could pretend to write Ruby when writing JS. They even use Ruby for configuration files "because DSLs are easier" (unless you don't know Ruby).

Let's also not forget that the reason Codes of Conduct for conferences (and even open source projects) had to become a thing (e.g. the brogrammer culture) primarily originated in the Ruby community (before it spread to others). And also the entire _whytheluckystiff and Zed Shaw dramas.

You can fish for equivalents to these things in other communities but the scale and ubiquity is simply exceptional in the Ruby community. Just like PHP is exceptional in how much bad PHP code there is, Ruby is exceptional in what its community is like.

> People think they have all the answers, when in reality the experience of each individual is unique.

I'm not sure why you think we disagree about this. That's precisely what I'm saying: that Ruby programmers tend to love Ruby doesn't mean it's always the right choice for teaching absolute beginners.

Re: Hello Ruby – Almost there

#115
post #22

I'm not sure whether Ruby is a good intro to programming. It doesn't have first-level functions, instead it has blocks (which can take parameters to serve the same use as functions but aren't). What would syntactically be a reference to a method in other languages instead invokes the method with no arguments. It doesn't have namespaced imports, instead its imports effectively behave like includes (i.e. the "dump truc…

> It doesn't have first-level functions, instead it has blocks Ruby also has lambdas, which if not first-level functions, are pretty darn close. > It doesn't have namespaced imports, instead its imports effectively behave like includes (i.e. the "dump truck" approach to imports). I can't tell if you're talking about `require` or `include`. `require` is strictly meant for loading source files. If you want things to be…

> What? Ruby on Rails is ridiculously popular as a web framework.

This is the typical HN bias. If you ask someone on HN what framework they think is most popular, they'll likely say Rails. But is this actually true?

In comparison to, say, Django or the various node frameworks, sure, it's popular. But in comparison to the "big guys" (the various frameworks for PHP, Java, C#) it barely registers.

Re: Hello Ruby – Almost there

#116
post #92
post #22

I'm not sure whether Ruby is a good intro to programming. It doesn't have first-level functions, instead it has blocks (which can take parameters to serve the same use as functions but aren't). What would syntactically be a reference to a method in other languages instead invokes the method with no arguments. It doesn't have namespaced imports, instead its imports effectively behave like includes (i.e. the "dump truc…

Is this book actually teaching programming using the Ruby language? It's a pretty fundamental assumption, but I actually can't tell, given the web site. As far as I can gather, Ruby is the name of the main character, and it explores programming concepts in general, but does not actually 'teach coding'. I can't actually find the text of the book, though... Edit: other comments in the thread seem to indicate that it do…

Check the website: http://www.helloruby.com/about

I can't find any explicit mention of the Ruby programming language being used as an example, but it's pretty clear that the name of the protagonist is not an accident. The book itself doesn't seem to dive too deeply into actual code, though.

Re: Hello Ruby – Almost there

#117

Earlier quoted context omitted.

I think objects are intuitive. After all, we live in a world made of objects. What confuses newcomers is the computer science vocabulary that everyone insists on using when teaching objects. I am a big fan of object oriented programming, but the vocabulary and terrible metaphors of introductory books reads like punishment. The only language that has done a worse job explaining a simple concept is Lisp with macros. My…

> I think objects are intuitive. After all, we live in a world made of objects. We do not live in a world made of object in the OOP sense. (On a more fundamental level, we don't live in a world made of objects at all so much as a world we are prone to arbitrarily -- and not always consistently -- break up into objects for the convenience of thinking about it, but those objects still aren't OOP-style objects.)

Your "OOP sense" is exactly what I meant about confusing things with computer science jargon. To a beginner, treating objects as structs with functions is all they need to know.

Re: Hello Ruby – Almost there

#118
post #112

Earlier quoted context omitted.

This is a book for teaching young kids. Trying to start them off with a language like Java or C# would be a terrible idea; not because they are bad languages, but because they have such a high learning curve. With something like Ruby we can start the child right off with puts 'Hello World' Immediately they have a positive feedback cycle. At this stage they don't need to know that a top level object has been implicitl…

> Trying to start them off with a language like Java or C# would be a terrible idea I'm not sure how you got the idea that I argued for Java or C#. I only mentioned them to rule out the argument that being widely used is a necessary or sufficient quality when determining what language you should teach to a beginner. In the same vein I think we can also agree that Pascal is a horrible choice although it is still frequ…

No, I think we were on agreement on that point. You said, "If market use were the main concern you could probably argue for Java or C# (although I think starting with a class-based language locks you into the wrong mental model)."

I took your main argument to be that Ruby is a bad first language to teach kids and Python is a good first language to teach kids.

I was agreeing with you on Java/C# not being a good choice. I disagree with your opinion on Ruby being a bad first choice. I thought your argument was also that Python was a good (better than Ruby) choice. I actually agree that Python is ALSO a good first choice to teach children with; I do not believe it is a better choice than Ruby; rather I would say they are equally well suited.

Re: Hello Ruby – Almost there

#119
post #114
post #63

Earlier quoted context omitted.

oh wow. there are a couple of things here I strongly disagree with. > Ruby isn't widely used in practice. Rails, Chef, Puppet, Homebrew, Cocoapods, Vagrant, Jekyll... The list goes on. > Ruby programmers tend to be very emotionally invested in their programming language. replace Ruby with any programming language and the statement it's true. human beings just work this way. > I'm not sure what the "best" first progra…

> Rails, Chef, Puppet, Homebrew, Cocoapods, Vagrant, Jekyll... Most of these are primarily tools that can be used without being a Ruby programmer (even if treating the DSLs as black magic is worrisome). Rails is popular but despite how vocal its users tend to be it's not as widely used as you may think it is. Ruby is disproportionately widely recognized considering its actual "market share" (just like e.g. Haskell).…

I like Ruby. I don't have a problem with other programming languages :) I am more interested in what people build and what can be learned from those things. You can always draw parallels and learn new things. Focus on the good parts, not the trolls.

I don't think that Ruby is "is the best thing since sliced Jesus" (btw the expression is hilarious). So there you go, you have at least one data point that not all Ruby brogrammers are that way.

Re: Hello Ruby – Almost there

#120
post #115

Earlier quoted context omitted.

> It doesn't have first-level functions, instead it has blocks Ruby also has lambdas, which if not first-level functions, are pretty darn close. > It doesn't have namespaced imports, instead its imports effectively behave like includes (i.e. the "dump truck" approach to imports). I can't tell if you're talking about `require` or `include`. `require` is strictly meant for loading source files. If you want things to be…

> What? Ruby on Rails is ridiculously popular as a web framework. This is the typical HN bias. If you ask someone on HN what framework they think is most popular, they'll likely say Rails. But is this actually true? In comparison to, say, Django or the various node frameworks, sure, it's popular. But in comparison to the "big guys" (the various frameworks for PHP, Java, C#) it barely registers.

> But in comparison to the "big guys" (the various frameworks for PHP, Java, C#) it barely registers.

[citation needed]

[citation needed] especially for C#; the only .NET-based language I know of that registers as even a blip in web development is, for better or worse, ASP.NET.

[citation needed] also for PHP frameworks; most PHP web "applications", in my experience, don't use any sort of "framework" at all, instead opting to use CGI with direct manipulation of HTML tags in order to do anything. Facebook is the only significant exception that I'm aware of.

Post reply on HN