Beta

Slashdot: News for Nerds

×

Welcome to the Slashdot Beta site -- learn more here. Use the link in the footer or click here to return to the Classic version of Slashdot.

Thank you!

Before you choose to head back to the Classic look of the site, we'd appreciate it if you share your thoughts on the Beta; your feedback is what drives our ongoing development.

Beta is different and we value you taking the time to try it out. Please take a look at the changes we've made in Beta and  learn more about it. Thanks for reading, and for making the site better!

Interview With the Creator of Ruby

Unknown Lamer posted more than 2 years ago | from the and-you-thought-java-was-slow dept.

Programming 89

snydeq writes "Ruby creator Yukihiro Matsumoto discusses the past, present, and future of the popular programming language, calling mobile the next target for Ruby: 'I'm currently working on an alternative subset or dialect of Ruby for the small devices. I'm going to make it public early next year. Of course, mobile computing is the way to go, so that's one of the reasons I focus on the Ruby dialect working on the smaller devices.'"

cancel ×

89 comments

What, what. (0)

Anonymous Coward | more than 2 years ago | (#37327738)

Represent, dogg.

Re:What, what. (2)

EraserMouseMan (847479) | more than 2 years ago | (#37328264)

Does anybody use Ruby (or Ruby on Rails) as the primary language for big-time software projects? Can we name a few that everybody should recognize?

Re:What, what. (1)

gatkinso (15975) | more than 2 years ago | (#37328456)

Redmine.

Re:What, what. (1)

Joce640k (829181) | more than 2 years ago | (#37328524)

What's "Redmine"?

Re:What, what. (1)

gatkinso (15975) | more than 2 years ago | (#37328558)

Fairly widely used issue tracking and collaboration tool. The GnuRadio site for example is based on it.

Re:What, what. (0)

Anonymous Coward | more than 2 years ago | (#37334448)

What's "GnuRadio"?

Re:What, what. (1)

Mitchell314 (1576581) | more than 2 years ago | (#37328492)

Github?

Re:What, what. (2)

zill (1690130) | more than 2 years ago | (#37328582)

Erlang on the backend and RoR on the frontend, actually.

Re:What, what. (0)

Anonymous Coward | more than 2 years ago | (#37329384)

Metasploit is the largest Ruby project (by LoC). Twitter was written in Ruby up until it became popular enough to warrant the transition to Scala.

The fact that Ruby could power Twitter even as it became a household name shows that it can handle loads heavier than 99% of apps ever encounter.

Where I work we use Ruby for nearly everything; we use java when we need to squeeze more performance out of our hardware. As an example: I wrote some log parsing/analysis code in Ruby that worked great, until we used it on the multi-terabyte central log system. Had to rewrite in Java for the performance. What took a couple days of Ruby coding required weeks of Java coding. Ruby lets you deliver faster, and with less frustration, but it isn't the best choice for the most high-performance tasks.

Re:What, what. (1)

Anonymous Coward | more than 2 years ago | (#37329662)

Where I work we use Ruby for nearly everything; we use java when we need to squeeze more performance out of our hardware.

LOL.

Re:What, what. (0)

Anonymous Coward | more than 2 years ago | (#37343582)

I'm guessing you don't know the difference between code execution speed and VM initialization speed.

Re:What, what. (1)

NoseyNick (19946) | more than 2 years ago | (#37350114)

OpenNebula (cloud management software). Puppet (stuff for managing loads of machines).

You know, smaller devices.. (2)

toxonix (1793960) | more than 2 years ago | (#37327854)

Most of those smaller devices don't require subsets of functionality or features. Any general purpose language that doesn't require a super heavy runtime environment or a bazillion linked libraries should get along fine with an API to interact with events generated by the device. See Android, etc.

Re:You know, smExactly...aller devices.. (0)

Anonymous Coward | more than 2 years ago | (#37328048)

Any general purpose language that doesn't require a super heavy runtime environment or a bazillion linked libraries should get along fine with an API to interact with events generated by the device.

Never underestimate the ability of developers to bundle slow scripting libraries and frameworks with their applications.

Obviously, rather than compiling to js and running on the the preinstalled JIT, we should have runtimes for ruby, python, lua, PHP, Perl and every other scripting language under the sun installed on our mobile devices. Makes no sense from an engineering perspective but mercy be that people who are irrationally and emotionally invested in a pet language will STFU!

Re:You know, smExactly...aller devices.. (1)

lynnae (2439544) | more than 2 years ago | (#37328120)

Makes no sense from an engineering perspective but mercy be that people who are irrationally and emotionally invested in a pet language will STFU!

You seem irrationally and emotionally invested in javascript.

Re:You know, smExactly...aller devices.. (1)

aztracker1 (702135) | more than 2 years ago | (#37329018)

Can't speak for the GP, but I happen to like JS... I don't see that Ruby really offers much over PERL, except in that neither have had as much effort put into optimization that JS has seen in the past few years. As Node has been increasingly used for highly IO driven workloads, it's being proven to be a good platform for a lot of things. It's the default language of development in-browser (which is arguably where most development happens these days, though not always the most high profile development), and it's natural to want to use a favored language everywhere. JSON has become a preferred transport medium as opposed to XML, and even further pushes to use the language where JSON is native. CouchDB uses JSON for object expression, and JS for application development. MongoDB uses JS for it's default interface, and a binary version of JSON for it's object communication.

I wouldn't say these reasons are irrational at all. I would say that trying to push yet another language on to mobile devices, because the languages already on there aren't the preferred language is fairly irrational. JS is on these devices simply because they interact with the web, which uses JS... any other supported language is because that's the preferred language for the developers of those mobile platforms. Anything more than those two are superfluous and only serve to bloat the underlying platforms.

Re:You know, smExactly...aller devices.. (1)

kelemvor4 (1980226) | more than 2 years ago | (#37329242)

Obviously, rather than compiling to js and running on the the preinstalled JIT, we should have runtimes for ruby, python, lua, PHP, Perl and every other scripting language under the sun installed on our mobile devices. Makes no sense from an engineering perspective but mercy be that people who are irrationally and emotionally invested in a pet language will STFU!

You seem irrationally and emotionally invested in javascript.

If javascript is the only runtime preinstalled, using javascript seems like a pretty rational thing to do to me...

Re:You know, smExactly...aller devices.. (1)

iggymanz (596061) | more than 2 years ago | (#37329370)

why not, this is second decade of 21st century and gigabytes of storage are cheap. a jvm or dalvik or ruby virtual machine plus a few languages are nothing.

Re:You know, smaller devices.. (1)

Anonymous Coward | more than 2 years ago | (#37328232)

You seem to be implying that Android does not implement a subset of Java.

http://www.zdnet.com/blog/burnette/java-vs-android-apis/504

Re:You know, smaller devices.. (0)

Anonymous Coward | more than 2 years ago | (#37328674)

You seem to be implying that Android does not implement a subset of Java.

http://www.zdnet.com/blog/burnette/java-vs-android-apis/504

You seem to be confusing a computer language with the API that comes with it.

Re:You know, smaller devices.. (2)

gl4ss (559668) | more than 2 years ago | (#37328980)

androids version of _java_ is quite complete.
it's certainly not midp 1.0 type of subset on the vm side. you know, because you're not lacking things like floats.
api's are another matter of course. but what would you do with a mouth class if you had no face to scream from.

if he's talking things like hw abstraction api's, then that's another matter. and highly platform specific. ui classes are also another matter.

otherwise there's no difference between mobile and non mobile, unless ruby needs some stupid busyloops running and burning electricity? and fyi for some "mobile" platforms you can have ruby already - you can have everything you could have on arm desktop machine, naturally. if they're practical to use from api binding, dependencies etc perspective now that's entirely different matter again.

but just purely on language level, "mobile optimizations" would translate to optimizing for running on arm and using less power.

Re:You know, smaller devices.. (1)

toxonix (1793960) | more than 2 years ago | (#37341424)

Android includes a subset of the libraries normally included in the JDK, not a subset of language features.

TFA is nothing but fluff (4, Insightful)

AdmiralXyz (1378985) | more than 2 years ago | (#37327922)

There's nothing really wrong with TFA, but there's nothing there either. It's so bland. The questions are just "Why did you create Ruby? What's next for Ruby?" I mean, seriously? If you were interviewing someone for a high school newspaper that might be OK, but they really can't do anything better? There's nothing more interesting you could ask Matz?

Re:TFA is nothing but fluff (1)

Anonymous Coward | more than 2 years ago | (#37328148)

Such as?

Re:TFA is nothing but fluff (4, Interesting)

Anonymous Coward | more than 2 years ago | (#37330242)

Oh let's see...

1. What are prospects of incorporating true, concurrent multithreads?

2. JIT - why or why not? and when?

3. Is performance closer to Java realistic for Ruby? What are the obstacles?

This is just the most pressing stuff and I don't even use Ruby much anymore.

Re:TFA is nothing but fluff (0)

Anonymous Coward | more than 2 years ago | (#37331860)

And this is why you will never conduct interviews for a newspaper.

Re:TFA is nothing but fluff (1)

Hotweed Music (2017854) | more than 2 years ago | (#37328550)

Interviewing a foreigner with complicated questions is probably tricky.

Ruby? Luby! (-1)

Anonymous Coward | more than 2 years ago | (#37327936)

Herro! Me rikey velly mush the Luby Plogramming Rangurage. Velly super number-one simpurr, no crazy bad Java notch can not even make plogram! You rikey Twitter? Me rikey Twitter!

Re:Ruby? Luby! (-1)

Anonymous Coward | more than 2 years ago | (#37328386)

In Japan, they embrace democracy. They love to hold erections.

Best of luck, Matz... (1, Interesting)

Microlith (54737) | more than 2 years ago | (#37327942)

Of course, mobile computing is the way to go, so that's one of the reasons I focus on the Ruby dialect working on the smaller devices.

While I do have Ruby on my N900, I wish him the best of luck in his goals. Between the attacks from the Apple and MS camp on Android and little to no attention being paid to real solutions like MeeGo, all we'll be left with in short order is anti-geek platforms like Windows Phone and iOS, where running things like Ruby (or Python) are expressly verboten.

Re:Best of luck, Matz... (-1)

Anonymous Coward | more than 2 years ago | (#37328354)

Why did you choose the word 'While'?

Re:Best of luck, Matz... (1)

Microlith (54737) | more than 2 years ago | (#37328420)

Because my experience with Ruby on mobile devices is no indication of what the mobile space will look like in the very near future. I expect in the near term, being able to put a scripting language like Ruby on a mobile device will be hard if not impossible. And I am not optimistic.

Re:Best of luck, Matz... (1)

Anonymous Coward | more than 2 years ago | (#37328560)

The real question is why in the world would any non-developer (and I use the term lightly) run a CPU burning, battery draining, GC requiring interpreted language on a mobile device in the first place? Python / Ruby / Perl / TCL, all of these are prototyping / utility languages. They're not designed to build low overhead / low cycle apps. I can see why developers who aren't proficient in C / C++ / Objective-C want them, but in the context of user experience, there's absolutely no net benefit to using these languages in creating apps for mobile devices.

Re:Best of luck, Matz... (1)

TheTyrannyOfForcedRe (1186313) | more than 2 years ago | (#37328988)

The real question is why in the world would any non-developer (and I use the term lightly) run a CPU burning, battery draining, GC requiring interpreted language on a mobile device in the first place? Python / Ruby / Perl / TCL, all of these are prototyping / utility languages. They're not designed to build low overhead / low cycle apps. I can see why developers who aren't proficient in C / C++ / Objective-C want them, but in the context of user experience, there's absolutely no net benefit to using these languages in creating apps for mobile devices.

Actually, there is. Most mobile devices are not rebooted frequently and have a relatively (to desktops) small amount of RAM. Also, many mobile apps are long running. An app might be run for weeks before being closed or before the device is rebooted. This is a recipe fore heap fragmentation. Garbage collected language runtimes don't fragment memory, or if they do they can clean it up very easily. Once a C malloc hands you a block of RAM, the OS and language runtime cannot move it around to reduce fragmentation.

Re:Best of luck, Matz... (1)

cratermoon (765155) | more than 2 years ago | (#37329582)

You do know that, except for low-level system code and the vm itself, most of Android is written in Java?

Re:Best of luck, Matz... (0)

Anonymous Coward | more than 2 years ago | (#37330748)

Did you even read what he wrote?

Re:Best of luck, Matz... (1)

chromatic (9471) | more than 2 years ago | (#37332536)

Garbage collected language runtimes don't fragment memory, or if they do they can clean it up very easily.

It's incredibly easy to fragment memory in a language with GC; see Firefox.

With that said, you can use a copying or compacting GC strategy to minimize the possibility, but then you increase your memory requirements to manage the copy and you reduce your cache coherence.

Re:Best of luck, Matz... (0)

Anonymous Coward | more than 2 years ago | (#37330732)

You have no idea what you are talking about, first off, both Objective-C and Java, used on iOS and Android respectively have garbage collection, so whats your point? Secondly, why arbitrarily restrict developers to certain languages on a platform? Is Objective-C or Java "Always" the right tool for the job on these platforms? Probably not. Also, most languages, ruby and python for sure support modules that are written in C if speed/performance is a priority, such as for graphics intensive stuff. Finally, in general, you can generate applications much faster with ruby, python, perl etc... than with C since you are not dealing with low level things such as memory management. There are plenty of reasons for wanting these languages on a mobile platform.

Re:Best of luck, Matz... (0)

Anonymous Coward | more than 2 years ago | (#37334746)

Objective-C as it runs on iOS does not use garbage collection. So, what is your point?

Re:Best of luck, Matz... (1)

shutdown -p now (807394) | more than 2 years ago | (#37331028)

all we'll be left with in short order is anti-geek platforms like Windows Phone and iOS, where running things like Ruby (or Python) are expressly verboten.

I'm not aware of any restrictions regarding writing apps in Python (or any other language) for Windows Phone. The problem is that it doesn't have a Python implementation targeting it - CPython requires a native code compiler, which is not available, and IronPython requires DLR, which relies on certain .NET features not available on WP. It is still quite possible to implement something less efficient than IronPython on WP subset of CLR, and then write apps in it.

As for iOS, it used to have an explicit provision against interpreters, but didn't they take it down? I believe you're still restricted in what you can do if you give the user of an app access to said interpreter, but if you just use it to implement the app itself, it is okay.

I am not sure why... (3, Interesting)

Windwraith (932426) | more than 2 years ago | (#37327956)

...but this statement:

> Of course, mobile computing is the way to go

It kind of depresses me for some reason. I am not being ironic, I am serious. I don't know why that makes me feel down.

I feel like all the training I did to be able to code games** in a PC is going to be obsolete before I know it.

**or any other desktop coding

Re:I am not sure why... (4, Informative)

lynnae (2439544) | more than 2 years ago | (#37328050)

I feel like all the training I did to be able to code games** in a PC is going to be obsolete before I know it.

**or any other desktop coding

welcome to the world of developing.

This is how it's been, and how it will continue to be. Keep growing your skill set and you'll be fine (and a better programmer for it).

Re:I am not sure why... (2)

Windwraith (932426) | more than 2 years ago | (#37328782)

I am not really a professional coder. I don't even work in computer-science related jobs. I just spent my limited brain power into somewhat successfully learning a portable language like C with GL and such.
Because of that, I am not as passionate about coding as many users in Slashdot. For me it's a means to an end (game dev), and a pretty painful one at that.

Without time and resources ($$$) to buy books it was a pretty slow and painful experience (specially because asking for coding stuff usually has 2/3 persons telling you to buy a book), having to learn from short (and at times misleading!) snippets on the internet or theoretical papers that at times barely relate to what you want to actually do.

I only managed to finally master C like one or two years ago.

Thus, I honestly don't know if I am capable of moving over at this point.
Maybe if I knew any other programmer in the flesh I'd be able to relit my fire, but I am the only code literate person that I know of.

(Besides, developing for those devices requires buying one of said device, and in one case I know of, the SDK isn't free. I can't stress the lack of $$ for this enough. I also happened to promise all my games would cost as much as it took to develop them, which is $0.0 until I am either dead or starving to death)

Re:I am not sure why... (1)

royallthefourth (1564389) | more than 2 years ago | (#37329406)

I am not really a professional coder. I don't even work in computer-science related jobs.

Same here; I'm a web developer.

Re:I am not sure why... (1)

gknoy (899301) | more than 2 years ago | (#37329752)

Of course you're capable of moving on. It just takes time and work.

There are books on Android programming - several of them (I like "Hello Android") have great code examples. The Android SDK (and emulator) is free, and uses the (also free) Eclipse IDE. The cook isn't free, but the SDK (and code samples + tutorials from Google) and IDE all cost nothing but your time to download them. Pick something and DO it. You can! You will mainly get better at coding from writing code, so make up a toy application that you are actually interesting in building, and get cracking.

If you're interested in learning a new area of programming, whether it be mobile app development, Mac software, web apps, or embedded programming, there are almost certainly thriving hobbyist communities. Game development is, I expect, a harder domain to crack, given how (relatively) few people use open source versions of stuff. In contrast, the open source community for many other domains are very strong and active -- perhaps in forums, perhaps in IRC, perhaps with wikis full of tutorials.

Reading other code, e.g. driver code, or web app sample code, or Quake 3 engine source code, etc, will ALSO be tremendously informative, but should supplement actual coding on your part. Sometimes a book is best for explaining fundamentals that you don't know you're missing, but there are a lot of freely available books out there. MIT has some really cool computer science textbooks online. Granted, many of them deal a lot with Scheme, which you might be less interested in learning (despite how much I or others might feel that Lisp is awesome, I know it's not something everyone loves).

Keep in mind that the cost of developing a game is not merely the cost of your materials, but the value of the time you spent doing it. You can choose to value that at zero, at a "loss" in hopes of sales, or to value it differently. Pricing is mostly up to you -- but in most phone app stores, the price is "Free or less than a dollar", or no one will buy it, which means that you've already agreed to sell for what the market supports. ;)

Re:I am not sure why... (1)

Windwraith (932426) | more than 2 years ago | (#37330886)

Heh, well, I always thought of "sales" as "players" instead. I never intended to sell any of my (game) work, just hoping that people picks it up and enjoys it.

*old man voice* Come son, listen to my story. (Skip to last paragraph if you don't care :P)

Actually the promise came because someone, years ago, was concerned about starting a game because of costs in software and hardware. Writing my first game was painful but proved that it was possible, took a few months to get the engine rolling (C89 + GL + SDL + Lua) and then 24 hours to do the content using GIMP and Lua scripting (included 56 frames of animation for the player character and several animated tilesets, enemies and effects. GIMP is surprisingly good for sprite art!)

After that I tried to improve the engine but made bad design choices and the whole thing collapsed and the community dissolved shortly after. Real life kept me away from it for some years and I did plenty of code for a bunch of FOSS games (mostly roguelikes) and desktop software in the meantime. And at the start of this year my skills were good enough to give it another try, which I started after my hands healed from some sort of bone disease I still don't know anything about. This was on August the first, of this year, to be exact.

So yeah, I moved to C99, started to liberally use GL extensions and GLSL, learned a lot of theory about data structures to make better dungeon generation and data storage stuff...and right now I am with most of the IO (video, audio, mouse/pad input) complete, just needing to add entity logic and content, content, content.

I keep using GIMP for sprite/animation works, and Geany and GCC (DevCPP for win32) for building, Milkytracker for music, Zim to organize docs and planning, gdb and valgrind for debugging, Audacity (+microphone and a lot of luck finding sound from nearby objects) and Milkytracker's "draw sample" function for sound effects...And wikipedia, somehow, is an amazing resource for algorithms and theory.

That's pretty much my story as coder. Perhaps what makes me sad is the realisation that I probably came too late into the game (no pun intended). And that kind of thing is bothersome at the very start of a big project.
I guess can always try console homebrew for those that use C-like languages. I'd like to try HTML5/JS games someday, but I need the speed of native code to pull out my favorite visual effects and insane item systems.
Perhaps I can try a virtual machine with Android when I am done with this game. What languages are available? I don't think the C+Lua+SDL+GL combo is going to work there...or will it?

(By the way the friend I made the promise for was indeed motivated, which is a good thing! The more we are making games, the better!)

Re:I am not sure why... (1)

lynnae (2439544) | more than 2 years ago | (#37331092)

What I do to make it interesting for myself is to decide on one particular application, and then build that application in every language I know, and every language I learn.

It teaches me the differences between the languages, and some of their relative strengths and weaknesses. (plus it gives a portfolio of my work, since the programs I work on for my job are not showcaseable).

Lots of people would be bored to death by that approach, but I bet they each have their own.

If you learn well from books, get them second hand (god knows I won't pay full price for them), or see how decent your local inter-library loan is.

If you can learn well online, there are resources. Take Ruby for example, there are Hello World tutorials, language tutorials, and plain old up and running tutorials.

But I think that the best way to go is to get some comfort with how to get up and running with the language, and then just dive in and develop something, looking up as you go.

If you wanted to learn something like ASP.NET MVC you've got great resources over at asp.net that are free. And the website spark program from Microsoft to get you access to the software you may need.

Re:I am not sure why... (1)

IAmGarethAdams (990037) | more than 2 years ago | (#37328282)

> I am not sure why...

No?

> I feel like all the training I did to be able to code games in a PC is going to be obsolete before I know it.

Oh, there it is!

But really, it's not that mobile computing is "the way to go", just that desktop computing is no longer "the only way to go".

People who've been closed-mindedly programming their Windows apps for years are scared that they now have to think in different terms, be those architectural terms like "do I need to think about 64-bit processors" or "do I need to think about being mobile ready" or social terms like "do I need to think about cloud computing".

Re:I am not sure why... (1)

Windwraith (932426) | more than 2 years ago | (#37329336)

Actually I develop cross-platform FOSS games, not really stuck with Windows apps you know ;)
That I code games doesn't mean I don't take it seriously, despite (as pointed in other post) not being as passionate about it as other people here.

To be honest, I find portable devices to be expensive and not powerful at all.
In my lunch break, with my cheap netbook, I can do everything I can do at home (2D work, 3D work, coding, tracker music, compiling, debugging, etc). It's the only way to develop a game while having an unrelated full-day work, IMO.

I don't feel phones and tablets went that far from the PDA except by being gifted with a modern web browser.
With a mobile device, I'd only be able to watch videos and use online stuff like twitter or web browsing/mail/webapps.

You can argue that compiling and drawing is not the task for a phone...well, why not? They got everything else by now!

Note that I would like to be proven wrong. That'd give me some hope actually.

Re:I am not sure why... (1)

TheLink (130905) | more than 2 years ago | (#37331244)

Speaking of cross platform, I wrote a program in perl that works on OSX, Solaris, OpenSolaris, AIX, Linux (Ubuntu, RedHat, etc).

The main problem I'm facing is the Linux distros don't generally include libraries that allow my program to easily make https connections (http works).

Compiling the https stuff for each and every distro (and significant version) and bundling them sucks.

I'm not aware of many ways around it. I need the stuff to be able to run on as many OSes and OS versions as possible, and the download package should not be huge.

So how do you deal with all this cross platform stuff? Do you compile for each and every target platform?

Re:I am not sure why... (1)

Windwraith (932426) | more than 2 years ago | (#37334522)

Well, yes, I actually do different builds for and in my target platforms. It's an extremely brute and simple approach but never had a complaint from users.
For the rest I provide the sources and detailed install instructions (download this, open this, type this, done) and a dummy build script in bash for those without autotools, and a more precise script for those with debian systems (fetches and builds everything).

Re:I am not sure why... (1)

TheLink (130905) | more than 2 years ago | (#37340480)

Thanks. How do you deal with stuff like different versions/releases of Suse, OpenSUSE, different versions of Redhat, Ubuntu, Debian, Mint, Fedora, etc.

Do you find that in practice they tend to be backward compatible within the distro? So you just build for the oldest supported distro (with latest backported patches of libs if possible - ugh) and it works on the new distros?

Or do you find you end up having to build for each distro version? If so it probably means that we might not bother with supporting "Linux" - too much work for too little benefit. Either that or customers have to build and install the https stuff themselves (or do without https).

I'll probably have to test for myself, but it's often good to know what others have done instead of reinventing the wheel or making the same mistakes all over again :).

Re:I am not sure why... (0)

Anonymous Coward | more than 2 years ago | (#37330018)

Microcontroller designers are scoffing in their dark, shadowy corners

Re:I am not sure why... (4, Insightful)

vlm (69642) | more than 2 years ago | (#37328416)

I feel like all the training I did to be able to code games** in a PC is going to be obsolete before I know it.

Training rapidly becomes useless. Education never becomes useless.

Memorize how to use a linked list library in Pascal = rapidly useless

Learn what a linked list is, why and when you'd use it = useful forever

Also much like human languages (supposedly) the first three languages are pretty tough, but once you learn a bit of ten or so, its pretty simple since all the concepts are the same. The hard part is knowing how to index thru an array without a picket fence mistake and figuring out how to troubleshoot it. The easy part is remembering or googling the syntax.

picket fence mistake? (2)

opencity (582224) | more than 2 years ago | (#37328650)

I'm a kludgy self taught coder and I just googled for a moment to no avail ... can you help this perma-newb out:
What is a "picket fence mistake"?

Re:picket fence mistake? (2)

byner (1428013) | more than 2 years ago | (#37328792)

When building a fence, if you put a post say every meter, how many posts do you need for a 10m section of fence?

It's an example illustrating an one-off error. It's pretty common to get this or similar problems wrong and catch yourself later.

Re:picket fence mistake? (0)

Anonymous Coward | more than 2 years ago | (#37329996)

ahh, I was thinking picket fence error involved incrementing your index twice and skipping over every other element.

Re:picket fence mistake? (0)

Anonymous Coward | more than 2 years ago | (#37328828)

More usually called a 'fencepost error'. It's a class of off-by-one error: you have 10 posts with 9 spaces between them.

Re:picket fence mistake? (0)

Anonymous Coward | more than 2 years ago | (#37329068)

That's a 9m fence. :-)

Re:picket fence mistake? (1)

turbidostato (878842) | more than 2 years ago | (#37330766)

Hence the fencepost error: he either said that intentionally, which makes for quite a sardonic sense of humor, or he didn't, which quite makes his point.

Re:picket fence mistake? (1)

PoopCat (2218334) | more than 2 years ago | (#37329248)

And you just committed the error in public. A 10m section of fence requires 11 posts, unless you ignore that pesky last metre. If this is too hard to grasp: consider a 2m long fence. You'll have a post at the beginning, one in the middle, and one at the end. Total: 3 posts, 2 spaces.

Re:picket fence mistake? (1)

lynnae (2439544) | more than 2 years ago | (#37330584)

think there needs to be a campaign to rename these common errors more sensibly.

I'm not sure screwing up index vs count/length deserves some fancy name other than IndexOutOfRange error

Re:picket fence mistake? (1)

stewbee (1019450) | more than 2 years ago | (#37329260)

As a better answer to the two others who posted, I will give an example. C and C++ (and others) start array indexing from zero.If you have a 10 element array, in C/C++ you would access the last element as myarray[9]. You know that you have 10 elements, and if you are not careful you might try to index the last element as myarray[10]. This will generally cause errors in you program and you hope the compiler can catch them for you. In languages like C/C++, this could even be a hidden error since if you are not careful with your pointers, you could access data outside of the array and the program would keep on chugging along without throwing an error since the compiler may not be able to catch the error. If you are lucky, you will be a runtime error, but that can be difficult to track down.

this type of error is generally called a fence post error.

Re:picket fence mistake? (1)

opencity (582224) | more than 2 years ago | (#37329492)

I get it. Thanks. I learned perl way back when to avoid malloc but should probably go back and get closer to the machine.

Re:I am not sure why... (1)

Windwraith (932426) | more than 2 years ago | (#37329814)

You got a good point, and fortunately learning how to do those in C gives you enough understanding to do them in...Lua, for example. Or Ruby to stay on-topic.

Re:I am not sure why... (1)

TheLink (130905) | more than 2 years ago | (#37330992)

The stationary computers aren't going to vanish.

The mobile devices (pagers, portable gaming devices, phones, laptops, tablets, prosthetic brains) are the ones that will be squeezed into one device. And that's where the extinctions will be.

Most people don't want to carry so many extra portable devices.

So if you had a prosthetic brain that did everything a phone did (and more: virtual telepathy, virtual telekinesis), you would be tempted to not carry a phone - especially if the antenna wasn't passing near any important organs ;).

Whereas you may still keep a home server around to control your home and make all that virtual telekinesis stuff possible.

Some people would still want high performance too: rendering low-latency real time stereoscopic 3D graphics on wall-sized screens would likely still take more CPU/GPU power than available in a portable computing device.

Re:I am not sure why... (1)

genghisjahn (1344927) | more than 2 years ago | (#37331186)

All that VB5 stuff I did back in the 90s...all that work learning DAO, RDO and ADO...no one cars now...sniff. Good thing I learned C#, Ruby and Objective C...

Yes mobile is the way (1)

Osgeld (1900440) | more than 2 years ago | (#37328118)

Mobiles today are about the same power as desktops were when anyone cared about ruby so it should fit well

Re:Yes mobile is the way (0)

Anonymous Coward | more than 2 years ago | (#37328600)

Mobiles today are about the same power as desktops were when anyone cared about ruby so it should fit well

Hurr durr I bet you're the funniest d00d in your mom's basement!

Re:Yes mobile is the way (1)

Osgeld (1900440) | more than 2 years ago | (#37329480)

least I am brave enough to sign in before trolling

ARGGHHH (0)

Anonymous Coward | more than 2 years ago | (#37328170)

Why does everything have to be on mobile devices. Aren't there better things for language developers to do with their time?

Re:ARGGHHH (0)

somersault (912633) | more than 2 years ago | (#37328964)

I suppose you preferred when computers filled whole rooms? Our computers have always been getting smaller, which automatically makes them more practical and useful!

Re:ARGGHHH (1)

lynnae (2439544) | more than 2 years ago | (#37330500)

reading over the comments here, it seems a number of people see no use in trying to innovate. Or can acknowledge that there may be better ways than the status-quo :D

What I want to know... (2)

smooth wombat (796938) | more than 2 years ago | (#37328318)

how hard was it to find shoes in the correct color then add all those sequins? I mean, I've seen the pair at the Smithsonian but it's my understanding there were others made as well.

Also, did Dorothy get to keep a pair?

Bad Ruby Experience (0)

lee1 (219161) | more than 2 years ago | (#37328548)

I tried to install a program written in Ruby and the experience left me with a very bad impression [lee-phillips.org] of the Ruby ecosystem.

Re:Bad Ruby Experience (1)

somersault (912633) | more than 2 years ago | (#37329048)

I had similarly annoying experiences with updating stuff on OSX. It could do with a nice package manager.

Re:Bad Ruby Experience (1)

lee1 (219161) | more than 2 years ago | (#37329172)

I agree (and no, Fink, etc., don't cut it). It's one of the reasons I prefer Linux and only use OSX if I have to.

Re:Bad Ruby Experience (1)

mooingyak (720677) | more than 2 years ago | (#37329078)

FWIW, the difference between the 1.8 and 1.9 versions is effectively a major version change despite not being numbered that way.

Re:Bad Ruby Experience (0)

Anonymous Coward | more than 2 years ago | (#37329228)

This kind of experience is hardly unique to Ruby. Once you're off the beaten path of what your distro has, or what pre-built packages are available, then you're on your own, more or less. You mention you were on a Mac. Unfortunately Apple ships some old software, which is where macports comes in. It's not perfect but does fill in a gap left by Apple.

Re:Bad Ruby Experience (1)

lee1 (219161) | more than 2 years ago | (#37329440)

I've compiled and installed plenty of "unofficial" stuff on OSX and Linux. My experience with the Ruby thing was the first time I've encountered syntax errors in libraries that were part of the official distribution. I intend to stay away.

Re:Bad Ruby Experience (1)

lee1 (219161) | more than 2 years ago | (#37335164)

And I see I hit a nerve with someone who modded me "offtopic." Nothing hurts like the truth.

Ruby sucks for desktop apps (0)

Anonymous Coward | more than 2 years ago | (#37329380)

First, let me say I'm a bonafied certified Ruby FREAK (and I've never written a single web app)! So much so, that I spend hours trying to figure out how to bend Ruby into a project instead of finding a more natural tool. My biggest frustration is wanting to distribute a Ruby coded project with GUI to a cross platform audience (often just me). I mean without having to use 4 to 6 different frameworks/IDE's/gems/git-checkouts/etc. I want one "just works", supported, anointed, blessed, Golden way to write a desktop GUI app that I can send to a Windows/Mac/Linux user and they can unzip/untar and run it. That's all I want. Is it just too much to ask?

programming languages (1)

cratermoon (765155) | more than 2 years ago | (#37329674)

Ruby is a nice little language. There are a few oddities and the C Ruby interpreter, as Matz admitted, is not very efficient.

Rails, which is what everyone thinks of when they hear Ruby, on the other hand -- well, I'll stay far away from it thanks.

Count me among those developers who never thought that the way to build robust and flexible applications is to first define some database tables, then write a little CRUD code to generate screens. Maybe back in 1989, when SQL databases were new and there were a lot of dumb data entry tasks to automate, and even then, I'm not so sure.

Re:programming languages (0)

Anonymous Coward | more than 2 years ago | (#37329950)

What does "write a little CRUD code to generate screens" is supposed to mean in the context of Rails? I've developed with rails, and that is a step that I've never come across. You can generate code, sure. You can also write a little CRUD code, if so you choose. Obviously generating code gives one the ability to generate code for a screen or 'view' as it is normally referred to, a sometimes useful option. One can generate a little CRUD code also, an option often not utilized once a certain understanding of rails is gained.

The point is that Rails is slanted towards developing using REST as the foundational architecture for querying and manipulating data. That is by design, and many other web development frameworks are slanted towards this approach, mainly because they sit on top of HTTP, which, also by design, is REST. As such, the framework is most suited to act as a thin layer of translating HTTP verbs into SQL (or other data-source if applicable) operations.

This all leads to development with constraints in mind. One can leverage this composition of constraints to help himself guide the overall architecture of the project. This leads to consistency. It makes anomalies stand out. It forces one to make a clear decision regarding exceptions (not the errors, but patterns that do not fit neatly into REST). And, perhaps most importantly, it makes the entire system very predictable and much easier to comprehend as a whole.

Your decision to grow facial hair (1)

bigsexyjoe (581721) | more than 2 years ago | (#37331154)

Matsumoto, when you created Ruby you did not have facial hair. But shortly after growing some, Rails came out and changed everything. Now Ruby is popular. Do you feel this is connected to your facial hair?

Re:Your decision to grow facial hair (1)

larry bagina (561269) | more than 2 years ago | (#37331928)

It's more complicated than that. For you see, when he started growing facial hair, he started waxing his cock, balls, taint and asshole. (It's some sort of ying/yang thing). Hairy crotch, ruby languishes. Bald balls, ruby flourishes.
Check for New Comments
Slashdot Account

Need an Account?

Forgot your password?

Don't worry, we never post anything without your permission.

Submission Text Formatting Tips

We support a small subset of HTML, namely these tags:

  • b
  • i
  • p
  • br
  • a
  • ol
  • ul
  • li
  • dl
  • dt
  • dd
  • em
  • strong
  • tt
  • blockquote
  • div
  • quote
  • ecode

"ecode" can be used for code snippets, for example:

<ecode>    while(1) { do_something(); } </ecode>
Create a Slashdot Account

Loading...