Every once in a while, you can teach an old dog new tricks. This old dog has learned a few in recent months, so I wanted to throw them out there for giggles. Templates, Method Overloading and Superclasses, oh my! I recently ran into a case where I wanted to make a specialized subclass of a C++ template class so that I could override some of its functionality for testing purposes. The really odd part about it was the fact that I eventually wanted to call through to the base class' functionality to perform the original work -- I just
July 2008 Archives
Reader Jef requested a hands-on tutorial with the new attribute feature via the Suggestion Box, and I am only too happy to oblige. This topic has been blogged about once or twice, so I won't go into many details about what attributes are or why you'd use them. Instead, this will be a very quick and dirty couple of usage examples. Let's start with an easy example: deprecating an API. Let's say you've got a very large framework (either internal, or external), and you want to start to steer people away from an API because it's horrible. Well, the best
It's pretty incredible, but I've reached a new milestone today... this marks the 1000th blog posting here on Ramblings! Over the course of the past four years, I've had 1000 blog postings, and just under 8000 comments, which is pretty amazing considering the fact that I never really considered myself to be a blogger. My blogging origins started with the original "Ramblings" comic strip that I started back in 2003. It was a hand-coded site that my friend Adam put together for me. I used to draw all of my comics using The Gimp on various Linux OSes (mostly Gentoo),
Long time reader and all-around great guy, Bob asked via the Suggestion Box to comment on the best practices for coding in REALbasic. Unfortunately, this is an incredibly difficult thing to really discuss because it's such a huge topic! I'm going to try to keep away from general coding practices such as "always comment your code" and "write your code like a serial killer has to maintain it and they know where you sleep." ;-) Test early, test often. Yes, REALbasic is a cross-platform tool that allows you to design your code on one platform and deploy to another. It's
Why it seems like just a few weeks ago I had written a similar blog posting... We're trying something a bit new in response to customer feedback this time around. We're reintroducing the idea of a point release into the REALbasic release cycle, and r3.1 is our first attempt at it. This release fixes some issues that cropped up in r3 that we felt were important to fix ASAP. You may be wondering a bit about what the heck this whole point release thing is, and what it means, why it happens, etc. So let me explain as best I
While playing around with the idea of allowing users to explicitly specify the type for a const statement, I realized that it might be equally as interesting to play around with the idea of not requiring a type in a Dim statement so long as there's an assignment present. It would look very similar to the way Const works today: Dim foo = 12 Now, don't start thinking that REALbasic is going to become VBScript and lose type safety, because that's not going to happen! The right-hand side of the declaration has a concrete type -- Integer. So we can
It continually suprises me how frequently I get into a conversation about the RB compiler, and I realize that the person I'm speaking to doesn't really know all the pieces and parts. I'm so used to thinking about it that it's easy for me to forget that it's not second nature to most people. So I want to spend a little while explaining the high-level architecture of the RB compiler. This should help you to understand how your REALbasic projects turn into executable files. The first thing to understand is that the compiler deals only with plain old source code
Turn the wayback machine's hands back to the late 90s, and you'll notice that REALbasic has very few datatypes. Basically, there's Boolean, Integer, Single, Double, String, Color and Object. If you wanted to make a constant, you really only had to pick between Boolean, integer, float, string or color -- there's no ambiguity there, since it's very easy to ignore Singles. ;-) So the original Const statement in REALbasic didn't allow you to pick the type, it just inferred it at compile time from the right-hand side of the assignment. Now we come back to today's REALbasic, and there are
One of the more often-requested compiler features has been implemented in 2008 Release 3, which is the ability to put types within classes. This means that you can create structures, enumerations and delegates all inside of a class, instead of only within a module. Very handy stuff! One thing someone asked during the dev cycle for this was: "why can't I put these into an interface?" The reason is: interfaces make a contractual promise -- they do not provide any sort of implementation to them. A type declaration is providing implementation, really. Who "owns" the declaration? The interface, or the
One of my favorite new features of 2008r3 is definitely the "warning" system. I believe that it's going to help people to understand the more hairy spots in their code base, and do so in an unintrusive fashion. My big beef with the way most compilers handle warnings is that they're always in your face. If you're starting a project from scratch, it's not that big of a deal. But if you're jumping into the middle of a code base that you inherit, it's actually terrible -- it causes you to ignore warnings, which could very well point out bugs
One of the new compiler features of 2008r3 are "attributes", which are a powerful language feature that enable you to specify compile-time metadata attached to a code item. If you work in .NET languages, then you've probably encountered this sort of feature before. If attributes are an entirely new concept to you, then this blog posting will hopefully help you to understand them. When you make a property, what you are doing is creating a named piece of storage that can be accessed at runtime. Attributes are very similar in that they're a named piece of storage to hold information.
2008r3 was release today, which marks the 20th release for me since joining Real Software! It's been over six years since I started working for RS, and what a neat trip it's been. So what's new in the latest release? A whole lot of awesomeness, that's what! This release comes with a really useful new feature for Pro users: the profiler. The profiler allows you to get an idea of what performance problem areas there are in your application by automatically adding timing code to each method. When your application exits gracefully, then the timining information is consolidated into an
I'd like to draw your attention to a new link here on the blog -- the "Suggestion Box." Believe it or not, but I sometimes have a difficult time coming up with topics to blog about. So the suggestion box is a place for you to leave me a note with some recommendations. If you ever stumble on some sort of question that you think would be interesting to have answered in a public way, please post it there. I'll periodically peek into the box when I'm looking for blogging topics, and try to keep the list managed. As I
My vacation is sadly coming to its end, and I head back to Riverside today. It's been a really wonderful break from the "real world", and I don't particularly want to go back. ;-) On the 21st, Elissa and I had a wedding reception for all the MN folks who couldn't make it down to our wedding in TX. We had a really nice turn out, about 60 people or so showed up. The festivities were from 1-4, but we were entertaining guests from 10am until 10pm! It was a lot of fun to see family and friends again, and