Functional Programming Starters

21. January 2015 18:32 by cagomez in   //  Tags:   //   Comments (0)

Here are some links I want to save regarding getting more proficient with functional programming.

Try F# right in your browser - http://www.tryfsharp.org/Create

Try Haskell right in your browser - https://tryhaskell.org/

F Sharp for fun and Profit – Scott Wlaschin – http://fsharpforfunandprofit.com

A Functional Architecture in F# – Mark Seemann builds an ASP.NET Web API in F#, JUST F#, but along the way he gives a great practical overview of why functional programming will improve your applications.  http://www.pluralsight.com/courses/functional-architecture-fsharp
(Requires Pluralsight subscription)

Functional programming design patterns by Scott Wlaschin - http://www.ndcvideos.com/#/app/video/2311

Underscore - http://underscorejs.org/
A library with functional helpers that will help ease your transition to thinking functionally and using collections effectively.

How did I get started coding?

11. January 2015 19:08 by cagomez in   //  Tags:   //   Comments (0)

In the 80’s, it became common for personal computers to be sitting out on store shelves with some kind of green scrawling of characters sitting naked in an ocean-like black display.  These new personal computers would be turned on and available for you to type on.  The Commodore 64, VIC-20, TRS-80, and Atari PC models would be beckoning you at local department stores.

I am kicking myself right now trying to remember what the Atari PC screens would display after booting.  My faint memory was that it said “READY” when they were booted.  Almost every time I walked by, someone would have typed their name in only to be greeted by a response of “SYNTAX ERROR”.  What were you supposed to do with these things?

One day, I saw someone actually using the thing.  They typed in the following:

10 PRINT “MARK RULES!!”
20 GOTO 10

Then he typed RUN and hit Enter.

I observed the screen fill with “MARK RULES” and the person walked away.  I stood there, perhaps looking dumbfounded, or just looking like a curious kid, watching the endless scroll. 

I remember that was the day I started my software development journey.

Before I ever took a software development course in high school or university or had a job, I learned BASIC.  I learned a lot of flavors of BASIC.  In those days, you learned the slight differences in BASIC among the Commodore 64, Apple IIs, IBM PC, TRS-80, and so on.  BASIC was my language of choice for a long time, especially on the IBM PC 5150 my dad brought home. 

My first computer, an IBM PC 5150 with 256KB RAM. I had a CGA monitor though.

Photo © Ruben de Rijcke / CC-BY-SA-3.0 – (via Wikimedia Commons)


Not until high school and the good fortune of a real honest-to-goodness computer science elective (thank you Ms. Gigi Walker) did I learn Turbo Pascal.  In subsequent years at high school we transitioned to C and learned data structures (stacks, queues, trees) and implemented sorts.  I was extremely fortunate to have this available in high school.

In college, I aced an ADA class (the intro to computer science class’s language of choice) so thoroughly that I destroyed the curve and sent dozens of students away with D’s or worse. I played around with Java in the computer lab, but it wasn’t part of the curriculum so it was purely experimenting.  It was about this time, in 1993, that I remember making my first web page.

From there I got my first programming job (which was during college), and on the job I learned C++ and took my first step into Windows development when Windows 95 shipped.  This means I struggled through the Win32 API, MFC, and later COM/ATL. We managed our own memory and resources in those days… and we LIKED IT (no… we didn’t).

In 2000, I was fortunate enough to be at the Microsoft Professional Developers Conference when .NET was announced to the world.  Since then I have been working almost exclusively on the .NET platform, so I’ve learned C#.

And on the way I learned a little about SQL Server and T-SQL.  Many developers in the late 90’s and 2000s became fairly proficient in database technologies and SQL scripting, because you had to deal with it all the time (I know many a DNA who would argue with my use of the word “proficient”).

Since then, I’ve stuck pretty close to the Microsoft stack, going so far as to be that “full stack developer” that is a common hiring buzzword today.  This means I’ve learned a lot of development technologies that aren’t exactly LANGUAGES but pieces of the .NET framework or add-ons.  This includes, WPF, XNA, Entity Framework, ASP.NET MVC, and so on.  At some point language syntax stopped mattering as much as technologies within a larger platform.  In short, there’s just so much to know, and you can’t know it all.

And of course, everyone has had to take JavaScript seriously.  It’s the language of the web.

How should you start?

Curmudgeon developers (sometimes that includes me) often say that these youngsters today don’t know how good they have it.  Sometimes it is also said that today’s developers are naive for not having to deal with some concept that we all struggled with in the past, like pointers or resource management.  Joel Spolsky alluded to this almost ten years ago.  But Joel doesn’t allow his post to be “you kids don’t know how good you had it” without making a larger point about learning to write good software.

How should someone totally new to development get started?  The answer is not that you need to go learn C or C++.  It’s okay if you don’t start the way I did, partially because some of the platforms and languages are nearly extinct.  You don’t have to start with languages like C# or Java and it doesn’t make you inferior if you don’t.  The concepts that you can use to get a job or finish real projects you can actually ship aren’t the same today as they were in 1984 or even 1994.

The answer is…

In my opinion…

If you are just getting started with software development today, the language you should strive to learn first is JavaScript.  Overall, you want to concentrate first on building web sites.  But today, the opportunity with JavaScript is unparalleled.  I’ll go over some of that opportunity in a future post.

I’m looking forward to sharing with you the reasons why I think you should pick JavaScript first, but I’d also like to know what you think.  I’d love to hear from you in the comments.

Teaching Others to Code

8. January 2015 15:47 by cagomez in   //  Tags:   //   Comments (0)

In 2006, I moved to southeastern Pennsylvania.  Just a year later I discovered Philly.NET, the leading Microsoft developer user group in the Philadelphia area.  I was inspired by the brilliant presentations given by the local leaders, Microsoft MVPs, and Microsoft evangelists. 

It took me about another year to decide I wanted to join the ranks of dedicated speakers at their Code Camps and I started off by presenting how you could write games for the new Windows Phone 7 operating system.  I stuck with the game talks for awhile, but I’ve also been hard at work talking about ASP.NET features.  I use ASP.NET on the job and I enjoy game development as a hobby, so I’ve been on these parallel tracks.

Teaching other developers

What this means, essentially, is that I’ve been teaching development techniques or tools to other developers.  This means I get to assume some or all of the following:

  • The audience is proficient with C#.  They use Visual Studio and it’s debugger regularly.
  • The audience is proficient with ASP.NET (I’ve gone as far as assumed they know frameworks like ASP.NET MVC).
  • The audience has an introductory level of JavaScript understanding (I knew not to assume that even seasoned ASP.NET developers had a thorough understanding of client-side development since ASP.NET has a server-side heritage).
  • The audience understands concepts like HTTP, TCP/IP, listening on a port, why you’d build a client/server architecture,

On the contrary, I never assumed the audience understood game development concepts, because I knew I was speaking to “business developers”, so this meant I tried to explain concepts like:

  • The game loop as the controlling program structure rather than event based programming
  • Sprites, Sprite sheets, and sprite animation (2D animation)
  • Simple vector math to enable gameplay through the update loop
  • Getting user input on a per frame basis

These lists are not complete, but they illustrated that I was consciously thinking about what I thought my audience already knew and what they didn’t.  I comprehended as time went by that I was assuming too much about the first list and that I needed to make my talks about ASP.NET SignalR work for people new to ASP.NET as well, because they might be evaluating ASP.NET SignalR versus Socket.Io or their own WebSockets implementation.

Teaching someone to code

The point of all this is to introduce that I have recently been working on teaching people to code.  When I say teaching people to code, I mean starting nearly from scratch.  This is VERY DIFFERENT from teaching developers new tricks.  This is thinking about how to best bring someone up from the bottom and help them learn how to build software and how to go about the process of learning more every day.

I have two motivators for this.  First off, I decided to start a game developers group.  It was “the group I always wanted to go to.”  So I now am the co-founder of Philly GameWorks.  We meet in Malvern, PA at the Microsoft offices, but my mission for the group was to be a place where anyone could learn to develop and publish their first video game (on any platform).  This attracted business developers, but it has also attracted a number of artists, designers, and kids.

However, I quickly understood that I was not just speaking to developers anymore, and that I couldn’t simply assume someone who came to Philly GameWorks even knew how to code! 

At the same time, I realized that there was a whole language of terminology and concepts that would become useful to these budding game developers. 

For example, over a decade of game development as a hobby, I became fairly conversant in 3D Graphics lingo and concepts.  I realized I needed to take a step back and plan a meetup where we just discussed these concepts and terms… an Introduction to 3D Graphics Programming… but teaching the concepts, not the code.

And it was our highest attended meetup so far.

The second motivation is that recently I had two longtime friends decide they wanted to learn to build web sites.  They started aggressively on their own, and another veteran developer and I who are all mutual friends have been trying to guide them and push them.  But this was yet a whole other reason to think more deeply about how to go about teaching someone to code.

I’ve begun to observe some things and form some ideas about how to go about teaching someone to code based on both of these experiences.  I realized that others might benefit from some of the same advice, techniques, or content that I’m building for Philly GameWorks or in talking with my other “students”.

I advised these new students to do two things:

  • Start working on a real web site, perhaps a small app that does something useful or a small game.  Art is shipping!
  • Blog about your experience.  This helps reinforce that you are doing and working, and now you have what you learned in writing.  Reinforcement!
    One of those blogs is underway, courtesy of Sean Hornsby.  I do suggest you check it out if you either are learning to code or interesting in observing the process.
    So coming up next, I want to compare my journey in learning to code… a journey that started in 1984 (or thereabouts) and what I am recommending as a journey today.  Times change.  You’ll see they aren’t identical paths or parallel paths.

Code Camp NYC - The Real Time Web with SignalR

13. September 2014 09:13 by cagomez in   //  Tags:   //   Comments (0)

Thanks to everyone for attending my session on SignalR.  I talked about quite a few things in the session that I linked to below.

If you’re looking for links to materials for SignalR, here they are!

PowerPoint Slides (Looks like DropBox will open these for you now right in your browser)

These days I’ve really latched onto using GitHub as the place to update these demos with new techniques and ideas.  Combine that with continuous deployment and I hope to soon be able to provide people with working code and running samples.

Chatter Demo

[View on GitHub] - Clone Url: https://github.com/SpaceShot/Chatter.git
Demonstrates SignalR basics.
Also includes Windows 8 Store version to demonstrate cross-platform capabilities of SignalR as your backend.

Stock Ticker Demo

[View on GitHub]  Clone Url: https://github.com/SpaceShot/StockTicker.git
Demonstrates IHubContext so you can make calls to clients from outside a SignalR Hub.
Demonstrates how you can avoid putting your business or simulation logic in SignalR Hubs.

Game Board Demo

[View on GitHub]  Clone Url: https://github.com/SpaceShot/SignalR-BoardGame.git
Demonstrates self-hosting SignalR in a Console app.
Demonstrates cross-origin request support with the client web pages originating from a separate MVC project.

Videos to watch

Building Real-time Web Apps with ASP.NET SignalR (Build 2012)

Scaling the Real-time Web with ASP.NET SignalR (Build 2013)

Under the covers with ASP.NET SignalR (NDC 2013)

dotNetConf 2014 SignalR – Introduction to SignalR as part of the online dotNetConf

Understanding SignalR Performance (NDC 2014) – Talks about how to think about wringing the best performance and how to measure

SignalR Lightning Round

23. July 2014 18:21 by cagomez in   //  Tags:   //   Comments (0)

Thanks for attending Philly.Net’s 15 minutes of Fame with our fast paced topical talks in fifteen minutes each.

If you’re looking for links to materials for SignalR, here they are!

Chatter Demo

[View on GitHub]
Demonstrates SignalR basics.
Also includes Windows 8 Store version to demonstrate cross-platform capabilities of SignalR as your backend.

Stock Ticker Demo

[View on GitHub]
Demonstrates IHubContext so you can make calls to clients from outside a SignalR Hub.
Demonstrates how you can avoid putting your business or simulation logic in SignalR Hubs.

Videos to watch

Building Real-time Web Apps with ASP.NET SignalR (Build 2012)

Scaling the Real-time Web with ASP.NET SignalR (Build 2013)

Under the covers with ASP.NET SignalR (NDC 2013)

dotNetConf 2014 SignalR

Getting Started With Publishing Games

22. April 2014 14:27 by cagomez in   //  Tags:   //   Comments (0)

I created a few videos that can help you get started with publishing games on Windows.  I’m going to continue making videos and blogging about them.  The videos are a way for you to see in bite-sized increments how to get started publishing games.

First, I decided to use the Unity game engine (www.unity3d.com) because you can get started for free, and you can publish to the Windows Store, Windows Phone store, Android, and iOS right away.

There’s no question the web site is a little misleading about this, so I will be making more videos where I introduce basic concepts but I’d also like to go through the last mile of platform specific content that will get your game approved.

To start, you can get the complete free Visual Studio Express 2013 for Windows (to make Windows Store apps) and the free Unity engine download, and these videos show you how:

The Real Time Web presented at First State .Net User Group

27. February 2014 16:30 by cagomez in   //  Tags:   //   Comments (0)

Thanks to everyone for attending my presentation about SignalR, OWIN, and the Real Time Web at First State .Net User Group.

Links

Building Real-time Web Apps at Build 2012 (good overview, but getting outdated. SignalR 1.x)
http://channel9.msdn.com/Events/Build/2012/3-034/player

Scaling the Real Time Web at Build 2013
http://channel9.msdn.com/Events/Build/2013/3-502

SignalR under the covers (Create a SignalR “lite” on stage)
http://vimeo.com/68383353

OWIN and Katana
http://www.asp.net/aspnet/overview/owin-and-katana/getting-started-with-owin-and-katana

The ASP.NET SignalR Getting Started Site:
http://www.asp.net/signalr/overview/signalr-20

Cross Platform Chat Sample on GitHub:
https://github.com/SpaceShot/Chatter

SignalR in action: A “board game” sample:
http://spaceshot.net

Forza 5 crashing – Should you go wireless?

21. January 2014 08:40 by cagomez in   //  Tags:   //   Comments (0)

(For YouTube videos of the crashing issues, where I demonstrate corrupt downloads of Forza Motorsport 5, and a full history of my troubleshooting of the Xbox One and Forza 5, see here: Forza 5 crashes on specific track every time, broken since launch)

I know what you are thinking.  How can this possibly be related?  I don’t know.  But for three people with three different Xbox One consoles, it seems to be working to switch from wired to wireless and redownloading.  Want the details?  Read on…

I had given up on Forza 5 and, truth be told, looked into returning my Xbox One.  My retailer return period expires in a week or so, and I was kind of done with being the troubleshooter over this.

Then I made some connections on Twitter and YouTube.  People had seen my blog posts, forum posts, and videos and said “I have the same problem!”

To make a long story short, one of these people (@tiwahu on Twitter) thought there might be an issue with using the Wired connection on Xbox One with our crappy Verizon supplied Fios 10/100 routers.

What is interesting about this is your natural inclination is “wired is better.”  I was asked by support a few times if I was connected wired into the router, and asked to provide more details about that. They preferred wired.  Who wouldn’t?

More...

Forza 5 crashes on specific track every time, broken since launch.

19. December 2013 10:31 by cagomez in   //  Tags:   //   Comments (0)
The following is an email I sent to a support email and also posted on the Forza Motorsport forums.  I needed to post it here because the folks at @XboxSupport have been the only ones to be truly responsive to my issues.  However, I can not keep describing the whole issue 140 characters at a time since each new day I encounter a new person who needs me to start over with them.
 
I keep the whole twitter thread link saved here:
 
 
Anyone reading this for the first time, please review that thread and the youtube video I discuss.  I have also extensively explained the issues in the linked forum posts.
 
What is very clear is that every time I install the game, the install appears to not completely work and at least one track will never load for me (no matter the game type, car, or user profile).  That track (so far it has been one per download but it doesn’t have to be.  Other Forza Motorsport forum users report problems with more than one) will crash forever, on any race type, mode, or user profile until i delete and redownload the game.
 
The problem is I can not get a clean download where I can prove every track works.  Each time, it may be a different track that is corrupt.  I still think it is possible for more than one to be corrupt.
 
So far no one appears to be able to help me.  I have had this problem since launch, although it took awhile to figure it out, and since Dec 8th I have been keeping meticulous notes about it.
 
We are almost at a month since launch and it is getting really annoying when you think about the hard earned money you've spent on a console and a game and the vendor of that game will either censor or refuse to respond to your pleas to help them troubleshoot the game.
 
They have the money already so perhaps that explains that...
 

Philly.NET Code Camp 2013.2 - SignalR

25. November 2013 12:44 by cagomez in   //  Tags:   //   Comments (1)

Thanks to everyone who attended my talk about using SignalR “in the real world.”  Besides being an introduction to SignalR for everyone who’s curious about this technology, we talked about some more advanced scenarios I have experience with, including using the IHubContext interface to broadcast from outside a SignalR Hub and the exciting “cross platform” scenario that is enabled by the several SignalR clients out there.

I wanted to start getting all the code we looked at up on github.  I will continue to update this post until all the samples we saw are ready for you to try.

https://github.com/spaceshot/chatter – This is the repository holding the chat web app and windows store app.  They should work together.

I did develop these projects in Visual Studio 2013, which has built in Git support and it is a lot easier to clone the projects directly from GitHub and begin working.  If you have a need for Visual Studio 2012 support, please let me know.

Up next, I need to get the StockTicker sample (modifying an existing service) up and finally the “game board” sample where you could move game tokens around a sample grid.

Coming soon are my tutorial writeups for those who didn’t make the code camp talk!

About the author

Chris Gomez has been writing Windows software for about 20 years.  In 1984, an IBM 8088 PC came home. There wasn't much to do with it so he wrote games in BASICA.  This blog is for those of us who've made a career developing software but want to learn to make games.

Month List