Showing posts with label programming. Show all posts
Showing posts with label programming. Show all posts

Thursday, June 11, 2020

Skills to Learn for Software Developers and Others

The previous post discussed math topics I'm interested in learning, this will discuss programming-related skills that are important and I'd like to improve at.

While there are many technical skills important for software developers, this post will cover general (non-programming) skills, and programming skills that are useful for other careers.

General skills
These are general skills that are important in software development and in many other office jobs as well:
  • Focus - Often one encounters difficulties and it's easy to get frustrated and distracted. The test is still failing? Might as well browse emails or the web. But switching tasks breaks up the train of thought you had so you'll take even longer to solve the problem. (One second, just going to check my emails. Now where was I..? ) Often one needs relentless focus on an issue in order to make progress quickly. And not just "guess and check" thinking where you randomly try different things hoping you'll find a solution, but "binary search" thinking where you hone in on the issue until it's solved. There are times when it can be helpful to take a break and return to the problem later, but that should be done after you've given the problem solid focus and hit a wall. 
  • Typing 
    • While raw typing speed should never be a significant bottleneck when programming, any effort on typing or fixing typos can take your focus off the main issue at hand.
    • Programmers type far more chats and emails than actual code; it's best to do this as quickly as possible.
    • Besides basic typing skills, one should also be comfortable with the relevant keyboard shortcuts for their OS, terminal and IDE. Moving to the mouse is another micro distraction that is best avoided. 
  • Memory / note system - When learning programming one struggles with remembering all sorts of details about language and syntax, but eventually you get the overall hang of how things work, and can easily look up syntax as needed. But there will still be many issues that you solve (or get help with) where you'll want to remember the solution for the future, and your memory isn't always enough. It's useful to have a note or bookmark system to quickly lookup how to do things.
General programming skills 
These are programming skills that are useful for many jobs, not just for professional software developers: 
  • SQL - The world is built on SQL, often with a few other layers stacked on top of it. Besides writing SQL when developing an actual application, it's essential in many other cases such as:
    • analyzing experiments or general usage of a product
    • finding sample data to test something out
    • querying logs to debug an issue in production
Many alternatives to SQL have been developed, but there's often no avoiding SQL itself. It helps to become proficient with it so one can quickly find the data they need and avoid common bugs such as accidentally duplicating rows. Many other professions, such as analysts or product managers, will also find it useful.
  • Regex - Programming is often about finding the right example to base your code on, or about quickly finding and replacing text. Regex makes this faster. Anyone who deals with large data or texts will find it helpful as well. 
  • Scripting - Sometimes it's useful to write a quick script to help generate code or analyze data. Non-professional programmers may want to write a script to help with their science research or with their spreadsheets.
Worth learning
While one can learn many skills on the job, often it's helpful to take a step back and learn the subject in-depth. This way you can learn how to do something properly instead of just finding the easiest solution at the time. This would be an area where schools could help, but as expected, they don't give these subjects their proper due.

Wednesday, May 27, 2020

Silver Bullets in Software Development

No Silver Bullet
In the 1986 Essay No Silver Bullet, Fred Brooks argued that nothing would provide a tenfold improvement in software development within a decade:
But, as we look to the horizon of a decade hence, we see no silver bullet. There is no single development, in either technology or in management technique, that by itself promises even one order-of-magnitude improvement in productivity, in reliability, in simplicity. 
He divided software development into essential and accidental difficulties:
  • essential ones are required due to the complexity of the problem itself - the software needs to satisfy a "conceptual construct" in a precise manner
  • accidental ones (like determining the correct syntax) are incidental to the problem and can become simpler with better hardware and software techniques.
Accidental difficulties had been reduced to such an an extent by 1986 that Brooks argued most software development dealt with essential complexities that could not be removed. While incremental progress would be possible, revolutionary "silver bullets" were impossible. Brooks reiterated his claims in 1995, but it's worth revisiting again. Have there been any silver bullets since then? How much of software development today deals with essential vs. accidental problems?

Silver Bullets. Photo Credit: Money Metals, Flickr

Software Development Today
On one hand there has been a tremendous amount of progress in speeding up development and in focusing on the essential problems:
  • Google and StackOverflow let one quickly find answers to questions
  • Open source libraries allow for broad code re-use
  • Cloud services like AWS make it easier to launch in production
  • Frameworks like Ruby on Rails provide default assumptions so the engineer can focus on defining the product
On the other hand it seems like much of engineering work today, particularly at large companies, deals with complex issues not connected directly to defining a product:
  • As products grow to encompass multiple teams, applications may be split into sub-applications for each team, but integrating them together adds additional layers of complexity
  • Integration tests involve so many systems that they're a constant point of failure, and often adding or updating a feature can require more time dealing with tests than with the actual code
  • As products grow larger and scale to more users, engineers spend more time on smaller optimizations
The move from desktop applications to the web also added new layers of complexity:
  • Application logic needs to be replicated on both the server and client side 
  • Every language and framework needs to be converted to Javascript, an unusual choice for an "assembly" language
  • Since application data isn't generally stored on the client, latency becomes a constant issue
Depending on where one draws the dividing line, these problems can be considered either essential or accidental. While they do not deal with specifying the product itself, they arise from the size of the teams or from the technologies involved. Software development still deals with both the essential aspects of specifying a product and the many nuts and bolts of making it work correctly in the real world. 

A Silver Bullet 
There is a silver bullet that has completely revolutionized development - machine learning. Brooks had specifically dismissed AI as a silver bullet since back then AI meant "heuristic" or rule-based programming, where each product would still need all its details specified:
The techniques used for speech recognition seem to have little in common with those used for image recognition, and both are different from those used in expert systems. I have a hard time seeing how image recognition, for example, will make any appreciable difference in programming practice. The same problem is true of speech recognition. The hard thing about building software is deciding what one wants to say, not saying it. No facilitation of expression can give more than marginal gains.
Enter machine learning (ML), particularly deep learning with neural networks. Now the same overall techniques can be used for both speech recognition and image recognition. One no longer needs to decide precisely what "one wants to say", one just specifies a goal and given enough data, the neural networks will figure out the details. Systems that involved years of coding before can be replaced with a machine that learns on its own. For example, AlphaZero was able to learn chess by playing itself for a few hours and then it beat the best existing chess software. Programmers had spent decades improving chess software with hand-written heuristics, but machine learning outplayed them all. 

What's next
Despite the amazing progress of ML, most areas of software development do not have enough data to truly benefit from it, so they still have the same overall structure and process as years ago. What then are the next areas of progress?
  • Assisted programming - generating a program from a product definition has always been a dream (even mentioned by Brooks), and there's been recent progress. For the near future, humans are still needed to specify the nitty gritty details in code. But online resources like StackOverflow and Github (besides company's internal codebases) contain enough data that search and ML algorithms will be able to assist in this process. A significant part of programming can be finding an example and modifying it for one's purpose, so even a better search alone will speed up overall development.
  • Much of programming consists of plumbing - connecting databases to an application, determining how to summarize the data, deciding how to display it in a UI. Since some of this is very standardized, companies can choose to use "low code" tools to build them, using products built for that purpose (e.g. from Salesforce) or even just advanced spreadsheets (Airtable). While visual programing does not contain the power and flexibility for building large applications, some products have much smaller scopes.
  • Some application plumbing will no longer be necessary for other reasons - ML will take over optimizing certain goals from humans, so a user interface will no longer be needed. For example, when an ad campaign runs on ML, much less knobs and dials need to be created for users. The system just takes in a budget and perhaps a goal to optimize for. In some cases, developers may still create tools for users to interface with the ML system, but in other cases the system will be a fully automated blackbox. Developing user interfaces might remain the same, but what interfaces are needed will change.
In short, software development will continue to make incremental progress in some areas and add accidental complexity in other areas, while some areas will be completely revolutionized by ML.





Wednesday, December 5, 2012

A Map of Resources for Learning Ruby

My previous chart of resources to learn programming was well-received, but some people suggested additional resources. I decided I would try a new format to display more resources for learning programming. It is a map of different resources, which are ordered from left to right based on experience. You can choose a resource from each vertical, and then move to the right as you gain experience. A sample path is shown in the image. It would be interesting to see how these kind of charts can be improved to quickly display relevant information about each item. Click on the image below get a clickable image map, an SVG should be coming soon.

Map of ruby resources

A Map of Resources for Learning Ruby

My previous chart of resources to learn programming was well-received, but some people suggested additional resources. I decided I would try a new format to display more resources for learning programming. It is a map of different resources, which are ordered from left to right based on experience. You can choose a resource from each vertical, and then move to the right as you gain experience. A sample path is shown in the image. It would be interesting to see how these kind of charts can be improved to quickly display relevant information about each item. Click on the image below get a clickable image map, an SVG should be coming soon.

Map of ruby resources

Sunday, December 2, 2012

Job Market for Programming Languages

One consideration when choosing a programming language is the demand in the job market for people who know that language. I did some searches on different job sites to see what skills are in demand. Below are the results from Monster.com for jobs that tagged specific languages as skills. For more information, I created a Google Spreadsheet with job data from different websites.

Java is used extensively in big companies, so it has the most results. Javascript is the only language of front-end development, so it takes the second spot. PHP is clearly less popular than it used to be, while Python and Ruby vary by website.

Job Market for Programming Languages

One consideration when choosing a programming language is the demand in the job market for people who know that language. I did some searches on different job sites to see what skills are in demand. Below are the results from Monster.com for jobs that tagged specific languages as skills. For more information, I created a Google Spreadsheet with job data from different websites.

Java is used extensively in big companies, so it has the most results. Javascript is the only language of front-end development, so it takes the second spot. PHP is clearly less popular than it used to be, while Python and Ruby vary by website.

Sunday, November 25, 2012

Writing with Less Writing

Ideas discussed:

  • People think all writing needs to be paragraphs, but that's not always the best way to express something.

  • What's the Appeal of Twitter? + Idea for new platform

  • At least include an outline in your article!

  • Bonus: What writing can learn from programming


My recent chart on learning programming did quite well and got upvoted on Hacker News and Reddit. I realized that one chart was able to encapsulate the important information from 3 previous blog posts. This makes me think there might be too much of a bias to write content in a specific form and style with paragraphs and connecting sentences, when sometimes another form would work better. A chart or diagram can display certain information in a faster and clearer manner than long paragraphs, making the paragraphs unnecessary. Different diagrams and styles can be used for different types of information.


Ways of presenting content







































Content FormatGood for this type of contentZappable ExampleBenefits for readerExtra stuff that get stuck in
Paragraphs of TextLong connected argumentsMaybe Google and the Future of SearchEasy linear readConnecting sentences, stylistic phrases
TableRepeated categories of informationResources to Learn ProgrammingFast to referenceCertain cells just to match others in row. (Maybe use NoSQL-style instead ~)
FlowchartSimple decision guidePicking a Programming LanguageCan quickly reach relevant decisionsRandom Jokes
Outline-StyleHierarchical content of separate pointsAttempt belowCan easily skip subsectionsHopefully nothing



Even if content doesn't fit into a chart, it does not mean that standard paragraphs are necessary. Sometimes an Outline-style could do the trick.

Outline vs. Paragraphs

  • I often start with ideas in note-form before writing a post

  • Before publishing notes, need to refine and clarify ideas.

  • Also includes "textification" into paragraphs, which consist of things like:

    • Keeping to a writing-style (varying words, paragraph format)

    • Putting in filler words to build and connect sentences



  • This turns writing into nice essay, but it can obscure points for both the writer and reader

    • It becomes harder for the writer to revise essay when each change affects the continuity of the sentences and paragraphs. (Maybe writers should also aim for looser coupling!)

    • Certain articles (e.g. academic ones) may be so complicated, readers may feel need to create their own outline or diagram to follow it



  • Notes need to be refined before being published, but they can still be kept in an outline style, with several benefits:

    • Often quicker to write than figuring out how to "textify" content.

    • Easier for reader to follow overall flow of argument

    • Lets reader skip certain sections or examples and still follow argument (In fact, maybe the reader should be able to understand the argument heading without even reading the implementation!)



  • Outline-style can be better for reader and writer, though not sure about this example


Obviously, people know that concise writing or charts are often helpful. However, I think people still feel constrained by standard style expectations. That's why they need things like Twitter and even Powerpoint to permit them to write in shorter form.
https://twitter.com/arikrak/status/141274526263672833
While Twitter's limits may be overkill in cases where you actually want to say something, the fact that its so successful shows the power of letting people get to the point. Maybe someone should create a blogging platform that enforces a posts that are concise and include a diagram, outline or chart. This could help popularize a new style of writing.

I'm not arguing for eliminating essay-style text, I just think it might be worth putting more outlines and charts within writing. Even if much of an article needs to be in paragraphs, perhaps some of it would be clearer or more effective as a chart. And more articles should come with short outlines (or diagrams) that says what their main points are. This would let people decide if they want to read it or review what it said afterwards. Why should some one need to construct their own outline or argument diagram to analyze an argument?

Charts and outlines are really just a minor step. For more challenging material, one can go beyond such static content and create more interactive content. But that's for another post...

Stay tuned by following me on Twitter, RSS or Email. 

Friday, November 23, 2012

Chart for Learning a Programming Language

The previous chart helped beginners pick a language, this one shows them what resources to use to learn it. It's better to spend time doing things than to passively read or watch content, so I selected interactive websites, books and courses. Start by going through an online tutorial, and then either read through some of a book or watch an online course. Personally I think a book is better than a video since they're more concise and easier to reference, but most videos below are short and to the point. The chart is based on these posts: Picking a LanguageGeneral TipsJava and PythonWeb: HTML Javascript and PHPLearning Ruby and Rails

Free Resources For Learning a Programming Language






























































JavaPythonRubyJavascript
Good For Kids / Game ProgrammingGreenfootInvent Your Own Computer Games Hackety-Hack, Games: Ruby4KidsCodeAvengers
Interactive Tutorial - Codecademy?No, You can try ProgramrYesYes, there’s also
TryRuby
Yes
More Practice and HelpCodingBat ProblemsVisualize Python executing
(also CodingBat)
RubyMonk*
(1st part is free)
Use Firebug or Developer Tools.
(See Waterbear for visual coding)
Good Free Book for Teaching ProgrammingHow to Think Like a Computer ScientistHow to Think Like a Computer ScientistLearn to Program
Humble Little Ruby Book
Eloquent Javascript
Interactive Video CourseIntro to CompSci -
Programming methodology
(Warning: full Stanford course)
Udacity - Intro to CompSci - Building a Search EngineCodeSchool’s RubyBits*.AppendTo Javascript 101
Advanced BookEffective Java*Dive Into Python 3Pickaxe Guide*JavaScript: The Definitive Guide*
More Training / BootcampsSee Local / Online collegesSee online courses or corporate PythonTrainingMost Bootcamps are for Ruby on RailsCatalyst.
For kids: CodeHS.com


* Not free. Update: added affiliate code to Amazon links.



Thursday, November 22, 2012

Picking a Programming Language - Chart

Now that I finished the series on programming, I figured I would make some charts for it. This flowchart will help people pick a language. Click below to enlarge, or view it on Scribd. For more info, see the original post.



Update: After you pick a language, you might want to know how to learn it or how to find a web host.

Learning Ruby and Rails

Note: This post on Ruby and Rails is the final one in a series on Learning How to Program. Previous posts were: Picking a Language, General Tips, Java and Python, and Web: HTML, Javascript, PHP

Say you don't want to edit old PHP scripts, but instead want to create your own new web application. A good choice would be Ruby on Rails, the 'cool' framework for creating websites. It contains various tools and elements that are common to most web applications so you do not need to re-create them from scratch in your own website.   For example, most web apps have forms that take user data and place them in a database. Ruby on Rails lets you create such forms quickly and securely. Rails is written in Ruby, so to code with Rails, you will need to know some Ruby. While you don't actually have to spend that much time coding with Ruby before starting Rails, I think it makes more sense for a beginner to get comfortable with programming basics before taking on a complex web framework.

Ruby
As always, it's good to jump right in with an interactive tutorial, which there is no lack of in Ruby. You can spend a few minutes on TryRuby and then look at Codecademy or go through slightly more advanced material on RubyMonk, which has 1 free course and additional courses for $10/month. If you like videos, you can pay $25/month and get access to CodeSchool's courses, including RubyBits.

You should have a book also though. Learn to Program is geared at teaching programming concepts to beginners, and they aso have a more recent paid edition. The Humble Little Ruby Book is good for learning Ruby, though if you prefer more attitude and random cartoons, there's the famous Why's Poigant Guide to Ruby. If you have more experience and really want to get experienced at Ruby, there's the Pickaxe Guide.

If you want to download something to teach kids Ruby, there's Hackety-Hack, and if they're just interested in games, there's Ruby4Kids.

Ruby on Rails
After learning the basics of programming and Ruby, you can start learning Rails, which also has interactive tutorials. CodeLearn recently launched to let people learn Rails by trying out things from within their browser. If you like learning by watching zombie videos, check out CodeScool's famous RailsForZombies. You can then signup to CodeSchool and get access to the sequel.

The 'official' free text to learn Rails is the Ruby on Rails Tutorial, which goes through all the details on how you would create a Twitter-clone, from getting things installed to version control, from "rails-flavored" ruby to nice CSS styles, and of course, all the fundamentals of Ruby on Rails.
The book places a strong strong emphasis on writing test code, which is code that tests out your main code to ensure it does what you want it to. It follows the TDD and BDD processes, which means you write the tests before you write your actual program's code. Sometimes you will spend more time writing the tests than actually writing the rails code, but this way you will know your software always works. You can always skips some of the test-parts if you feel its too much.
The issue with a step-by-step tutorial book is that you need to make sure you think about how to do things, and not just copy what the book says. It might be helpful to try to figure out what to do before looking at the code in the book, though that won't always be possible.

If you have a little experience, you might like Agile Web Development with Rails, which goes through how to create a shopping-cart application in part 1, and contains a rails reference in part 2. To learn how to do specific things, you can watch the screencasts on Railscasts. There's also the official Rails Guides, which cover various aspects of Rails.

Of course, to actually learn Rails or programming well, you need to work on your own projects. As mentioned, you should find someone to help you work through a project. If you have a couple months, you could consider signing up at one of the Rails bootcamps that sprung up recently. Devbootcamp pioneered the bootcamp approach in SF, AppAcademy  claims they'll only charge you if you get a job, Starter League is well-established in Chicago and Flatiron School recently started in NY. They charge $8k - 12k, but many give partial refunds if you take a job with one of the companies they're connected with.

With all these resources, it's easy to try out programing and then pursue it further if you like it.

Wednesday, November 21, 2012

Creating Websites - Programming Required

In a previous series, I discussed how you can build websites - no programming required. While you don't need to program to setup  you're own blog or wiki, you will need to program if you want to create or customize things beyond what your software has options for. In recent posts, I gave some tips for getting started with programming, and linked to some resources on Java and Python. This post will focus on the web languages - HTML, Javascript & PHP, and the final post will be on Ruby.

Before learning actual programming languages  you'll want to get familiar with the basics of the web. Web pages are structured with HTML and styled with CSS, so you should quickly learn how they work. If you were editing pages before using a WYSIWYG tool like Expression Web, its time to start editing the actual HTML and CSS code. You can either do this in a simple program like Notepad++, or within Expression Web from the "code" view so you can still use some of its tools. To start learning HTML, you can go through a tutorial, such as one of the resources here from Mozilla. W3Schools often comes up on Google searches, and they have some useful interactive resources, but beware that they may contain a few inaccuracies. To get an idea of how HTML and CSS is used, you can view the source of any webpage you visit by clicking on "view source" in your browser. You can also play around with the HTML and CSS from within the Chrome developer tools or with Firebug on Firefox. This will let see how many different websites use CSS styles.

HTML on modern websites are not created by hand or by an HTML editor, but by web applications, such as a CMS. Web apps are written in programming languages, such as PHP or Ruby. As discussed, many web apps are written in PHP. So if you want to develop new components for your Wordpress blog or wiki, you need to learn PHP.  W3schools has a fair amount of info on PHP, and I don't think it has too many errors. WebMonkey looks like it has a good tutorial for beginners.  There aren't many new interactive tutorials on PHP, but there are many books you can purchase.

If you're more interested in front-end development (such as visual effects on a page), you need to learn Javascript. Unlike PHP, it is growing in popularity, so there are a ton of resources online to learn Javascript. Previously-mentioned Codecademy created their first tutorial for Javascript, and they have many courses on the topic. They have a bunch of competitors now, such as CodeAvengers, which seems geared at kids. Its good to go through a book too, and Eloquent Javascript is a great interactive resource. The key is to not just read, but to practice and build things, which is easy to quickly do in Javascript. Firebug and Chrome's developer tools have great features for trying out your own javascript and exploring other website's scripts also. After you know the basics of Javascript, you will be able to not only customize web pages, but also create other things like Chrome extensions. In fact, Javascript can now even be used to run the server-side of a website with Node.js (though its not for beginners). This means that you could conceivably create entire websites with javascript only. If you really want to learn Javascript well, you could consider attending Catalyst which is a new bootcamp that opened to train beginners.

Stay tuned for the next post on Ruby and Ruby and Rails, the most popular modern framework for creating websites.

Wednesday, November 7, 2012

Learning How to Program with Python or Java

In the last post, I discussed some steps for learning to program, and ended with a few general resources. This post will provide some specific links and free books for learning programming with either Java and Python, and the next post will go into web development languages.

Python
As discussed, Python is a great language to learn programming with, and there are tons of learning resources online. A good path would be to start with a simple tutorial and problems, and then go through a more advanced resource that teaches fundamentals of programming.
Codecademy recently expanded to offer Python tutorials, and they have a well-designed site that's good for beginners. There are many other places you can practice problems, such as CodingBat or PythonChallenge. To get a better understanding of what the code does, you can visualize your Python executing.
To learn computer science fundamentals, How to Think Like a Computer Scientist is a great interactive book to go through. After you get through that (or if you already have programming experience), you'll want to look at Dive Into Python 3. If you want a video course, Udacity offers short videos combined with coding problems. You can start by building a search engine in Introduction to Computer Science, and then move on to either Algorithms or Web Development.
Also, If you know a kid who wants to create computer games, Invent Your Own Computer Games is a free eBook on the topic (see also the PyGame modules.)

Java
There aren't as many free Java resources, but there's enough to get started. There's a Java version of How to Think Like a Computer Scientist available online. There's also a free version of Thinking in Java, though you may want to buy the most recent version instead. If you like lots of pictures and attitude, Head First Java is a good book. Once you have more experience, the recommended Java book is Effective Java. You can also go through the official Java tutorials.

Since Java is a different kind of language than Python, there aren't as many interactive resources online. To practice problems, you can go through CodingBat and some stuff on Programr. However, to benefit fully from Java's "safe" features, you will want to do most of your programming in an IDE. I don't think you should use a beginner IDE like BlueJ, since it lacks features that are also useful for beginners. While you type, an IDE can catch certain kinds of errors and auto-suggest methods and let you lookup documentation. Later, you should also learn to use more advanced tools like the debugger. A good full IDE for beginners is Netbeans, though if you want to do Android development later, you should use Eclipse. However, if you know a kid who wants to learn programming, it might be worth checking out the Graphics-focused IDE, Greenfoot.

Android
Since app-development is very popular, I'll briefly discuss it here. Due to Android's complexity, you shouldn't try developing apps before you're comfortable with Java. One you're ready, Google provides a fair amount of training resources. You can also buy a book like Programming Android. If you're impatient to start creating apps, you can use the visual programming tool AppInventor, which should help teach some programming concepts.

 

Sunday, November 4, 2012

Learning How to Program - General Path

In the last post I discussed picking a programming language; this post will discuss a a general plan for learning programming. The next post should link to some language-specific resources.

Basics - The first step is probably to find a good online tutorial that teaches the basics. I don't think long video lectures are a good way to learn programming, since one needs to focus on doing things, and they are also hard to refer back to. Instead, one should find a good interactive tutorial that lets you practice as you go through it. You should practice with small additional problems on your own, either ones you make up or problems you find online.

Reference - Make sure you know where to lookup stuff. You don't want to immediately do a general Google search for every question. Each language has official documentation that you should be able to search quickly to find out how to use something. It might also be helpful to have a specific book or site you check to get more info. It can also help to keep your own code samples organized so you can quickly refer back to previous work you've done.

StackOverflow - StackOverflow.com is a free Q&A site for programming. Once you know your programming basics, if you have a question on how to do something, you can search StackOverflow to see if its been asked. (Often it's easier to search StackOverflow through a Google site search.) If you can't find an answer, you can ask the question yourself on StackOverflow, but make sure you spell out the specific issue your're having. Well-written questions on popular languages often receive very fast answers on StackOverflow.

Bigger Projects - After you've gone through the basics and worked on small coding problems, you'll be ready to take on a bigger project. You should now pick a project that you really want to work on, and learn more as you work on building it. When you get stuck, searching the web (and StackOverflow) will sometimes help you figure things out. However, it helps to have a more experienced programmer to turn to when you're really stuck or for general feedback and guidance. You can either find someone you know, hire a mentor, attend meetups, or even enroll in a programming bootcamp.

Stuff To Learn - Besides learning the specifics of your language, you should also learn the general basics of programming. This includes topics like object-oriented programming, algorithms and data structures. You don't need to cover everything that's done in a college algorithms class, but there are certain topics everyone programming should know. Some algorithms tutorials are available on TopCoder, and if you want a fuller treatment, Coursera and Udacity seem to have decent courses on the topic. Its also important to (eventually) learn good programming practice, such as using version control, debugging techniques, and writing test code (Udacity). Once you've learned these topics, you'll have the experience to help beginner programmers!

Monday, October 29, 2012

Learning How to Program - Picking a Langauge

Lately, learning how to program has become quite popular, so I figured I would put together a quick guide to help people get started. As I discuss in The Future of Education II, I think many people should learn some programming. Even if they don't want to do it full-time, they'll still be able to use it for various smaller things in life. In part I of this guide, I'll discuss the different popular languages that one can learn.

The first step is to pick a language. You shouldn't worry to much about this choice, since you can learn the basic programming fundamentals no matter what programming language you choose. However, you might as well pick the language that fits best with your goals. Since the web is the main area of action nowadays, I'll quickly review how websites work before going through different languages.

The webpages you view have been sent over by a server. Sometimes, its just a static page that was just sitting there on the server, but on modern sites, the page is often dynamically created for you. That means some code was being run on the server (the "back-end") to generate the page that it sent over to you. Websites can use any language on their back-end that is supported by their web host. The page that gets displayed is formatted in static HTML (a markup language), but it can contain Javascript that runs in the browser which allow it to do many more things.

Javascript
Since Javascript runs in all browsers, it can be a good choice of language to learn. No installation is required, since it can immediately be tried out in the browser. Javascript can be used for visual effects, but also for doing things without having to update the entire webpage. Modern web apps require Javascript for many of their features. (For example, try loading Gmail without javascript.) Javascript is also used in many web-related areas, such as creating browser extensions. It is often used for other areas that beginners might be interested in, such as creating AppScripts to work with Google Apps, or On(X) to automate things on Android. If you are interested in any of these purposes, javascript may be a good language to learn. However, Javascript has certain confusing parts, so if you're not planning on using it for one of the above purposes, you can try a more elegant language  such as Python.

PHP
PHP is a language built for creating dynamic web pages, and it runs on the server-side. Let's say you just finished building websites without coding and now you want to be able to customize things further. You want to learn how to program the brains of the website, i.e. the back-end. A large number of websites and scripts are built using PHP, and web hosts often come with a list of one-click-install scripts. If you want to create a plugin for Wordpress or work with the same script that runs Wikipedia, then PHP is for you. Practically all dynamic web hosts run PHP, and its very easy to get started with it. However, PHP has some issues, such as a messy syntax and certain inconsistencies and quirks. This means it might be better to learn a different language if just want to learn programming or you want to create an entirely new web app. However, PHP has improved over time, and if it fits your purposes, go ahead and learn it.

Python
If you just want an easy and elegant language to learn programming, Python is a good choice. Unlike PHP and Javascript, which are made for the web, Python is a general-purpose language that can be used outside of websites. Python tries to be a very readable language, so even a beginner should be able to figure out what a sample of Python code accomplish.  Python has the unusual feature of using indentation to mark different parts of code. This makes the code look less cluttered, but can sometimes cause issues when copying code. If you don't have a specific goal that fits with one of the other languages  Python is a good choice to go with.

Ruby
Ruby is similar to Python in many ways. It is a general-purpose language which is focused more on programmer productivity than running-time on a machine. This 'slowness' isn't really an issue for most cases a beginner will deal with. Ruby has become very popular recently due to the website-building framework written in it - Ruby on Rails. Rails developed certain principles (such as "convention over configuration") that let programmers built websites quickly. If you are interested in creating websites with Rails, then it obviously makes sense to learn some Ruby. While Rails can be used without that much Ruby knowledge, I think a beginner should first learn a simple language before taking on a complex framework.

Java
Java is different than the other languages listed here in a number of ways. All code created in Java needs to be "compiled" into another code before it runs, and all variables need to be "declared" with their name and type. Java also enforces a methodology known as "object-oriented programming", requiring all code to belong to an "object". While there are various benefits to these decisions, they can make it take slightly longer to play around with code and test things out. Java is a heavy-duty language that runs quickly on machines, and it is taught in schools and used in many big companies. People who program in Java use an IDE for programming, which can provide various features to help with programming, such as auto-completion suggestions while they code, and automatic highlighting of certain errors. Java is also the language that Android and Android apps are written in, so if you want to code such apps, you need to learn Java. Java's rules will help you detect certain errors before even running the code, so it does have certain benefits as a first language. However, Java is not the language to pick if if you are interested in quickly creating dynamic websites, or in writing quick scripts for various purposes.

Summary: 

Pick:__      if you want to:__
Javascript - Program front-end webpages, extensions, Appscripts, etc.
PHP - Work with existing PHP scripts
Python - Use a easy general-purpose language
Ruby - Create sites with Ruby on Rails
Java - Program Android apps, Strict rules prevent errors

 

Thursday, May 31, 2012

Computer Science Curriculum

Teach Programming Instead of Computer Science

A basic problem with the Computer Science curriculum is that it does not teach students what they're interested in or what they need to know professionally.  Most students would probably prefer practical programming experience but they get CS degrees since that is all that is being offered at their college. The schools don't want to be a "trade school" so they instead require students to learn difficult and often unnecessary material. Besides making it more difficult for the students who do succeed, it ends up scaring off many people from a career in software development all together. Its time for more options to be offered and for some disruption in the education system:

Higher Education's Online Revolution (WSJ)

Saturday, September 10, 2011

Teaching through Games

In this Quora answer, I suggested a few ways that games can be used to teach advanced subjects. For example:
 [To learn] programming, one can be required to create programs to complete missions. 

I recently came across a mention in the WSJ of a game that will do exactly that. From the website of CodeHero:
It is a co-op first-person science shooter where you use the code gun to shoot javascript. Your code gun can copy code like new items and fire it like ammunition to do new things.
You can edit new code to do anything you can imagine. You'll learn how to blast the enemy, manipulate the world, and build structures creatively to create the games of your dreams and recruit an army of coders to save the world from rogue AI. 

In the meantime, there's always programs like Greenfoot, Scratch and Microsoft SmallBasic to teach kids programming.