Thursday, June 7, 2012

Developing in style with Visual Studio 2012

0 comments

So I am really excited about Windows 8 coming out. High profile applications such as Visual Studio and Photoshop are giving us a look at the new improved designs of Windows 8. Just a couple days ago the new Windows 8 preview came out and along with it they released the Visual Studio 2012 RC (Release Candidate). Normally I go to DreamSpark for all my Microsoft dev downloads, which is just their educational software channel. Check it out if you are a student. Actually though, for this download it is not needed. Anyone can download Visual Studio 2012 RC from here. Microsoft allows developers to use even the Professional and Ultimate versions of the software in order to get feedback on the applications before their official release in order to make it less buggy when it finally is released for a hefty price. After it is released anyone who has some kind of student eligibility can head over to Dreamspark to download it.

One thing that is immediately obvious about the changes between VS2010 and VS2012 is the massive design differences. The aesthetics are immediately obvious at the applications splash screen, which is metro-esque and dark. Dark is how I like my editors. There is great news for anyone who thinks like I do because they have finally allowed me to change the color scheme of my Visual Studio installation. Well sort of.. They let you choose between Light and Dark currently. Here are some screenshots of the dark color scheme interface:

You can head over to this MSDN article to learn How to: Change the Fonts and Colors Used in the IDE

The dark scheme I am talking about only applies to the menus and such. The text editor colors are controlled from the Preferences (see MSDN link above). What is cool is that they have this website called studiostyl.es where they host exported vs settings files that contain only text editor font settings. You can choose from many many different themes, such as my personal favorite Visual Studio 11 Dark Theme. You then download your favorite one, import it into Visual Studio and suddenly our IDE has almost as much style as The Dev-(b)log.

Now I love Linux but it can't replace Windows

0 comments

I must say after installing and using Ubuntu 12.04 on my Dell Studio XPS 1647 that I am in love with the operating system. However after I began trying to get into web development stuff again and start using javascript libraries like three.js. I realized I have been spoiled by developing in Visual Studio in Windows. Maybe I am the only one that feels like I am trying to write code in the dark ages when trying to edit javascript in notepad. I tried to download and use Eclipse and setup the Javascript IDE so I could set up three.js projects with code completion and0 intellisense like capabilities. I want code validation and easy previewing as I am coding. The thing about three.js is that it will not load files from the hard drive directly. They must be located on the webserver. This means that in addition to some kind of IDE I figured out that I could install and setup apache2 on Ubuntu and redirect the public folder to my choosing. This way I could view my projects by going to addresses in the browser such as localhost/threejsDemo.

I felt like this was a great setup for a long time and I am still a fanatic about Linux now. I feel like my laptop doesn't get nearly as good of performance. I know for a fact that the ATI proprietary driver for linux is not nearly as good as the latest ones on Windows. The CPU does not feel nearly as quick (probably no hyperthreading/turboboost). As I began adding more and more javascript libraries and more functionality eclipse seemed to slow to a crawl and I would get errors every so often. It would always seem to run out of ram. It attempted code validation with each edit and something was just not working well. I feel like if I could get some hardware that have well supported linux drivers then that will be the way to go. For now though I have switched back over to Windows 7 for the past couple days and now I notice the performance difference was drastic. And when I was getting comfortable just yesterday I saw that I could download a brand new shiny IDE in Windows land...

Friday, June 1, 2012

A bit of background...

1 comments

Ok, so I want to reiterate that I am first and foremost a programmer of native languages such as C/C++, Java, etc that execute outside of the browser. But I have recently gotten more interested in web development and I have especially been excited about it after having gone through the basics of network programming with sockets (bsd and winsock). And with the new developments with HTML5 (application development) and cross-platform and mobile apps. However, I haven't touched any markup XML or HTML or any javascript in years, I am more than a little rusty with it. I am however familiar with the language concepts involved in javascript. Interpreted, dynamically typed, etc. It has taken me some time to adjust to writing markup and scripting then simply opening it up from a webserver in a browser rather than compiling my code and executing it natively on the machine. I cannot believe the amount of time that you can save not having to compile between small changes in code and testing. However, I have also found out the hard way, that with the lax structure of html and no compiler for javascript to tell you when you have simple mistakes in your code you can spend a lot of time running around in circles not knowing what is wrong.

Also another thing I am not used to is dealing with a rather small, mostly undocumented, open source code base. From using it so far I feel that Three.JS has the potential to be a great 3D tool for app developers. However, there is almost no docs and many many examples. You must learn by pouring through the more than one hundred complete open source example apps included at the three.js github page. Another problem is that I have not settled on a very good development environment for HTML5 developemnt (game, 3D, or otherwise). I am currently using Eclipse with as many web related plugins as I can get. I have looked at one called Aptana and I think I am going to download it. I believe it is a replacement for the HTML editor which provides some intellisense-like features. Currently using javascript IDE build of eclipse with all the indigo web plugins + the web toolkit plugins I seem to get decent autocomplete for the three.js library. It is slow when filling out the list of functions in the THREE namespace and it seems to eat up RAM and eclipse doesn't like the lack of semicolons that I recently found out is common in javascript (eclipse has me wishing the spec wasn't so lax). I am now running Ubuntu 12.04 Linux on my Dell Studio XPS 1647 i5 laptop. It runs pretty well. ATI's proprietary driver for linux is not as good as it is for Windows (which is to be expected) and my CPU fan seems to kick on at the slightest load. But my speeds and everything seem decent. After using Linux I am amazed as a developer at the level of control you can have with an open source OS. It is the same feeling I got when I rooted my phone (XD Android).

Anyway, I figured out a couple things that were holding me back from just popping out a demo better than my last. First I had some problems that it seemed my textures didn't want to load right some of the time. It was driving me crazy because it seemed that the same code would do different things at different times for no apparent reason. I then read somewhere that the texture loader used by three.js apparently can only load certain (perhaps all) textures from a webserver, not the hard disk. This was surprising to me but I suppose it leverages something server side (ajax or something) in order to load textures better. Anyway, after firing up apache2 on my linux box I had all the textures working in no time. My next step was to add lighting to my scene to give it more depth (things look kind of flat when still if there is no lighting effects). Seemed like it was giving me trouble as well. Only Lambert and Phong materials will work with lighting I come to discover.

Anyway, I am getting ready to post-up the demo as well as walkthrough of the source I have so far. I am using a three.js boilerplate and extension library aptly named THREEx (github). It seems to be pretty good. I however eventually had trouble with lighting and had to redownload and load the latest minified library from the original three.js library in order to get my ambient lights going. So I'm not sure if I could have accidentally modified it or if there is something broken with an update somewhere perhaps. Anyway, I will include a zip of the entire project.

The boilerplate starts you with an FPS output onscreen, and f to go fullscreen, and p for screenshot. I add in a flag for webgl detection and show you how to customize your scene to look best on multiple possible renderers. Also I add to the onscreen output HUD what renderer (webgl or canvas) the demo is currently running on. (You might not think you need this, but it has surprised me a couple times and actually been useful).