Categories
Development

JavaScript, not for everything

Ecstortive: “I find it pretty amusing when people are doing benchmarks of some solid technology stack to NodeJS, and declaring NodeJS to be the fastest thing on earth (just Google NodeJS vs *anything that comes to your mind* and you’ll find results like this, this, and what not). Beyond any doubt NodeJS model is worth attention, but will I use it in my production environment? I doubt that. I’ve worked on NodeJS on real serious basis; and experience was pretty bad.”

Your mileage my vary, and I’m not a fan of JavaScript, so take this sort of post with a grain of salt. Native, compiled code, tends to be faster.

Scripting languages have their place, and JavaScript is definitely baked into the fabric of the web, but maybe it’s best suited for the browser?

Categories
Development

My Development Setup

I’ve seen a lot of developers share their workspaces and their dev setup. They’re usually really nice and include their offices as well as their computers.

I don’t have an incredible setup, or an office for that matter, but I thought I’d share my minimalist setup that I used to code RxCalc and the Fresno Grizzlies App.

My Development Setup 2011Most of my development life has been spent on Windows and I’ve always used as much horsepower as I could get. When I started doing iOS development I didn’t have a computer, but my wife did. She has a white 13-inch MacBook. When I ordered if for her I upgraded it to 4GB of RAM and a 320GB hard drive and it’s proven to be plenty good enough to develop iOS applications. She uses it during the day, I get it at night and on the weekends. Not a bad deal, and we’ve only managed to consume 100GB of the 320GB drive.

So, yes, that’s right. I actually use my wife’s MacBook to develop iOS applications, and I hope to use it soon to develop a new Mac Application.

One of these days I hope to actually buy a 15-inch MacBook Pro of my own. Until then, this’ll do just fine.

Categories
Business Development

Dave Winer, at it again.

Dave Winer: “Anyway, this is a heads-up that I will be publishing the spec as a draft in the next few days. But first I want to establish the motivation (that’s the purpose of this piece), then explain the philosophy about standards (this is in no way intended to be one) and what prior art influenced me. If other people find this useful, I hope there will be implementations in other languages. And there will need to be ancillary services.”

Dave, thanks for doing this. Thanks for your continued efforts to build the open web.

Categories
Design Development

Lighting & Realism In Interface Design

Design then CodeDesign then Code, by Mike Rundle (@flyosity): “Lighting & Realism In Interface Design is an introduction to designing beautiful, realistic interfaces in Photoshop. It explains the physics of real world lighting, how gradients, shadows and highlights are created, and how to use Layer Styles to design buttons, panels and more. Finally, it steps through how to design interface elements from Twitter for Mac and Calcbot for iPhone.”

Mike continues to kick butt in his Design then Code series. This is a must buy for me.

Categories
Development

Reusing your code investment

RibbitSomething I’ve always loved doing is creating frameworks for other developers to use. I’ve also had the pleasure of working on some wonderful developer tools during my career. First at Visio then later at Pelco.

Code Investment

Some companies, like Adobe and Pelco, have built frameworks over time to help deal with abstracting OS specific things into reusable components. These reusable components are built to allow the developer to focus on features and not worry about how to do it per OS. Windows, Mac OS X, and Linux have similar philosophies but specific libraries and models to support their OS. There is a point they do cross however. C and C++ are supported by all three of these platforms and are still in wide use across them.

If API’s vary across systems you have to provide an abstraction for developers if you want to support multiple OS’s. Depending on the level of portability you’re interested in you can end up with a large framework that does everything the same on all platforms, but this can result in lowest common denominator framework, but I digress.

That investment is time consuming but often times well worth because the developers using it can move quickly and get great results on multiple platforms. I saw this first hand at Pelco where I had the pleasure of working with a group of crazy smart people that delivered a cross platform Media Framework for video, audio, and metadata. It’s now used by many groups in the organization, in may different ways. A true success.

How do you do it?

For lower level things it tends to be a bit easier. You can stick to the CRT (C Runtime) for a lot of things. You also tend to typedef things so you end up with matching intrinsic, system defined, and framework defined types. Again, so the developer doesn’t have to spend time thinking about it.

Let’s say you’re writing a C++ class library, or framework. The objects provided by the framework would provide the abstraction.

Big Changes

This leads me to the point of this post. What happens when you have years of investment and the OS vendor makes a HUGE change to their API and development model? The Adobe Photoshop team faced this very hurdle, and managed to get through it. I linked to a post by Adobe’s John Nack that touches on their struggle to bring Photoshop into the Objective-C/Cocoa world(I’d love to see that code.) Objective-C and Cocoa are Apple’s preferred language and API(framework) for creating Mac OS applications. If you’ve ever looked at Objective-C it’s a strange mix of C and Smalltalk, but it maintains support for its C lineage, which allows you to mix C, C++, and Objective-C all in the same file. This is what allowed Adobe, and others, to bring applications into the new model. Hopefully by leveraging their frameworks abstraction from the OS.

I’ve created an example, granted it’s very simple, but it illustrates the point of a framework abstraction. In my example I’ve only created the Mac side of a C++ framework I called GrilledCheese because these abstractions form a kind of sandwich. The application is the top piece of bread, the middle is the abstraction, or framework, and the bottom piece of bread is the native OS layer. Here’s an example of drawing a rectangle in an abstract framework using Objective-C and Cocoa inside a C++ class.

void GrilledCheeseMac::DrawRectangle
(
	int x, 
	int y, 
	int width, 
	int height
)
{
	// Create a rect from our coordinates.
	NSRect rect = NSMakeRect(
					(CGFloat)x, 
					(CGFloat)y, 
					(CGFloat)width, 
					(CGFloat)height);
	NSFrameRect(rect);
	
} // DrawRectangle

Here’s that same method implemented on Windows using Windows GDI functions.

void GrilledCheeseWin::DrawRectangle
(
	int x, 
	int y, 
	int width, 
	int height
)
{
	HDC hdc = ::GetDC(_hWnd);
	if (hdc)
	{
		::Rectangle(hdc, x, y, x+width, y+height);
		::ReleaseDC(_hWnd, hdc);
	}
} // DrawRectangle

From the application developers viewpoint they would use this method exactly the same on all platforms. No need to fret over how to do it for Windows, Mac, and Linux. They’re used exactly the same way for all. Like this.

GrilledCheese* gc = new GrilledCheese();
if (gc)
{
    gc->DrawRect(0, 0, 20, 20);
    delete gc;
}

There is something to note in our example. In the example the class is named GrilledCheeseMac. This is where a typedef would come in handy.

E.G.

typedef GrilledCheeseMac GrilledCheese;

On Windows it may look like…

typedef GrilledCheeseWin GrilledCheese;

There you have it.

Please note, this is just one possible way to do things, and the example is overly simple to make the point.

There are definitely more ways than one to skin this cat.

Categories
Development

Windows 8 Speculation

Duct tape makes the world go 'round!A co-worker, thanks Sudeep, turned me on to a great Windows 8 article on Ars Technica and that got me thinking. The article talks about an updated set of API’s for C++ applications and a new set of managed .Net API’s that get closer to the machine, which is a great thing. It sounds like we’ll have peer un-managed and managed layers, but…

What about the Windows API?

The article talks about WinRT, the new C++ API’s, and DirectUI, the un-managed API’s, but it doesn’t say a word about the “old” Windows API’s. There are tons of applications written against that set of API’s so they cannot go away, at least for now. That begs the question “What about the Windows API?”

The answer is, it will be there, but where? It’s time Microsoft moved toward a modern model right down in the OS. These transitions are never easy, but it can be done. When Steve Jobs came back to Apple and we were given OS X Apple made a decision to move toward Objective-C and Cocoa as their modern model and support the old C-style Mac API’s(Carbon) so legacy applications, like Photoshop, could move to the new OS. At that time Apple said they would abandon that support in the future, and they managed to support it for about 10 years. With Snow Leopard they decided not to bring all of Carbon forward, which was painful for Adobe and others. I guess my point is the old Windows API will need to stay around for a while, and the transition to WinRT could be painful, but definitely doable. Part of Microsoft’s strength, and weakness, has always been backward compatibility. It looks like they’re finally ready to make a bold change. Good for us.

How will it look?

That’s a great question. I wish I had a definitive answer, but I could see three possible scenarios, maybe there are more?

Here’s what I think could happen.(Click for a larger image.)

Windows 8 Speculation

Categories
Business Development

A Common Mistake

Dave Winer: “Why, as a creative person, did I have to become a corporate executive? That was a mistake. Good software, like anything creative, is made by people who focus on product, not business. Managing a company, raising money, dealing with crises of all kinds, took me away from the thing I do best, and love, which is create.”

This is a common mistake made at a lot of software companies. You take a great software developer and reward him, or her, by making them a manager. Sure there are still problems to solve but one of your best resources will now spend time solving problems not related to technology. They’ll have to deal with people problems and a lot of the time they’re no equipped to do that.

If a techie is completely happy building product, let them build product, if they have a desire to become a manager give them a shot, but don’t be too surprised if they come back at some point and ask to go back to coding. It happens.

Categories
Development Indie

Friday the 13th, bad for iOS Devs

It’s a beautiful day here in San Luis Obispo, the sun is out and there’s a cool breeze blowing, but there’s something bad afoot in the iOS Development world.

As of this writing two Indie iOS Developers, James Thomson and Patrick McCarron, have been hit with patent infringement papers. The really strange thing is they’re going after the developers, not Apple. In app purchase seems to be what triggered the threat.

From Twitter

Hopefully Apple will step in and help them out.

Categories
Development Mobile

10 Reasons to Love webOS

webOS Developer Blog: “There comes a time in a Linux-loving geek’s life when he or she needs a new challenge. Making desktop apps isn’t hacking it anymore and building yet-another-website seems passe. If you want to jump into the world of mobile, here are a few reasons why HP webOS is the platform for you.”

This platform is especially friendly to web oriented developers; HTML, CSS, etc. Guys like me, well, we’re left standing around wondering what the heck a div is and why you should use it. I guess I should learn how all this markup stuff works and just go with the flow.

Someday.

Categories
Development

Jekyll, fully baked?

Tom Preston-Werner: “On Sunday, October 19th, I sat down in my San Francisco apartment with a glass of apple cider and a clear mind. After a period of reflection, I had an idea. While I’m not specifically trained as an author of prose, I am trained as an author of code. What would happen if I approached blogging from a software development perspective? What would that look like?”

Tom is the co-founder of GitHub, so you know the guys has coding chops. Jekyll is a very cool, very minimal, publishing system. I did some reading last night and was pretty excited about his ideas, but where it goes off the rails for me is using git to store your posts. It’s so close to something I could build upon.

Watch out! It's a blog fly!I think it’s time to go create my own publishing system. Why? Because I can and I want to. No better reason than that. This is a great excuse to learn Ruby. I don’t believe I’ll need Rails, all I need is a system that can publish a file into a directory structure after generating a static HTML file from Markdown, or maybe raw HTML as the source, it doesn’t matter. Once I have that I can build a simple web UI for entering posts from any device and I’ll bolt on support for the MetaWeblog API so I can use the desktop tool I like; MarsEdit.

That’s all I really need. A couple of apps that live on the server, one that generates the weblog, and one that can receive MetaWeblog requests and run the thing that generates the weblog. That’s the 30,000 foot view, it’s only slightly more complex than that.

Will I ever get around to doing it? Probably not. This would make at least the third weblogging/publishing system I’ve dreamed up in the last 10 years of weblogging, but it’s also the easiest to implement. All three were going to be static publishing systems. That’s still something I obsess about, dynamic just doesn’t matter to me.

Well what about widgets and comments? Good question. I have an answer. I don’t care about widgets that add dynamic content. I have a very small set of requirements. Look at this weblog today. What dynamic content do I have? Yep, my last tweet is displayed, what else? Nothing! That’s the beauty of it. As for comments I could use Disqus. Problem solved.

I want to create a system anyone could install on their own servers and use. created Second Crack to fill his weblogging needs but it’s a bit too hackerish for me, unless he’s taken it to the next level recently? I don’t know, but like Marco I want something just complex enough to fill my needs. I’d also like it to be simple enough to install and use that others could enjoy it without being developer minded.

It’s nice to write it down, but I doubt I’ll ever have time to develop it.