Tuesday, October 18, 2011

Geb ain't just some country hick!

Started using Geb (http://www.gebish.org/) for some simple UI automations to run via Jenkins.  Basically, login to several instances of our app every half an hour and make sure something infrastructure-wise has not taken our app down.  Only issue is something with the network (proxy config etc.) makes it run REAL slow so far...

>>>
@Grapes([
    @Grab("org.codehaus.geb:geb-core:0.6.0"),
    @Grab("org.seleniumhq.selenium:selenium-firefox-driver:2.0rc3")
])
import geb.*
import org.openqa.selenium.firefox.FirefoxDriver

class LoginPage extends Page {
    static url = ""
   
    static content = {
        submitButton(to: MainPage) { $("input", type: "button", name: "signin") }
        usernameInput() { $("input", type: "text", name: "usernameInput") }
        passwordInput() { $("input", type: "password", name: "passwordInput") }
       
    }
}

class MainPage extends Page {
    static url = "main"
}

Browser.drive() {
    def username = config.rawConfig.username
    def password = config.rawConfig.password
    def loginTitle = config.rawConfig.loginTitle

    println "Opening login page..."
    to LoginPage
    at LoginPage
    assert $("title").text() == "Sign In"
   
    println "Setting username=$username"
    usernameInput << username
    println "Validating username..."
    assert usernameInput.value() == username
   
    println "Setting password=$password"
    passwordInput << password
    println "Validating password..."
    assert passwordInput.value() == password
   
    println "Submitting login form..."
    submitButton.click(MainPage)
    println "Waiting for main page..."
   
    at MainPage
   
    println "Checking for main title..."
    assert $("title").text() == "Main Title"
}.quit()

println "Done!"

<<<

Wednesday, October 12, 2011

If you can't beat em', join em'

I started out my little EclipsePhase RPG tracking web app using a Flex UI on top of Gaelyk services.  However, this last weekend I gave up on that and rebuilt my starting point plus some more features with Grails and HTML.

Using Grails instead of Gaelyk was an easy choice for now since I can get a free cloud deployment via CloudFoundry.  Nevermind the fact that I use Grails at my day job, I think I might generally like it better than Gaelyk.

However, the Flex vs. HTML/JavaScript thing is a little less logical.  I spent 4 years getting decent with the Flex framework which I think is a great RIA platform.  However these days with all the Flash FUD going around and the hype around HTML5, it seems highly unlikely that I will build many more Flex UIs professionally.  That's a shame but I'm growing tired of fighting it for now.

My project is a "no Flash" zone as my company's head management is convinced Steve Jobs "Flash is dead"eventhough we have several RIA front-end projects that have been success and no JavaScript/HTML ones yet to do anything significant. 

We actually pay for a JavaScript framework (ExtJs) when Adobe Flex is open source now.  Our UI constantly has browser issues.  It does very little.  In Flex it would be the equivalent of a couple data grids, a couple forms and file uploader.

I'm not digging on our UI guys, but they have alot more work to do dealing with what one guy referred to as "GarbageScript". 

I'm also not digging on JavaScript but browsers suck.  JavaScript devs that spend their time hating on Flash suck.  And eventhough I love my Mac and don't want to be insensitive, but Steve Jobs hateraid for Adobe Flash sucked also.

I'm tired and beaten, so I'm just doing HTML and GarbageScript for now.  The good thing is I am back to basically writing my UI on the server with Groovy/Grails and only slightly with HTML and JavaScript.

Thursday, October 6, 2011

Shady Illuminations

Posted to Pragmatic Bookshelf under PragPub topic...

http://forums.pragprog.com/forums/134/topics/9732

I have to admit that although I am a regular customer of The Pragmatic Bookshelf and have gleaned wisdom from many resources provided here, I have not been a regular reader of the PragPub magazine. However, with that being said, I was skimming October’s issue and saw a section labeled “Porn” that described how “Pornography… is a positive good that encourages experimentation with new media.” and “Porn is a subvirtue.”

This disappointed me a great deal. I believe that any positive pornography seems to bring to ANY industry should be immediately discounted as it promotes an escalating devaluing of the people involved and some might even say that on the extreme end it can even promote prostitution and sex trafficking. I am not here to make a case for the latter, but I think any article putting a positive spin on a industry like “porn” is not worthy of the “Pragmatic” name.

I sincerely hope Andy and Dave give this concern serious consideration.

Thanks guys for all that you have done for our industry and my career.

Todd W. Crone

Friday, September 16, 2011

Maintenance costs versus writing better initial code

But I wonder the cost of having a poor programmer do something that has high maintenance costs but is available right away as opposed to wait for a good programmer to be available to do it.  My guess is you are still better off waiting, but I think people find themselves in this spot more than any.  They know that good programmers write code that is easier to maintain, but they feel there is an urgency to get something done and they can't find a 'good' programmer to do it now.  The compromise is, get a not so good programmer to do it and potentially make a mess and if the system lives long enough, get the good programmer to come along when they are available to make it better or fix it.

Obviously I consider myself a good programmer.  In my 12+ year career, I have spent less time maintaining a system wrote well than I have maintaining/fixing one that someone else wrote poorly.  
Early in my career, I spent most of my time maintaining code that I had written poorly.  So for the first 3-4 years, 'I' was the not so good programmer whose code I maintained.  But at some point I started getting better and I spent more time dealing with fixing other systems than ones I wrote.  My code was still not 'great' since it was difficult for me to hand off to anyone but the bugs were much lower than my first few years coding and when bugs came up, I could find and fix them more readily.
After my 6th year (or so) I started following some 'Agile' development practices.  Not 'processes'.  I used "Agile Developer" techniques geared toward making the code I wrote more easy to change and more easy to keep in a working state.  This also facilitated working with other developers more.

I started writing code that junior developers could take a run with it and I moved on to other things.  This happens a lot with "Senior" devs handing off work to "Junior" devs but not always in a manner that enables the junior devs to be productive.  I think a truly senior developer's main task is to write code that is easy for someone else to modify.  Getting it to 'work' is assumed and means little when you are supposed to me a senior software engineer.

Some senior software engineers justify the complexity in their code to "It's hard stuff."  "I'm smarter/senior so that is why I understand it and you don't."  This is bull.  More often than not though, that same senior developer subconsciously is 'protecting' their code with complexity.  If you don't want some sharp young developer to come along and show you up, make their job hard.  Hand them overly complicated code to maintain and prove you are smarter than they are.

Yes, some things by their nature are complex, but a truly good dev lead can boil it down so that someone else can be empowered by the design to be productive.  If you are 'senior' and a 'junior' dev can't maintain/modify your code it is YOUR fault 9 times out of 10.  Even if they are not necessarily very experienced or skilled.  You should be enabling them and building up their confidence with well designed code.  You should not be crushing their spirit by dropping a pile of crap in their laps and saying, "This code is about 99% done.  I just need you to plug the database in."

Monday, September 12, 2011

Two Things

I decided to use the programmatic properties file reading for a more 'sensible' solution to my last implementation:


applicationContext.groovy (via spring-grails DSL/BeanBuiler) in the src/webapp/WEB-INF directory

...
Properties properties = loadProperties(logger)
...

Properties loadProperties(logger) {
    String baseFilename = "overrides.properties"
    String defaultBaseFilename = "default.properties"
    def contextClassLoader = Thread.currentThread().getContextClassLoader()
    String defaultFilename = contextClassLoader.getResource(defaultBaseFilename).getFile()
    String overrideFileName = contextClassLoader.getResource(baseFilename)?.getFile()

    File defaultPropertyFile = new File(defaultFilename)

    Properties properties = new Properties()
    properties.load(new FileReader(defaultPropertyFile))

    if(overrideFileName) {
        File overridePropertyFile = new File(overrideFileName)
        if(overridePropertyFile.exists()) {
            logger.info "Loading overrides..."
            properties.load(new FileReader(overridePropertyFile))
        }
    }
    else {
        logger.warn "No override properties file was found, using project defaults ONLY."
    }
   
    logger.info "Properties"
    properties.each {k,v -> logger.info "$k=$v"}

    return properties
}

The throughout the 'beans' closure, I can say 'properties[property]' at load time rather than getting a proxy as the last implementation returned.  This means I can use properties to conditionally configure
beans based on environment.  It also allows a 'default.properties' file that will hopefully cover 90% of
what will be done and then the 'overrides.properties' can cover the few things that will likely be
different but can be loaded via that environment (e.g. tomcat/lib).

The other thing is I did very basic implementation with full CRUD for an EclipsePhase character tracker with a Flex front-end and a Gaelyk back-end.

http://ep-tools.appspot.com/epui.html

Slow services on app engine, but free.  Using the app engine Entity for persistence is easy but I still thing I'll look at doing it with Grails and deploying to CloudFoundry as long as it is 'cheap enough'.

Code is nothing exciting but on github.

https://github.com/twcrone/eclpsephase-character-tracker-services
https://github.com/twcrone/eclipsephase-character-tracker-ui

No guarantees that the code will stick around or stay the same as the base site.  Cool thing is...with Flex (and my skills), the back-end can change.  Not embedded in any particular environment (e.g. Gaelyk, Grails, Rails, Spring).


Wednesday, September 7, 2011

Spring Grails Bean Builder Confusion

Spent hours today trying to convert some traditional Spring XML config into more dynamic Grails Bean Builder script to allow dynamic config based on the environment that the webapp is deployed (Windows vs. non-Windows/*nix).  This was NOT a Grails project so I first had to include the dependency in the build.gradle file.

    compile "org.grails:grails-spring:1.3.7"


Here is a snippet of the Spring XML I was trying to convert:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:context="http://www.springframework.org/schema/context"
    xsi:schemaLocation="http://www.springframework.org/schema/beans
            http://www.springframework.org/schema/beans/spring-beans.xsd
            http://www.springframework.org/schema/context
            http://www.springframework.org/schema/context/spring-context-3.0.xsd">

    <context:property-placeholder location="classpath:config.properties"/>

    <bean id="connectionFactory" class="org.springframework.jms.connection.CachingConnectionFactory">
        <property name="targetConnectionFactory">
            <bean class="org.apache.activemq.ActiveMQConnectionFactory">
                <property name="brokerURL" value="${jms.brokerUrl}"/>
            </bean>
        </property>
        <property name="sessionCacheSize" value="10"/>
        <property name="cacheProducers" value="false"/>
    </bean>

    <bean id="jmsTemplate" class="org.springframework.jms.core.JmsTemplate">
        <property name="connectionFactory"><ref local="connectionFactory"/></property>
    </bean>
...
</beans>

All was okay until I tried to deal with the 'property-placeholder' for the config.properties.  I tried lots of stuff and on a whim tried this very counterintuitive thing with a Java String for the property key that looks like a Groovy String that in the BeanBuilder should be interpolated:

beans {
    xmlns context:"http://www.springframework.org/schema/context"

    context.'property-placeholder'('location':'classpath:config.properties')

    activeMqConnectionFactory(org.apache.activemq.ActiveMQConnectionFactory) {
        brokerURL = '${jms.brokerUrl}' // Yes, this is meant to be a java.lang.String
    }

    jmsFactory(org.springframework.jms.connection.CachingConnectionFactory) {
        targetConnectionFactory = activeMqConnectionFactory
    }

    jmsTemplate(org.springframework.jms.core.JmsTemplate) {
        connectionFactory = jmsFactory
    }
...
}


Yes boys and girls...


'${jms.brokerUrl}'

Major brain eff here with something that looks like it should be "${jms.brokerUrl}" with double quotes for Groovy String interpolation or perhaps even simply jms.brokerUrl like a variable attached to a dynamically generated property on the beans object.  I even tried context['jms.brokerUrl']and beans['jms.brokerUrl']to no avail.

I tried the actual solution when it occurred to me that Spring would not be doing interpolation on the ${blah} like Groovy when reading the XML.  For Spring, that means 'use this string as a key to a resource'.
Oyvay.

Wednesday, August 31, 2011

August Rush

So August is coming to close and only one peep out of me for this month.  So I'm going to write something before midnight so that I can see "August(2)" rather than "August(1)".  Really a moral victory but a victory.

Lately I have been spending my time away from work...away from work.  Since my project is going 1.0 in October, right now I am putting in some overtime which means I don't want to code at home.  Not ridiculous overtime as I have seen on other projects that come to their final months and everyone is say "Oh crap!  We need more features!"  So far we are still getting things done at a reasonable pace.

I do hope to work on a Grails on Flex project this weekend related to my two feeble attempts at pure Grails and HTML implementations of an EclipsePhase character tracker.  Surely this one will stick.

Anyways, I wish I had something more profound to say before midnight but after one class of wine, I'm ready to sleep.  Good night, and thanks James for your profound words of wisdom on handling trials of one sort or another.  "Consider it pure joy..."






Friday, August 26, 2011

The Next Thing

So it has been more than a month since I boldly analyzed my fickleness and decided I was going to do Game Programming with Graphics on Android...

Well, that didn't happen.  After UberConf, I tried to get started on iOS game development with Cocos2d but never got further with my "Space Viking" game than a barbarian looking dude on a desolate background with a dark sky.

It didn't help that my good friend Charles Erwin suggested that I look into some other scripty way to do game dev using some new language that eludes me right now.  But in all fairness, it does not take much to sidetrack my 'creative juices'.

These days my 7 month old is getting up in the middle of the night again, my year old project is going 1.0 in approximately a month and my good buddy Matt and I are learning/playing a new RPG called EclipsePhase that is somewhere between Star Frontiers, Top Secret, Transhuman Space and Call of Cthulu.

We just finished an evening of role-playing where we bailed on a complex adventure that would span the solar system in exchange for another "Meet the Mob" type adventure on the same Venusian aerosat, Parvarti, that we had the last extended 'mission' on.  Yes it is a cop out.  Almost Earth gravity with a very site-based adventure feel.  Much easier than detective work floating around asteroids near Jupiter.

Anyways I digress and that is my point.  I don't need a side project right now.  At work I'm doing a message queue based solution for file conversions to work around issues using MS Office directly for synchronous conversions to PDF-A files.  Not exciting in and of itself but the async stuff is kinda fun.

Learning a new language right now is out since I suck at Java and I'm only slightly better at Groovy.  So my focus needs to be on being really good at them before I rush off to some other language.  Enterprise integration patterns and ActiveMQ are more interesting to me than iOS game development and the former actually might pay the bills.  For fun in the evenings, I'd rather read sci-fi or EclipsePhase sourcebooks since in a week or two I might be staring at someone (Matt) that actually cares what I read related to that.

Corona...that's the name of the programming language for game dev that Charless suggested I look at.

Anyways, I'm focusing on system integration and messaging for work, Java/Groovy skills refining for work and fun and sci-fi/EclipsePhase for fun.

I'm booked but happy to not be worried how I should be using my 'free' time.

Wednesday, July 20, 2011

Assessing Fickleness

I always have trouble finishing side projects because I get bored with them quickly.  Lately I have been trying to decide what I want to play with next so I an informal assessment against myself to find out what I am interested in.  Here are the results:

Game programming     xxxxxxxxxxxx
Graphics                       xxxxxxxxxxx
Clojure                          xxxxxxxxxx
Groovy                          xxxxxxxx
Ruby                              xxxxxxx
Android                          xxxxxx
iOS                                 xxxxx
Grails                              xxxx
Flex                                 xxxx
Gaelyk                             xxx
Java                                 xx
JavaScript                       x
HTML5

It wasn't very scientific, I basicaly did a "Face mash" where I compared every technology in pairs and pick the one I liked the most.  Since game and graphics programming are especially prevalent with Clojure, Groovy or Ruby, I decide perhaps I should do with Android.  That logic leads to this grouping:

Game programming     xxxxxxxxxxxx
Graphics                       xxxxxxxxxxx
Android                        xxxxxx

Clojure                         xxxxxxxxxx
Groovy                         xxxxxxxx
Ruby                             xxxxxxx


iOS                               xxxxx
Grails                            xxxx
Flex                              xxxx


Gaelyk                          xxx
Java                              xx
JavaScript                    x

HTML5

It should be noted Android only beat iOS by one and that was probaby due familiarity with the programming language.  Android's Java is easy for me to grok and be productive.

What does this mean?  Almost nothing.  We'll see in the morning I suppose.

Monday, July 18, 2011

Gaelyk cool but Tutorial for 'delete' lacking

I saw Tim Berglund talk about Gaelyk last week at ÜberConf and I decided tonight to start building something and deploy it.  Basically I am starting to folow some dietary guidelines and workout plans as outlined by Frank Sepe in his "TRUTH" book.  I figured tracking my diet and workouts would be more fun if I built a Gaelyk app for it so I started "Eat, Lift and Move" web app.  Obviously eat and lift make sense but I wanted something general for Run, Bike, Walk part of the program and came up with Move.  Yeah, we'll see if I stick with it.

In any event my first iteration on it resulting in a cruddy little app for Eat.  http://eat-lift-move.appspot.com/

It took me like 3 hours to get there but probably more than half of that I was trying to figure out how to frickin' delete 'eat' entries.  The tutorial talked about deleting via 'keys' and deleting entities directly.  Not enough info to encode a 'Delete' link in a cruddy little HTML table.  Old school baby!

But I finally figured it out.  The key is using the KeyFactory http://code.google.com/appengine/docs/java/javadoc/com/google/appengine/api/datastore/KeyFactory.html

On the entity there is an implicity 'key' field that you can encode for a web link via 'KeyFactory.keyToString()' and then later on when parsing the parameters you can 'add water' to it by calling 'KeyFactory.stringToKey()'.  Once you have the actual key you can do key.delete().  But nowhere in the little tutorial did it tell me that.

I still like Gaelyk and plan to play with it more.  It's like the code I wrote 10 years ago but less of it.  Deployments are free and I don't have to invest much to get going.  Even deploying a Grails app public seem like too much work initially.

I might actually see this project through!  Not likely but we'll see.

Posting my code to github -> git@github.com:twcrone/eat-lift-move.git

list.gptl
>>
...
<tr>
<td>${eat.year}-${eat.month}-${eat.day}</td>
<td>${eat.name}</td>
<td>${eat.protein}</td>
<td>${eat.carbs}</td>
<td>${eat.fat}</td>
<td>${eat.calories}</td>
<td><a href="/eat/delete?id=${KeyFactory.keyToString(eat.key)}">Delete</a></td>
</tr>
...
<<

delete.groovy
>>
import com.google.appengine.api.datastore.*
import static com.google.appengine.api.datastore.FetchOptions.Builder.*

def keyStr = params.id

if(!keyStr) {
throw new RuntimeException("Key for delete was null")
}

def key = KeyFactory.stringToKey(keyStr)
key.delete()

redirect "/"
<<

Sunday, July 17, 2011

UberConf 2011 Aftermath

TUESDAY

Helped in Android Workshop - Ted Neward (asssted by Howard Lewis Ship)

I'd been messing with Android for about a month trying to prepare for this and was actually helpful the first half of the day.  Without an actual device and some heads up on the workshop project, the SMS stuff in the afternoon left me struggling to keep up.  Learned a cool way to test SMS without an actual device by starting up another emulator and using its id as the phone number to send a message to.

Android is very easy to get going with coming from a Java background.  IntelliJ IDEA worked much better for me than Eclipse but Ted used command line for whole thing which worked well.  I eventually fell back to IntelliJ though since it was what I was used to.


WEDNESDAY

*Effective Groovy - Hamlet D'Arcy

Best preso I saw and the conference.  Hamlet went through many of the items in "Effective Java" and made footnotes on the "Effective Groovy" items that lined up.  Great stuff.  I plan to go through this with my team at Lexmark.

Code Generation on the JVM - Hamlet D'Arcy

First two libraries were Java based and less interesting to me but he followed them with Grails, Groovy++ and a couple more things about AST transformations that were interesting.

New Ideas for Old Code - Hamlet D'Arcy

He gave some good tips on dealing technically and socially with maintaining an legacy code base or situations where you don't like the code you are working with on a daily basis.  He even went into how you deal with individuals that fight against TDD, Groovy and other technologies that we typically know are good but are hard to convince traditional developers to adopt them.

*Gaelyk Intro and Workshop - Tim Berglund


This was my first time seeing Tim talk and he was a lot of fun.  He gave a good overview of Gaelyk (Groovy development on Google App Engine).  He followed with a workshop where there were less than a dozen of us that stuck around for but he helped us build our own "Technology Radar" app with Gaelyk.  Most fun workshop I did at conference.

Developer Productivity Power Ups on Mac OSX - Matthew McCullough

Great stuff here...I think.  Matthew thinks and talks too fast for me to follow.  He covered so much that I will have to go back through the slides one by one and google each item to figure out what they are.  No ding on Matthew, I just can't keep up with him.


THURSDAY

Thinking in Git - Matthew McCullough

I was pretty tired in this session and as I said before, Matthew covers things too quickly than I can mentally follow I am afraid.  That aside, I got some real gems from his talk.  I have been struggling with using Git on SVN for several months.  I hope to soon be able to full Git and become more comfortable.  I'm an old SVN dog though.

JRuby in Depth (part 2) - Neal Ford

I went to the second part becuase I figured the first part would be too basic but the second part was too basic also.  He may have been watering it down for his audience.  I have already messed with JRuby a bit and learned little here other than that Neal thought Charles Nutter (creator of JRuby) should stop messing with Mirah (Ruby flavored Java language he is working on) and focus on JRuby.

Grails Workshop (part 1 and 2) - Dave Klein

I was assisting for this workshop and felt pretty confident with the material.  It was slow for me (obviously) but from the participants comments etc. I think they all appreciated Dave's pace.  If you are looking into Grails, Dave's "Grails Quick Start" book is a bit dated but goes slowly and is easy to follow.  I guess it should be called "Grails Easy Start" but that doesn't sound very cool.  Don't get me wrong, it's great book.  Lots of "Quick Start" books don't do as good of job of helping new users.  I suggest his book/sessions to anyone starting to look into Grails.

Griffon preso - Andres Almiray

Andres is a fun presenter.  I saw him talk on Griffon a year and a half ago and wasn't surprised by anything.  Griffon is a well thought out abstraction of Swing GUI apps (for me).  I'm still not convinced there are enough resources out there to use Griffon effectively without building a working knowledge of Java Swing first.


FRIDAY

*Active MQ - Bruce Snyder

I would say this was my favorite technical talk.  Bruce is a great speaker and REALLY went into ActiveMQ.  We almost derailed him with questions and comments.  Not much else I can say.  This was the most technical preso I saw at ÜberConf.

*Active MQ, Common problems and solutions - Bruce Snyder

This was a follow up to his ActiveMQ talk and was also excellently technical.  Some presos and NFJS feel very shallow but this felt like he really had a deep knowledge that he was willing to share with us.  He also took several of our addresses/business cards and offered to mail us a copy of his "ActiveMQ in Action" book.  My evaluation might go down if I don't get a book in the mail this week.  ;)

Message and Concurrency using Spring - Bruce Snyder

Friday afternoon I was starting to slow down.  This was the last talk I got to attend but it felt like a lighter version of his ActiveMQ talks from the morning.  He did touch on RabbitMQ a small bit but I can't remember much new here.  But blood was rushing to my tummy from a big lunch though.


In conclusion:

Top 5 sessions that I attended:

1)  Effective Groovy - Hamlet D'Arcy  MOST USEFUL 
2)  Active MQ - Bruce Snyder  MOST TECHNICAL
3)  Active MQ Common problems and solutions - Bruce Snyder
4)  Gaelyk - Tim Berglund
5)  Gaelyk Workshop - Tim Berglund  MOST FUN

I enjoyed Android and Grails workshops but I'm biased...I was helping in them and I already had some knowledge of the technologies.  One great thing about ÜberConf was that I didn't go to any "stinkers".  Most NFJS conferences I have gone to in the past, I have wandered into at least one preso that I left early or wished I had left early.  I had to sort the evaluations and I only saw a couple "flaming" evaluations.

All in all, the best NFJS conference I have attended and the most exhausting one I have worked at.

Hopefully I can see my buddies (Erik Weibust, Dave Klein, Ben Ellison) again and SpringOne2GX this year.  But for now, I'm just going to try to recover some sleep and find ways to use what I learned before I forget everything!

Thursday, July 14, 2011

ÜberConf 2011 coming to an end

I got a rare opportunity this year to attend the ÜberConf in Denver, Colorado.  At the Columbus NFJS event, I helped set up and some other minor things and kept pushing the organizer, Jay Zimmerman, to let me help in Denver.  It worked.

I arrived Sunday at 4pm and began working at 5pm.  Wow.  I earned it this year.  That first night Ben and I worked on binders etc. until 1:30 am.  We got up Monday morning relatively early and began working of flash drives.  Throughout the day we did session handouts, projectors and general room arrangement.

Monday didn't end until 10:30 or so I think.  Tuesday the first wave of the conference began.  I helped in the Android workshop and Ben the iOS workshop.  Good times.  I was helpful the first half of the day but the second half we were doing SMS messaging among other things and I was at a bit of a loss there.

Honestly I had only messed with Android for a month or so since Jay said I could go if I helped with that session.  Not bad to do with a Java background.  iOS sound more sexy to me though since I'm a Mac guy.

In any event, with one day left I am tired but excited about some things I learned.

Now if I could only remember some of it!

Friday, July 1, 2011

Maybe I'm a Artsy Fartsy dude

So...I've been wondering a while what makes me tick as a programmer.  I like lots of technologies but I can never get too interested in one for long enough to get very deep.  I used to be driven by work requirements to learn new technologies and it thrilled me.  But nowadays, most work driven technologies bore me.

So I had a heated argument with an old office mate over beer today.  Typical....he loves JavaScript and I prefer Flash.  I've used Flex for UI development and I liked it.  But even THAT has bored me to the point where stepping away from Flex almost 9 months ago was a pleasant idea.  I had become the Flex/UI guy and rarely got to write much server code.  That was okay because most server code has been Java in my career up until recently.  Java bores me.  But now I get to do Groovy.  Which is nicer but it has started to bore me now as well.

Okay, I digress but isn't that the point of a blog.  Digression without consequences.  Anywho, my argument about Flash vs. JavaScript got me longing to piddle with Flex again, so after a few hours trudging through some Android code to call our REST interface, I blew the dust off my old ActionScript 3.0 Animation book.  Fortunately for me my Flex 3 book was at the office so I incidentally starting drawing a red circle as a Flash sprite.

I started getting interested again...I grabbed a Flash Games book and started flipping through it.  Then I dug up an old Computer Graphics for Java Programmers and began to surmise how I might modernize this by writing Groovy versions of the samples.  Even began plotting how Groovy might get slow and Scala might be better when I start wanting to do some concurrency with multiple objects moving about the screen.  Then I started looking for resources on Android graphics, Objective C animation and revisiting my whim of learning OpenGL...

So maybe it's not that I need to find a particular language, or framework to interest me.  Maybe I just need to do more graphics.  Less text boxes and XML parsing and more sprite animations, 3d texturing and transformations.  A simple 3d gray box spinning around on the Android simulator gave me more thrills than the thought of implementing a REST client for work with my long lost friend, Flex.

Maybe it's not Flex or Flash.  Maybe I REALLY like shiny, flashy, eye candy thingies when coding.

Or this is all moot...I could be bored with this all in the morning...

I'm bored

Seems like I finally have a project with alot of things I have always wanted to do...

For the server code we are using Groovy (mostly) and Grails.  We practice TDD where our builds have code coverage > 80% as a standard.  Clean Code (by Uncle Bob) is our team coding standards 'bible'.  Yes, it is not really 'coding standards'.  But I think most coding standards are like trying to cure the symptoms of bad code with perfume.  What we really want is code that is easy to maintain and a joy to modify.

We have gotten rid of several of our mandated technologies from management that have no technical merit.  No more Liferay, ImageNow, Maven, Java (mostly), Spring XML config or Oracle.  No we use simper technologies like Tomcat 6, Grails, Groovy and PostgreSQL.  Unfortunately, we are still not *allowed* to use Flash since Steve Jobs said "Flash is dead" and our management thinks that means we shouldn't use the Flex framework anymore.

The last thing is a sore spot with me.  Lexmark still has several good projects that use "Flash".  They use Flex for very nice RIA front ends.  I spent close to 4 years getting pretty good with Flex.  Probably more than I wanted, since I still like writing server side code etc.  So I when I was told we weren't going us Flex, I was open to diving back into JavaScript, HTML and CSS after years of avoiding it.  Well, maybe not interested in CSS.

I find myself still avoiding the JavaScript though.  Our UI guys are doing a great job with ExtJS but still get tripped up with browser issues, mostly IE8 now, and nothing I hate more than browsers.  So I find myself longing for the clean, consistent framework I enjoyed and beginning to remember why I gladly stopped writing JavaScript close to a decade ago.  I don't want to be a JavaScript ninja.  Investing intellectual capital in CSS styling to avoid IE issues.  Or avoiding language constructs core to JavaScript that simply suck.  Or trying avoid the sea of unused reserved words.  Or probably the worst...not good way to run JavaScript unit tests in a build and show test coverage.

JavaScript bashing aside...I'm bored.  Our project is pretty basic at this point.  We are in the final months and not a ton of coding.  Mostly configuring security.  Testing integration with external systems.  Dealing with UI bugs caused by browsers, ExtJS4, CSS, JavaScript, localization or whatever.  Thankfully I have motivated JavaScript ninjas doing most of that.

So bored that I gladly picked up the ball to do some ill-advised story for using MS Office as the conversion technology for our doc to PDF work.  We already use JODConverter to manage LibreOffice, which works fine and has thought given to how we are using already.  The fidelity is on ly 50% what our customers want however and some customers will pay for better.  And rather than bying something, which is what we SHOULD do, we are going hack up some way to use office behind some queuing mechanism since MS Office was built for single user automation only and you can only convert one Word, one Excel and one Powerpoint at a time with a given instance of MS Office.

I'm currently using Groovy library, Scriptom, that runs on top of a Java COM library called Jacob.  But more fun that chasing weird browser UI bugs or integrating with some external implementation of OpenAM.  I think I will need to use queue or maybe even batching for the conversions.  Fun exercise, I think, although means I have to run on a Windows VM and I am a Mac guy now, 4 years reformed but I still fall off the wagon occasionally because of business requirements.

Regardless coding still can be fun.  Maybe I'll throw a little Flex UI on top of my conversion engine.  ;-)

Monday, June 27, 2011

JavaScript ninjas hate a Flex samurai

Since I am pretty sure they won't actually post my comments to this article -> http://peter.michaux.ca/articles/javascript-is-dead-long-live-javascript AND over the past 4 years I have grown tired of the religion among JavaScript ninjas against Flash.  And yes, I finally created a blog to post my opinions because I didn't think my voice would be heard.

I am posting my response here:

>>

I'm going to get beat up here but...why compile to JavaScript?  Shouldn't there be a cross-browser VM that allows true compilation first?  I'm no JavaScript pro but 'compiling' to an interpreted, text format doesn't allow for optimizations provided by the JVM, CLR and yes...Flash.

I said it.  Most JavaScript lovers hate Flash, but the truth of this is, it runs more consistently across browsers and performs WAY better than JavaScript because it is running on a VM.  ActionScript3 is a much richer language than JavaScript.  And after trying out several JavaScript based UI frameworks, I'm still convinced the Flex framework is better.  It scares JavaScript ninjas because Adobe 'owns' it and allows nubes to build UIs that are richer and faster than uber skilled, smart JavaScript developers wasting their time with 'if(ie8) { ... }'.

Regardless your hate for Flash.  That's religious and should be kept away from open minded technical discussion.  Who cares about he 'next' web language?  What is the next VM that allows powerful languages without all of JavaScript's baggage prosper.

Having JavaScript only in the browser is NOT good for web development.  Having Java only on the server is bad now.  But with a powerful, VM, we are no longer constrained by this.  Building other languages on top of JavaScript is like building other JVM languages on top of the JVM from 1.0.  You are building your castle in the sand.

Get a good foundation that is built into ALL browsers.  I'm not even sure HTML5 will be that.  But I've already said too much.
<<