NBShell Version 3

for everything else
Post Reply
User avatar
tod
Posts: 587
Joined: Sat Apr 26, 2008 8:27 am
Location: Southern California
Contact:

NBShell Version 3

Post by tod »

I just finished (I hope) the 3rd version of my Ajax shell for NetBurner. I ditched Prototype and 90% or so of my custom JavaScript and replaced it with jQuery. The real motivation for this version though was the Knockout library. For anyone that's done MVVM using C#/WPF Knockout will let you do the same thing with JavaScript. If you haven't done MVVM you should learn it. It's great for binding small or large amounts of data from the NetBurner to the web page. Knockout not only does two-way data binding it has built in templates that are simplicity itself. You can display a large grid of data with one foreach statement and a databinding set on each column. I made a short video demonstration (4 minutes).

There are some great tutorials on the Knockout site that use a customized fiddle so you can work right through the examples just using your web browser. Brilliant!
jdal
Posts: 21
Joined: Sat Jan 07, 2012 7:10 am

Re: NBShell Version 3

Post by jdal »

Thanks Tod for the tip, its nice to have alternate solutions.

I have been using Adobe Flex for doing the same kinds of things for years now.
Recently i have moved to Silverlight to do it.

Here is a demo i did years ago on the MOD5270 with Flex. I have 3 mp3 files on the SD card. It streams the file to the browser.

http://www.youtube.com/watch?v=1JEY_9KxKCU
User avatar
Chris Ruff
Posts: 222
Joined: Thu Apr 24, 2008 4:09 pm
Location: topsail island, nc
Contact:

Re: NBShell Version 3

Post by Chris Ruff »

tod and jdal and anybody that nose:

So I have only used java applets and none of these other whiz-bang browser solutions yet..Can anyone make a little list of good vs bad concerning:

tod's javascript solution(s)
adobe flex
Silverlight

and any other technologies that are applicable?

can we learn about things like:
-memory footprint in NB
-browser compatibility
-ease of implementation
etc.


At some point somebody will want app-like behavior on a web page from a NB server and I will have to choose one of these and go

Thanks,

Chris
Real Programmers don't comment their code. If it was hard to write, it should be hard to understand
jdal
Posts: 21
Joined: Sat Jan 07, 2012 7:10 am

Re: NBShell Version 3

Post by jdal »

I cannot speak for Tod solution as i just found out about through him.
I have been using Flex for all my designs for the past 7 years.
I have not run into any issues at all in any browsers with it over this time.
As far as Silverlight goes, i just started learning it.
There are 2 reasons that push me towards Silverlight

#1) a Flex app is typically around 300k in size. Yet the same app in silverlight is 40k
#2) Flex new release of 4.7 they took out the Design View. so its code only. If your not familuar with Flex when you in the designer you have 2 tabs. One is the design view and the other is the code. DV is nice because you can simply drag buttons, sliders and whatever tools to the page. It then adds the code for that object for you. This feature is great when you have multiple things on the page and you want to rearrange them so it looks good. Simply click and move them. With the new 4.7 they removed it. so not its code only which ruined it in my mind.

Silverlight has this DV, and testing so far has proven great. Just need to learn more on C#
versamodule
Posts: 14
Joined: Fri Jun 08, 2012 4:59 am

Re: NBShell Version 3

Post by versamodule »

Flex has been very good to us. Here is a demo of a project we did many years ago.
We have not had any browser issues with it at all.

http://www.youtube.com/watch?v=lsHOzIsc ... tu.be&hd=1


http://www.versamodule.com/
User avatar
dciliske
Posts: 623
Joined: Mon Feb 06, 2012 9:37 am
Location: San Diego, CA
Contact:

Re: NBShell Version 3

Post by dciliske »

While I will not say Silverlight is wrong to use, I would be extremely cautious in beginning development on it. I feel that it is a dying language; the only place it ever got any real traction was with Netflix's streaming app, and that's soon to be HTML5 based in Javascript. The main reason to use Flash (which I think is Flex? I don't know Adobe stuff) is its ability to run native networking code and therefore be able to establish a hard TCP link back to the device. Otherwise, I personally would lean towards Javascript (or other languages that can compile to JS).
Dan Ciliske
Project Engineer
Netburner, Inc
User avatar
tod
Posts: 587
Joined: Sat Apr 26, 2008 8:27 am
Location: Southern California
Contact:

Re: NBShell Version 3

Post by tod »

(I apologize in advance for the length of this post - I didn't have time to write a short one)!

Flex: I am too ignorant about this product to over any opinion.

Silverlight: I agree with Dan (actually I think Dan understated it), before I did this upgrade I was thinking I would actually leverage my many years of C#/WPF/MVVM experience by using Silverlight (a subset really of WPF). In fact it was a foregone conclusion that I was going to use it. After researching, it appeared likely to me that Silverlight was near the end. There were many rumors that V5 was the end of the road, but now there is talk of V6. I also thought that in terms of marketable skills it was better to learn HTML5, CSS3 and master the new JavaScript libraries out there. MS themselves seem to have a love/hate relationship with their own product. Not a good sign in my opinion.
The argument for JavasScript
In addition to the great free libraries a couple of other things are making it easier to work with JavaScript.
  • 1. JsLint - acts like a compiler and will find many errors the easy way instead of having to figure out run time errors. There are JsLint plug-ins for Eclipse and Visual Studio
    2. jsFiddle- this may sound stupid but having this tool really makes it much easier to quickly learn, test and experiment. Plus if you have problems with code its a great way to minimize down your code to the essentials and test it out. Saving and forking from here can be real time savers.
    3.Alternate IDEs - I didn't use Eclipse while writing the web code (which you can probably tell from the video). I use Visual Studio with ReSharper (R#). One HUGE problem with JavaScript is the loose typing. Type a variable name wrong and you get a new variable. R# lets you know you did this right away. Intellisense helps keep you from making the mistake in the first place. VS native intellisense also works, you just need to add special comments to any libraries being used so it will use intellisense on those as well. I briefly used Aptana Studio 3 and it also looks very good and has good context-senstive type-ahead support. It's also built on Eclipse so it will be very familiar. The only problem is it's built on Eclipse. You need to keep your NB project in the real Eclipse so you can do normal development. I want a way to edit my html folder in place and I couldn't figure out how to do that. You can't have the same workspace open in two copies of Eclipse. There may be a way to link to the NB workspace but it was so simple to just import the html folder as an existing item in VS I never bothered to figure it out. That said if in VS you only touch .js files, when you switch back to Eclipse to compile you have to touch an .html file for NB to recognize it needs to rebuild the folder.
    4. Pluralsight - This is my secret weapon (don't tell anyone else :) ). Pluralsight is not free, you can sample it for free for a few hours but then it's $29/month for the lower level subscription and worth every penny. (In the interest of full-disclosure I am auditioning to be one of their "authors" - but even if I don't pass the audition I still recommend them). They have great training screencasts that can quickly bring you up to speed on all the latest going ons in the JavaScript world. Of particular importance are the ones on learning the newer JavaScript patterns, my favorite is the revealing module pattern (which I don't use in the V3 Shell because I thought I was already throwing a lot of new stuff at everyone). However, these patterns let you mimic classes so you have private/public members. The big advantage comes back to IDEs with context sensitive help, only the public methods are visible, which is exactly what you want.
    5. CoffeeScript and TypeScript - I've only used TypeScript but I was very impressed. TypeScript is just a superset of JavaScript and a compiler. You really learn a bit of new (simpler) syntax and it generates the javascript for you. It does JIT compiling as you type, it has side by side window views where you can type TypeScript on the left and see the JS on the right. This means you can create the revealing module pattern using a much more familiar inheritance based class like syntax. Plus the compiler means you get some error checking (like JSLint does) as you are typing the code. I'm pretty sure the next large JavaScript project I do, I will do in TypeScript or CoffeeScript.
The worst part about JavaScript to me is how forgiving it is. I'm used to having compilers (and lint) find my errors for me. I'm changing my habits and standards to conform to JSLint so that I can get some of that security blanket back. Once you learn the parts of JavaScript to avoid, it's a pretty amazing language. From pototypal inheritance to its use of closures, it's really looking like it was way ahead of its time. The EcmaScript 5 standard (I just can't bring myself to stop calling it JavaScript) adds some nice new features but like all things web you have to be careful about using them (except you should always use "use strict"), until you know the browsers you are targeting support the features you want to use.
User avatar
dciliske
Posts: 623
Joined: Mon Feb 06, 2012 9:37 am
Location: San Diego, CA
Contact:

Re: NBShell Version 3

Post by dciliske »

I try not to be too harsh in text on a public forum; it's too easy for there to be misinterpretations and hurt feelings.
Dan Ciliske
Project Engineer
Netburner, Inc
User avatar
Chris Ruff
Posts: 222
Joined: Thu Apr 24, 2008 4:09 pm
Location: topsail island, nc
Contact:

Re: NBShell Version 3

Post by Chris Ruff »

Were a bunch of messages deleted from this thread? I didn't have time yesterday to absorb all of the information and now a bunch of it appears to be gone.

Did I imagine that there was more info on this thread? I remember something from an NB engineer about the best shell method to use. that's gone. I thought there was more information on some other stuff as well.

oh well.

Chris
Real Programmers don't comment their code. If it was hard to write, it should be hard to understand
User avatar
tod
Posts: 587
Joined: Sat Apr 26, 2008 8:27 am
Location: Southern California
Contact:

Re: NBShell Version 3

Post by tod »

Chris I think either you're imagining things or I'm missing things. I didn't see any additional info either here or in the email chain.
Post Reply