Posted by Brian Fending on July 3rd, 2008 — Posted in Code, MVC, PHP, Technology
I was at a PHP User Group meeting earlier this week where the presenter was extolling the virtues of the great Symfony MVC framework for PHP, which he started using last month. I’ve been experimenting with it for a few months longer and shared some of the same reactions when I first started a few experiments. I had to leave about thirty minutes in, and no doubt I missed some really hot PHP action, but there’s another MVC I’ve been toying with recently, CodeIgnitor. Couple this with the javascript framework Prototype, and the possibilities are not just endless… they’re really *^%&%$# fast.
That’s my major complaint with untweaked Symfony projects - speed. CodeIgnitor, while it requires you to CODE a bit more (than in Symfony) to accomplish your (same) goals, is blazing. What Prototype gives you is a means by which you can get fast responses on the page (AJAX functionality). This, when you think about making on-screen updating of information *even faster* than conventional PHP, is an amazing concept.
Anyway, I’m working on something that I hope to Beta in a few weeks using this dynamic duo. It’ll be a Web app that works well in mobile browsers, including BlackBerry devices complying with the RIM cHTML constraints. And it’ll be smokin’ fast.
No Comments »
Posted by Brian Fending on April 4th, 2008 — Posted in Code, Reviews, Technology
I downloaded eclipse last week for home (Mac) & work (”Other”) use, and I’m really impressed so far. It hasn’t blown me away like Visual Studio’s runtime debugging does/can, but it’s definitely much more streamlined than disparate dev+compile+run+debug scenarios do for Java and PHP. In fact, this is the first “real” IDE I’ve used for PHP, having relied on Notepad/Textedit and gEdit/Dreamweaver for all these years. Impressive. I’ll spend more time running actual development scenarios before reviewing it in full here.
No Comments »
Posted by Brian Fending on March 3rd, 2008 — Posted in Code, Technology
As I just blogged, there are three kinds of people in this world when it comes to listening to music in cars. Similarly, there are three kinds of people when it comes to Service Oriented Architecture (”SOA”) adoption:
- Conservative / Anti-
- Judicious
- Rampant(Don’t you just love my even-handed labels???
)
Before I begin, I’d like to obviously throw myself out there as a #2. Yes, there are cases where SOA and Web services make a LOT of sense, more so than not. Nay-sayers are fooling themselves if they think this a passing fad. Any idea that has this kind of traction will in fact likely NOT go away. Not quietly, at least.
Still, there are many developers who argue that developing as much as possible in original code as services - or the consumption of them - makes great sense for any application in any organization. I just don’t see the point if the services don’t connect or enable systems that aren’t disparate or disconnected enough to merit it. And with that I’ll focus my tirade of reasons to be rational about SOA on the #3’s.
You should employ SOA if there:
- will be multiple consumers (of a message or action)
- is more than a single possible application of the service
- are no more efficient methods available, balancing the above two points
And you should *consume* messages if:
- the services already exist or
- it makes sense (see above) to create the messaging services
Seriously, it’s that simple. If you have two boxes in the same data center - using the same NAS - that need to access the same files… well, dude… path of least resistance. If you’re dealing with those two servers plus eighteen other consumers at partner sites, then YES! Write it all now!!! What’s that? You want to batch load data into an Oracle database for warehousing? DUDE: DROP INDICES, SQLLDR, RECREATE INDICES. No need for a web service to pick up the records. Maybe I’m missing the point entirely, and please do correct me if I’m missing some basic tenet that would make my position pure bunk, but I think the madness needs to stop.
[It's also worth pointing out that Web services, while cool and all, are just one tool in the belt of .NET 3.x with the advent of Windows Communication Foundation (WCF). Even more interesting is hearing MS guys forget that the architecture is a generic and platform-agnostic thing. You do not need any MS technology to just as easily implement Web services. I know, shocking. And the diagram above - minus the UDDI, of course, because who really uses UDDI?? - was like a revelation for one of these cats when I broke the news a month ago.]
There’s a breaking point at which the shift in architecture makes sense. It happens to be a pretty low point, but STILL there are those out there who would have us adapting absolutely everything to SOA. Tomorrow, if possible. I don’t know about you, but I’d rather dig my eyes out with a spoon than defend the really common-sense position against that. Good thing my floor is usually out of spoons.
No Comments »
Posted by Brian Fending on January 30th, 2008 — Posted in Code
Scott Hanselman has been writing an interesting series of posts reflecting on how coding patterns converge and diverge between languages. More precisely, he has been emphasizing how important it is to *read* code, consuming it as we would anything else. How else do you learn a “language”, after all? And there are no Berlitz tapes for F#, trust me. Anyway, The Weekly Source Code 13 hits on how a Fibonacci number generator looks in a few languages.
This subject is particularly fascinating to me, and increasingly so as I run into / work with people who only know or use one or two languages or constructs. Context is everything, I think. Understanding the patterns and syntax of multiple languages can only help.
No Comments »
Posted by Brian Fending on December 29th, 2006 — Posted in Code
I recently had a programming challenge where I needed to explicitly list all possible permutations of a word. The next phase was going to be checking those words against a standard dictionary to see if each/any was a “dictionary word” and thus qualified/disqualified from the list. That part would be easy to implement using the below block, so here’s the Phase I version of the code.
function array_2D_permutate($items, $perms = array( ))
{
 static $permutated_array;
 if (empty($items))
 {
  $permutated_array[]=$perms;
  #print_r($new);
  #print join(’ ‘, $perms) . “\n”;
 } else {
  for ($i = count($items) - 1; $i >= 0; –$i)
  {
   $newitems = $items;
   $newperms = $perms;
   list($foo) = array_splice($newitems, $i, 1);
   array_unshift($newperms, $foo);
   array_2D_permutate($newitems, $newperms);
  }
  return $permutated_array;
 }
}Â
$word='jimbob';
$len=strlen($word);
for($i=1;$i
$result=array_2D_permutate($arr);
foreach($result as $key=>$value)
{
 unset($theword);
 foreach($value as $key2=>$value2)
 {
  $theword.=$value2;
 }
 $words[]=$theword;
}
$unique_words=array_unique($words);
foreach($unique_words as $key=>$value)
{
 echo $value.”
\n”;
}
No Comments »