Top 10 Dolphin Smalltalk Tips and TricksDolphin Smalltalk remains a powerful, approachable Smalltalk environment for Windows developers who value a live, reflective programming experience. Whether you’re a beginner exploring the language or an experienced Smalltalker looking to boost productivity, these ten tips and tricks will help you write cleaner code, navigate the image efficiently, and take fuller advantage of Dolphin’s tools and libraries.
1. Master the System Browser: categories, classes, and methods
The System Browser is your primary window into the image. Learn its panes and keyboard shortcuts so you can quickly move between categories, classes, and methods.
- Use the class hierarchy view to find superclass methods you might want to override.
- Double-click a method to open it in the workspace or a separate method editor.
- Familiarize yourself with filtering and quick-jump features to reduce time spent hunting for code.
2. Use the Workspace for iterative experimentation
The Workspace in Dolphin is ideal for exploratory development and quick tests.
- Evaluate expressions rapidly with selected code and Ctrl+E (or your configured key).
- Keep small test snippets in a dedicated workspace to re-run as you refine behavior.
- Use temporary variables in the workspace to avoid polluting classes with throwaway helpers.
3. Take advantage of the Debugger and Inspectors
Dolphin’s live debugging tools are a major productivity win.
- Set breakpoints or use “halt” to stop execution where you need to inspect state.
- Use the inspector to examine objects and their structure; it’s often faster than printing.
- Experiment by changing object fields or evaluating code in the debugger to test fixes without restarting your program.
4. Learn image management: snapshots, versions, and configurations
Understanding how Dolphin manages the image prevents lost work and eases collaboration.
- Regularly save snapshots of your image to capture working states before risky refactors.
- Use versioned packages or configuration projects if you share code—the image itself isn’t a substitute for source control.
- Keep your image lean by removing unused projects or obsolete objects; a tidy image loads faster and is easier to navigate.
5. Write expressive tests in SUnit
SUnit provides a light, readable testing framework native to Smalltalk.
- Start by writing small unit tests for new methods; SUnit integrates well with the environment.
- Run tests frequently from the Test Runner and use failures to guide refactoring.
- Group related tests into test suites to run them together as you change related functionality.
6. Embrace idiomatic Smalltalk: message-rich style and meaningful names
Smalltalk’s expressiveness comes from messages and readable method names.
- Prefer small, focused methods with clear names rather than long monolithic routines.
- Use keyword messages to make intent obvious; when reading code later, descriptive method names save time.
- Break complex behavior into cooperating objects—Smalltalk shines when responsibilities are well-distributed.
7. Optimize UI development with Dolphin’s GUI tools
Dolphin includes libraries and builders that speed GUI creation.
- Use the Form Designer to compose windows and dialogs visually, then wire actions to methods.
- Leverage built-in widgets and layout managers to maintain consistent behavior across platforms.
- Keep UI logic separate from presentation to make behavior easier to test and reuse.
8. Profile and optimize hotspots carefully
Before optimizing, identify where the real bottlenecks are.
- Use timing utilities or simple microbenchmarks to measure performance-critical methods.
- Consider algorithmic improvements first (better data structures, fewer allocations) before low-level micro-optimizations.
- Remember Smalltalk’s strengths: readability and maintainability often outweigh microseconds of speed unless you’re in a tight loop.
9. Use packages and Monticello-style workflows (when available)
If your Dolphin distribution supports package or Monticello-style source management, use it.
- Keep source in packages that can be exported/imported, enabling easier sharing and history tracking.
- Commit logical changes frequently with clear messages; this aids collaboration and rollback.
- If Monticello isn’t available, adopt a discipline of keeping change logs and external backups.
10. Participate in the Smalltalk community and reuse libraries
Smalltalk’s ecosystem and community remain valuable resources.
- Search existing packages and libraries before reimplementing functionality—many gems exist for common tasks.
- Ask questions on Smalltalk forums, mailing lists, or community chats; experienced Smalltalkers often provide concise, practical advice.
- Share your improvements back as packages or examples—Smalltalk thrives on shared code and patterns.
Conclusion
Dolphin Smalltalk offers a concentrated, productive Smalltalk experience on Windows. Mastering the System Browser, Debugger, Workspaces, and image management will make daily development smoother. Favor idiomatic Smalltalk design, write tests, keep UI and logic separated, and profile before optimizing. Finally, use package workflows and community resources to keep your codebase healthy and your skills growing.
If you want, I can expand any of these tips with code examples, specific keyboard shortcuts for your Dolphin version, or a step-by-step walkthrough for packaging and distribution.
Leave a Reply