What projects did you build to learn Caché ObjectScript from scratch?
For those who learned Caché ObjectScript from scratch: what kind of personal or practice projects did you build to get comfortable with the language? I come from a C# background and I'm looking for project ideas that are small enough to be feasible but meaningful enough to actually teach the core COS concepts.
Comments
A few concrete project ideas and learning approaches showed up in the retrieved materials:
-
Build a small persisted app with a couple of related classes, such as an event system with
EventandAttendeeobjects. One example creates simple%Persistentclasses with properties like title, description, date, and a list of attendees, then stores and retrieves them. That teaches class definitions, object creation, saving, IDs, relationships, and how persisted objects map into globals. [1] -
Create small persistent classes first, then experiment with simple SQL against them. One source specifically recommends that beginners “create small persistent classes” and “try simple Embedded SQL,” which makes a good practice-project pattern: model a small domain, store records, and query them back. [2]
-
Avoid jumping straight into raw globals for your first learning projects. Multiple sources suggest preferring
%Persistentclasses for application data because they give you schema, indexes, SQL integration, and a cleaner model, while globals are better understood after you know the consequences. So a meaningful beginner project would be something like a contact list, task tracker, or simple catalog implemented as persistent classes rather than direct^Globalstorage. [3][2] -
Include transactions in the project once you start doing multi-step updates. A useful learning exercise is any project with a logical “unit of work,” because it forces you to practice
TSTART/TCOMMIT/TROLLBACKand understand consistency. [3][2] -
Add proper error handling as part of the project design. Sources recommend wrapping risky operations in
TRY/CATCH, so even a small CRUD-style app becomes more educational if it includes validation, save failures, and readable error reporting. [3][2] -
Use the project to learn native ObjectScript features instead of creating a compatibility layer from another language. One source advises against building lots of synonym wrappers and custom macros for familiar functions from other languages, because that slows down becoming fluent in ObjectScript itself. [4][5]
-
Work through small experiments rather than one large system. One source explicitly says the best habits were “small experiments,” frequent searches, and using tools like the Management Portal and VS Code to inspect classes. Another person describes learning “as I am building,” by playing around with code while building real things. [2][6]
-
Puzzle or demo projects can also work. A collected learning-resources page explicitly lists a “SUDOKU demo” among ObjectScript learning material, which suggests that algorithmic toy projects are also a viable way to get comfortable with syntax and core language constructs. [7]
If you want project ideas that fit these recommendations well, the documents support these kinds of beginner-friendly shapes:
- Event/attendee manager with persisted classes and relationships. [1]
- Small record-based app using
%Persistentplus simple SQL queries. [2] - CRUD app with transactions and error handling built in from the start. [3][2]
- A small puzzle/demo app such as Sudoku to practice language syntax and logic flow. [7]
For someone coming from C#, the strongest pattern in these sources is: start with a small object model, store it with %Persistent, query it back with SQL, and deliberately practice transactions and TRY/CATCH as part of the project rather than treating them as advanced topics. [1][3][2]
Sources:
When I was teaching ObjectScript, the first exercise was a game "6 from 45'
- display 6 numbers from 1--45 in a row
- with every run count how often a number is shown
- after 10, 100, 1000 runs display the counters
- show the average count + the number with the highest and the lowest counter
- show your collection sorted by increasing / decreasing counter, deviations, ...
The expectation is a total equal distribution.
Check the influence by the number of loops. Are there any patterns visible ?