Guides/GettingStartedSerious

From J Wiki
Jump to navigation Jump to search

A Beginner Learns J

You face two challenges:

1. Stop thinking about programs number by number, using loops to visit each number; start thinking in terms of arrays and subarrays and what you want to do to them. 2. Learn the J language for describing the program in those terms.

The first problem, the self-training, is the hard one. You have to think about programming differently.

[You may find it interesting that teenagers who have no programming experience pick up J very quickly. The more practice a student has with conventional languages, the harder it is for them to shake off their ingrained thinking. You need to view programming with fresh eyes and a fresh brain.]

Start Here

Whatever path you follow for learning J, you need to have some basic vocabulary, and you will want to use debug and dissect.

Essential Terms

Learn the absolutely essential terms of J.

Other specialized terms are described in the Glossary. Consult it when you need to.

Debugging Tools

Debug is a windowed debugger that supports stops, single-stepping, and post-mortem debugging after crashes.

Dissect gives you an explorable view of the execution of a single line of code. Only a language like J could have a tool like dissect, because only in J can a single line of code calculate so much (as extreme examples, code to display the Mandelbrot set or calculate a move in Conway's Game of Life fit into one line). With a line of J replacing several or even dozens of lines of C, you will welcome a tool for exploring individual lines.

The quickest way to pick up debug and dissect is through the Lab Help|Studio|Labs|J By Point and Click I. The first chapter introduces the tools.

To dissect your own sentences, put your cursor on the sentence and press a function key that you have assigned to dissect (in the explorer profile, this is F2).

Profile

Your J configuration specifies the default GUI behavior, function keys, and what addons are loaded when J starts. To get a good default configuration, start J and type in

   load 'profiles/profiles/explorer'

You need do this only once. You will have to restart J to apply the configuration, but on subsequent starts J will have it automatically. This profile will:

The Way of J

To a scalar programmer, the most jarring thing about J is the relative absence of loops. You might want to start with a look at how you will replace them.

Suggested Study

How you study J will depend on your learning style.

Interactive Study Using Labs

Labs on the J language give you instruction in bite-sized pieces, with opportunities for you to experiment. Here is a selection:

  • Help|Studio|Labs|J by Point and Click I is the most visual of the labs, but it puts the burden on you to explore the documentation. Using the dissect and debug windows, and your browser, you can explore programs for solving real-world problems.

Other labs are not integrated into dissect and debug. You should explore on your own, using dissect and sentences of your own creation, to elucidate the J code.

Labs With Emphasis on Programming

  • Help|Studio|Labs|A Taste of J (1) eases you into the J language.
  • Help|Studio|Labs|A Taste of J (2) continues with a discussion of more advanced features. This pair of labs does not go beyond the single-sentence level, and does not cover the language in breadth or depth, but it does fulfill the expectations raised by the title.
  • Help|Studio|Labs|An Introductory Course in J covers the language in greater depth and breadth. It is designed for programmers with experience in languages like C. It's a dry read, but it will give you a thorough introduction to the language. It's long on examples, short on exercises.
  • Help|Studio|Labs|J As Your First Computer Language is an introduction to the nomenclature of J, the debugging tools, and the format of J programs. It is intended as the opening to a class on the language, for students who have no experience with computers.

Labs With Emphasis on Mathematics

  • Help|Studio|Labs|A J Introduction shows how J can be used to describe elementary mathematics.
  • Help|Studio|Labs|An Idiosyncratic Introduction to J uses J to treat a few mathematical topics.

Books

Books on J are more complete and perhaps more logically organized, but less interactive. The following are the most popular.

  • The Primer is a good place to start. Even if you have considerable programming experience, there is much that is unique to J, and it is worthwhile to at least skim this book before jumping into the deep end.
  • Learning J is an excellent introduction and overview of the core J language, see [[JDic:../learning/contents|Learning J]].
  • J for C Programmers is a guide for making the transition from scalar languages to J. Early chapters describe J in terms of C, but the reader is weaned off C as the book progresses, and many J programmers ignorant of C have found the book a useful companion. Available in a J installation (via Help|Help), File:JforC20071003.pdf, or as a Microsoft Word 2003 file. You can also buy a hardcopy from Lulu. The book makes reference to a File:Jforc.ijs.
  • Easy J is a gentle introduction for the complete beginner, see zipped pdf.

NuVoc

Midway between a lab and a book, NuVoc has explanatory articles in addition to the reference material. Start with the self-assessment. Explore the primitives, or sample the tutorial pages listed at the bottom. Make sure you are familiar with the Absolutely Essential Terms used in J documentation.

Useful Resources

The J reference card is a very handy 2-page summary of J primitives available File:J602 RefCard color letter current.pdf. It has been updated and compacted for J9.04: File:B.A4.pdf, File:B.USLETTER.pdf; read more here.

The J Showcase contains examples and articles on J.

You might want to focus your early effort on learning a minimal subset of J.

For APL'ers

Many newcomers to J know APL. The two languages are contrasted here.

The APL to J Phrase Book is a thesaurus listing the common APL symbols and corresponding J primitives and sample expressions.