Programmers learning something new: a simple guide

I struggle a lot to learn new programming languages on my own.  It’s not that I’m not smart (I want to believe I am VERY smart) but it’s the combination of lack of time, lack of desire and having no answer to the question: “Great, I’ve learned X… now what?”

I’ve started to learn about Django, and I believe it will be DIFFERENT this time.  Why?  Because I have created a simple guide to learning something new from a programming perspective:

STEP 1: Accept that you may burn out and ask “why bother” and figure out the answer to it before starting

I had stated before:  It’s hard for me to learn something new when I expect to do precisely nothing with it.  This is what happened with me and Ruby on Rails.  Ruby is a cool language and Ruby on Rails was really awesome to build scaffolding with.  However, I didn’t really know what else I wanted to do with it.  I suppose I could have learned it’s cool AJAX capabilities that go with it, but really, it just didn’t appeal to me.  Therefore, it went on the infinite back-burner

Back when LINQ was new, I struggled to learn it as well, because even though I do .NET professionally, I was so knee-deep into what I was doing that it would have been almost a waste of time to really sufficiently learn it.  I finally got a project in which allowed me to utilize LINQ to SQL effectively and easily and since then I wouldn’t know what I’d do without it. Again, once purpose settled in, I was ready and very willing to learn.

Your ‘why bother’ may be different.  Your success may be dependent on how you handle it.

STEP 2: Do the tutorials

These days, it’s pretty hard to find popular frameworks which have no or incomplete tutorials (I’m sure anyone could find examples where this isn’t true, but in general, it’s true).  Also, framework creators know that a quick and simple tutorial is the best chance for a developer to get on board, especially in the framework’s early stages.  Django has a wonderful tutorial, split up into four parts building a poll system (I feel like poll systems are the hello world of the web development world).

Here are reasons why I don’t like to just “dive into the code”:

  • You cannot be guaranteed what you are looking at is the correct way to do it
  • Most of us are lazy, and there may be certain things hidden by shortcuts which obfuscate key basic techniques used by the framework/programming language
  • There is more impact in doing it yourself, seeing what works and what doesn’t, rather than just reading through it and trusting it works
  • It’s less fun!

Tutorials are the best way to get yourself acclimated, set up your environment, and ultimately help you decide “why bother?”

STEP 3: Research technology on StackOverflow

I am a HUGE fan of StackOverflow.  I’ve never met a bigger group of developers, all willing to write great questions and thorough yet quick responses.  The reputation system is awesome.  Any developer not utilizing StackOverflow is SERIOUSLY missing out.

StackOverflow is a great way to see what difficulties most users have, as well as to see how these user’s issues are resolved.  While it’s not immediately helpful, you will drill back into your head, and all of a sudden, you’ll come up to a problem where you say “wow, I remember this on StackOverflow!”

StackOverflow is a great place to see how a technology stacks (get it) up.  For example, a quick search of Django immediately show questions about scalability, whether a user should use Django or X and configuration questions. A few quick searches and research will give you a sense of what type of framework Django is.

STEP 4: Think Small

I picked Django because I had an idea for a website and needed a specific framework.  I discussed the idea with a buddy of mine, a developer who uses Django, and he sold me the benefits of using Django.  I owned hosting which could support Django but not .NET, so it looked like a good choice.  Also, I was in the ‘market’ to learn something new.

Unfortunately, I couldn’t just dive in because I needed to learn Python as well as the basics of the framework.  Therefore, I decided to table the original idea for now and decided to build a personal website for myself entirely in Django.  It took hours to do, I had to read up on a lot of how Django and Pyhton works, but the idea was simple enough to wrap my head around so I was successful.  You should see a site hopefully by the end of next week.  Because it’s my own personal website (and not a large, professional site), it’s okay if it has a few problems with it or if I did it incorrectly;  it’s all part of the learning process.

STEP 5: Have a buddy help you learn

It’s nice to be able to send code to someone, even if it is just a file or two, for them to kindly message you back and say “get out of your .NET world, here’s a better way to handle what you are trying to do.”  Having a human allows you to do a sanity check as well as to see if you’ve missed any nuances.  It’s also nice to have someone to ask for help on really simple yet bothersome problems.  It’s a lot harder to do this using the Internet.

STEP 6: Have fun!

Every blog post with steps needs a cop-out answer.  Here is mine.  Most of us are learning new languages because ultimately we want to.  You should have fun with your learning experience!

Mini Post – DotNetNuke and web.config problems

I could have Twittered this but I wanted to put it here: Every now and again I find myself refreshing my developer’s copy of my project on my local computer from source control.

The way I have source control is primitive and probably incorrect. I tend to save ALL of my project (DotNetNuke included) into source control, so when I get a clean setup, I can basically run it out of the box.

This particular time, I was working with a different database than I normally do. Because of this, my source control wrote over my web.config and copied the wrong database settings, which resulted in the web.config pointing to a no-longer existing database.

When I loaded up my website, I was greeted with the installation wizard from DotNetNuke. “Okay,” I thought, “Perhaps I forgot to update this particular database with the new DNN version.” I clicked on next a few times and realized it was just the wrong database being referenced. I changed the web.config to be the correct database and credentials and all was well…

Or was it?

I loaded up my project and I was getting rather unhelpful “I need to put a ScriptManager on the page in order to use AJAX.net” error. I just couldn’t figure it out! It worked before! Long story short, the DNN install wizard messed around with the web.config and broke a few things configured specifically to my install. Once I pulled up an older web.config, everything worked perfectly.

This wasted about 2 hours of my time (which I don’t really have) and was easily avoidable if I was paying attention.

Lesson learned: Always be methodical with processes which you perform regularly.  If something strange goes wrong within the process, it probably doesn’t belong and should be approached very, VERY carefully.

Apple and the app store: Are they doing it wrong?

Rotten AppleRecently I read an essay from Paul Graham titled “Apple’s Mistake” (if you’ve never read any of Paul Graham’s essays, I strongly suggest you check his web page out, http://www.paulgraham.com) which describes why the app store is not designed with the developer in mind, and that Apple is selling the apps a lot like how they sell their music and movies.   Paul indicates that if this problem isn’t fixed, developers will flock to other devices and companies once the market for them becomes bigger.

I’ve personally never submitted an app to the App store.  I have, however been involved in an App project which was rejected by Apple.  We submitted the app somewhere in the middle of October and did not get the app on the store until November 19th.  As far as I have been told, Apple rejected the app because it was sending too much data through the network, and wouldn’t disclose how much an app was allowed.

I am interested in mobile development because it’s becoming a major player in the communication and technology world.  If it were to take me a month to get an app released, it would make me think twice about developing it.

Apple claims that they have a review process for security purposes.  If done well, it benefits us, the developers, because if our apps are given the ‘seal of approval’ we will not have to sell security to our clients.

Here are four changes Apple needs to do in order to fix their process:

1. Provide a way to test the app against the approval process to the developers. Generating automated test cases and unit tests for applications should be done for ANY application you plan on releasing, but Apple should provide an ability to test your application based on their approval guidelines.  This way, a developer can be more confident in their submission

2. Rules and guidelines need to be more visible to the developer world. Giving developer’s access to all of the guidelines Apple uses to determine whether or not an app is accepted may result in them designing their apps just to avoid the apple hammer.  This aside, visibility enables developers to design with 100% compliance to what Apple’s needs are.

3. Developers should have more information about why their app was rejected and be able to challenge the decision. There needs to be a better process with facilitating rejections.  In the case of the app I was involved with, simply stating that we are sending too much data and not disclosing how much you are allowed to send is a terrible experience.  This means that our developers had to go back, find what was taking up most of the bandwidth, design it so it wouldn’t use as much, and hope it is enough.  This… is simply ridiculous.  Imagine it took an hour each time you compiled, found a bug and fixed it?  You’d quit your job in less than a week!

I also believe a developer should be allowed to contest a decision to reject an app. Suppose in our case, we had good reasons for sending so much data?  What if it truly enhanced the usability of the iPhone?  What if the data was being sent for a good cause?  It should at least be up for discussion.

4. Allow a private store area where you can release apps to a subset of users (perhaps by company) and loosen (or get rid of altogether) the approval process. It’s going to become more and more important for companies to come up with custom applications that only they will use in their own business.  Suppose a company had a large team of technicians and wanted to provide a logging program for their iPhone.  How would they be able to do that easily?  I know you can provision separate phones for an application, but that seems clumsy.

I love Apple, and I am hugely impressed with the amount of professional looking apps are being released in the store these days.  However, other phones are going to become real competitors.  If Apple doesn’t want to lose their user-base, they need to keep the app store thriving.  In order to keep the app store thriving, they need to make their developers happy.

ModalPopupExtender .Show() Caveat

I’ll admit it… I don’t mind AJAX.NET.  In fact, I like a lot of the toolkit controls they provide.  Because I am “chained” to .NET and DotNetNuke, I don’t much of a choice when it comes to bleeding-edge technology.

One thing I tend to use frequently is the ModalPopupExtender.  I had a requirement to show the modal popup when the page loads.  Easy enough, I just instansiate the code and in the onLoad code-behind do mpe.Show().

However, this didn’t work It gave me an ugly error.  After sifting through a bunch of unhelpful forum posts online, I came across this issue in the AJAX Control Toolkit issue tracker.  Reading through the description, you notice that the problem has to do with the fact that there is a missing semi-colon if you try to invoke the modal through server-side on a page with validation.

Because the modal I was programming would not need the validation on the page, I simply turned off validation when the modal was invoked.  This worked like a charm.  If you require validation with the modal, I strongly suggest you check out the issue tracker page.