What If Ruby Had Final Variables Like Java Or Erlang?

After a long confusing Ruby debate today at OpenRain on the merits of functional, Erlang-esque write-once-read-many variables, I’m going to step onto the podium and just say it… Ruby should get “final” or “const” variables in a similar semantic style to Java, except at runtime. Rather than ramble on for 12 paragraphs explaining exactly how this might work, read this fictitious Ruby code snippet instead. (Optional: Also check out the chapter on “final” in Hardcore Java.)
Final variables like this are really just an inline TDD mechanism.
Allowing local stack data to be constant provides no functional enhancements to the software, but alleviates the need for certain types of tests by using the compiler and/or runtime to assert certain memory is immutable. The “friend_best” method variant in the code snippet would obviously break most existing Ruby programs, but ups the bar for defensive programming by preventing many common bugs out-of-the-box while still providing support for traditional Ruby variables. At the very least we should have something like “friend_better”. Adding this information to the parse tree will also make it easier for IDEs to provide features more easily implemented for static languages.
TDD/BDD is in–no qualms about it–but we can make our code safer, cleaner and more concise by applying some of the lessons learned by our statically-typed language cousins over the last few decades.
Tags: code, development, erlang, final, java, openrain, opinion, pastie, programming, ruby
Welcomed To The RRoD Club, Part 3
I sat down 30 minutes ago to enjoy a final quiet hour of gaming before starting my next class tomorrow, and Microsoft kindly reminded me why I no longer use their other computing products.. yet again. First, the damn console insisted on crashing 3 times in about 5 minutes while playing Fable off of Xbox Live Arcade. The 360 just does that sometimes. Yeah.
But then…
Microsoft FAIL. Is there a Frequent RRoD Club or something? I feel like I should be accumulating RRoD miles.
Tags: fail, microsoft, rrod, xbox 360
Speaking Twice At ABLEconf: Saturday, September 20th, 2008
I’ll be giving two sessions this Saturday, September 20th, 2008 at ABLEconf: Arizona Business and Liberty Experience hosted at the University of Advancing Technology. The first will be a ~50 minute getting-started-with-ruby-on-rails type session aimed at developers similar to the one I’m giving this Wednesday for Joe Developer. The second will be a plug-heavy talk over how OpenRain does F/OSS-friendly web development in the commercial space using F/OSS software and tools, targeted for a business-minded crowd.
ABLEconf is a new event so I’m not sure what to expect, though I’d put my money on a lot of systems-level event content since much of the participation seems to be from local Linux groups.
Tags: ableconf, announcement, event, howto, rails, ror, ruby, session, speaking, uat
Presenting At September 2008 Phoenix Ruby Users Group
I’ll be presenting at the September 2008 Phoenix Ruby Users Group on Monday, September 8th, covering development of Ruby peer-to-peer applications using OpenRain’s latest gem release, Journeta. Topics will include Ruby’s threading model, basic networking review, Journeta usage, and live demos. 6:30PM, here.
[Location Details] [PRUG Google Group]
See you there!
Tags: announcement, event, journeta, openrain, peer-to-peer, presentation, ruby, threading
Handling Self Doubt
I’m an engineer. Always have been. I cronically worry about small flaws which could spiral into unsalvagable disaster, and spend a great deal of time focusing on risk mitigation. I can thus completely identify with Riyad’s “cronic almost-achievement” issue because I felt like a raging victim of self-imposed mediocrity up until several years ago. I realize I can be harsh in self-judgement, but nevertheless came to several conclusions..
- I have tons of great ideas that aren’t going anywhere. (..or worse, are getting somewhere but at a pace slower than the end goal is moving.)
- I really don’t like being told I suck.
Any leader that says they can completely shrug off even the most meaningless criticism is full of crap. Putting yourself on the line by saying, “I did something. Check it out.”, dangles your ego over a boiling pot of water. You know the potential for greatest is there–you wouldn’t have done it in the first place if you thought it was a bad idea–but your heart still sinks when you’re about to demonstrate your competence level to the public at large and have absolutely no guarantees on the outcome. Ego roulette is clearly not an engineers game.
…but then, I decided to change.
- If I have a great idea and the time/resources to pull it off well, I’m going to look fear straight in the eyes and tell him to STFU.
- I’m done with looking back and saying “I should have done more.” Whether it’s writing about a controversial opinion or pulling people out of a car wreck, no more inaction. Maybe I’ll collect an inbox full of hate mail or painfully burn to death in a firey explosion. So be it. At least I tried to change the world and did my part to the best of my ability. “You must be the change you want to see in the world.” -Mahatma Gandhi.
Now, I still have the same self doubt and self confidence issues at the next guy, but I finally feel like I’m doing something about it. And doing something is an engineers mantra. I’ve you’ve really got a great idea, it’s infinitely more important than your fragile ego. Here’s a couple of thoughts that may help entrepreneurial pessimists like myself..
- If you screw up on project XYZ, no one is going to care in 5 years. Take the small wins and build on them. It’ll feel good.
- What’s the worst that can happen? ..people will laugh at you? …you’ll loose your investment? …you’ll have to go back to your day job? Are those the best reasons you can come up with? Really!? *Please* … If you’re reading this you’ve got food, water, shelter, internet access and probably some good folks to lean on should things get tough. That’s more than most of the worlds population, so quit whining on the $10K it’ll take to do that new project and take a calculated risk. Even failure can feel good when you know you did all you could. You’re going to regret it if you don’t.
- Criticism is the easiest form of feedback, so there will always be haters and sometimes more negative commentary than positive. Learn to extract the meaning from the negative feedback, remember that those with the loudest voices don’t necessarily represent the population, and make it an opportunity to hone your game rather than pity yourself.
Tags: advice, business, doubt, entrepreneurship, leadership





