𝔖 Scriptorium
✦   LIBER   ✦

📁

Beginning Ring Programming: From Novice to Professional

✍ Scribed by Mansour Ayouni


Publisher
Apress
Year
2020
Tongue
English
Leaves
678
Edition
1
Category
Library

⬇  Acquire This Volume

No coin nor oath required. For personal study only.

✦ Synopsis


Gain a gentle introduction to the world of Ring programming with clarity as a first concern using a lot of practical examples. The first part lays the foundations of the language and its basic features (data types, control structures, functions, and classes). The unique way to rigorously structure Ring programs is also explained. 

Then, in the second part you’ll discover Ring inputs, outputs, and what is in between. You’ll use the basic constructs of computer logic (sequence, selection, and iteration) to build simple and complex logic flows. You’ll go over the common mistakes that lead to code complexity, by example, and cover several strategies to solve them (refactoring, code cleansing, and good variable naming). Then, you’ll see a visual illustration of how Ring deals with scopes at the local, object, and global levels.

In part three, you’ll play with two artifacts vital to Ring programming: functions and objects. You’ll learn how they can be composed to solve a problem and how advanced programming paradigms, such as declarative and natural, are beautifully implemented on top of them. As part of the discussion, you’ll also work on game programming. You’ll learn how you design your game declaratively, in Ring code, just as if you were designing it in visual software.

Finally, the author lays out how programming can be understood in a gamified context. You will be told the truth about how gaming can be a better metaphor to achieve mastery of Ring programming.

This book is for those who are passionate about writing beautiful, expressive, and learnable code. It has been designed so you can enjoy a beginner-friendly set of knowledge about Ring, and benefit from a one-stop collection of lessons learned from real-world, customer-facing programming projects.

What You Will Learn

  • Get started with Ring and master its data types, I/O, functions, and classes
  • Carry out structural, object-oriented, functional, declarative, natural, and meta programming in Ring
  • Use the full power of Ring to refactor program code and develop clean program architectures
  • Quickly design professional-grade video games on top of the Ring game engine

    Who This Book Is For

    Beginners looking for a consistent and hackable programming environment with a strong flavor of learnability and expressiveness.  

     

    ✦ Table of Contents


    Table of Contents
    About the Author
    About the Technical Reviewer
    Acknowledgments
    Introduction
    Foreword
    Chapter 1: Getting Started with Ring
    What You Will Learn
    Download and Installation
    Selecting the Appropriate Installer
    Discovering the Ring Installation Folder
    Launching Ring Notepad
    Your First Ring Program
    Organizing Yourself
    Asking Ring Questions
    From Date to Time
    A Ring Flower: timeList Function
    Making timeList Expressive
    Listening to Ring When It Complains
    Playing with Lists
    Expressiveness: First Round
    Expressiveness: Second Round
    The Final Listing of the “Hello Ring!” Program
    The “Very Final” Listing: One More Adjustment!
    Documentation and the Help System
    Any “Hello, World!” Tutorial?
    Say Hello in the Console
    Say Hello in a Web Page
    Say Hello in the Window
    Say Hello on Your Mobile Phone
    Say Hello in a Game
    Say Hello in Plain Arabic
    Introductory Article by Mahmoud Fayed
    Dynamic Transformation of Types
    Using Lists During Their Definition
    Exiting from More Than One Loop
    Using the Ring Help System
    Three Ways to Access Ring Documentation
    High-Level Overview of Ring Documentation
    Practical Use Cases of the Help System
    Frequently Asked Questions
    Other Resources on Ring
    Asking the Community
    Video Tutorials About Ring
    Critics and Reviews of Ring
    Summary
    Chapter 2: Data Types in Ring
    Nine Things You Will Learn
    How Ring Sees the World
    Types and Type System: A First Flavor
    Meet the Gang of Four
    Missing Members of the Gang
    A Little Bit of Magic
    Statics and Dynamics of the Ring Type System
    A Reference Architecture
    Checking Data Types
    Converting Between Data Types
    User-Defined Data Types
    Implicit Conversion and Lexical Scoping
    Under the Hood: C Language Type System
    More on Data Types
    More on Numbers
    More on Strings
    More on Objects
    More on Lists
    Capturing the Potential of Dynamic Ring
    Summary
    Chapter 3: Inputs to Ring
    Nine Things You Will Learn
    Inputs in the Code
    Using Variables to Host Data in Code
    Avoiding Magical Numbers
    Mitigating Code Complexity
    Refactoring the Data Side
    Refactoring the Code Side
    Separating Between Concerns
    Using Global Variables
    Inputs in the Console
    Using the Give Command
    Getting Arguments from the Command Line
    Inputs from the GUI
    Creating Windows in the Form Designer
    Understanding the Generated Files from the Form Designer
    Understanding Events
    Fabricating the User Interface
    Responding to User Events
    Enhancing the User Experience
    Three Values of MVC in GUI Design
    Code Reusability
    Code Testability
    Targeting of Multiple Platforms
    Inputs from Text Files
    Reading Data from a Text File
    Specifying the NorthAfrica App
    Seven Steps to the NorthAfrica App
    Creating Conventions and Configuration Files
    Transforming Text Data into a Ring List
    Preparing Data for Showing a Graph
    Rendering the Graph Inside a Text String
    Inputs from the Database
    Connecting to a SQLite Database
    Designing a Clean Data Acquisition Architecture
    Switching Between Text and Database Data Sources
    Implementing a Universal Data Connector
    Adapting the Connector to the Database
    Unifying the Data Format Delivered by the Connector
    Testing Our Data Acquisition Architecture
    Final Refinement
    Other Inputs
    Summary
    Chapter 4: Outputs of Ring
    Nine Things You Will Learn
    Before We Start
    Refactoring the Right Side
    Analyzing the Existing Architecture
    Designing a Target Architecture
    Using See Instead of ?
    Inviting BASIC into Ring
    Using the Standard print() Function
    Output to a File
    Output to a Database
    Output to a Web Page
    Studying the Feasibility of Printing cGraph in a Web Page
    Yet Another Architecture Refactoring
    Correctly Implementing the Web Target
    Writing HTML in Ring
    Output to a Printed File
    What’s Next
    Chapter 5: Crafting Ring Algorithms
    Nine Things You Will Learn
    Before We Start: Long Live Visuality!
    A Snapshot of Drakon: What and Why?
    Three Forms of Logic Flows
    Sequence
    Selection (or Branching)
    Iteration (or Looping)
    Difference Between for and for in
    Infinite Loops
    More on Logic Flows
    Vertical Selections
    Deep Selections
    Condition-First Iteration: while
    Condition-Last Iteration: do again
    Multiple Selections
    Other Ring Control Structure Techniques
    Using for in to Modify Lists
    Stepping with the for Statement
    Exiting from One or Two Loops
    Using the loop Keyword
    Short-Circuit Evaluation
    Exceptions (try/catch)
    Useful Details About Evaluation
    Three Commandments of the Logic Craftperson
    The First Commandment: Clean Order
    The Second Commandment: One Start, One End
    The Third Commandment: Clean Logical Parts
    Before You Leave: Homework!
    Summary
    Chapter 6: Juggling with Scopes
    Nine Things You Will Learn
    Scopes: Why Should You Care?
    Three Variable Scopes: Global, Local, and Object
    Global Scope
    Local Scope
    Global Is Visible Inside Local
    Localizing Variables
    The Special Case of Loops
    Object Scope
    Visibility of the Object Variable and the Object Attributes
    Visibility of an Object Attribute from the Local Scope of a Function
    Visibility of an Object from the Local Scope of a Function
    Visibility of an Object Created Inside a Function
    Local Scope of Object Methods
    Object Scope Switching Using Braces
    Case of self and this Keywords
    Object Scope Access Using Dot Operator
    Managing Conflictual Scopes
    Conflict Between the Global and Object Scopes
    Conflict Between the Object and Local Scopes
    Conflict Between the Global and Local Scopes
    Tracing Variables Using TraceLib
    A Gift: Extended wapp.ring Program
    Summary
    Chapter 7: Functions, Objects, and Beyond
    Nine Things You Will Learn
    Functions and Functional Style
    Defining and Calling Functions
    Sending Parameters and Returning Values
    Using a List for Optional Parameters
    Recursion: When a Function Calls Itself
    Beyond Functions, the Functional Programming Paradigm
    Three Pros
    Three Cons
    Areas of Application
    Pure Functions
    Immutable State
    First-Class Functions
    Higher-Order Functions
    Anonymous Functions
    Nested Functions
    Composing Functions
    Fabricating Functions
    Comparing Functions
    Objects and Object Orientation
    Creating Objects from Classes
    Initializing Objects
    Accessing Objects
    Using Setters and Getters
    Sending and Returning Objects
    A Recap: Object Structure and Class Event Mechanism
    Inheritance and Composition
    Composing Objects with Inheritance
    Composing Objects with Aggregation
    Composing Objects with Concatenation
    Composing Objects with Delegation
    Your Recipe for Object Composition
    Securing the Object World with Encapsulation
    Managing a Collection of Objects
    Changing the Object Operators
    Interacting with Objects Inside Braces
    Beyond Objects, Declarative Programming in Ring
    Beyond Objects, Natural Programming in Ring
    Building a Natural Layer for Your Program
    Parsing a Natural Statement Inside Your Code
    Enabling the User to Provide Natural Statements
    Capturing Numbers in Natural Statements
    Capturing Errors Inside Natural Code
    Summary
    Chapter 8: Designing Games in Ring
    Nine Things You Will Learn
    A Personal Perspective on Game Programming
    Three Fundamentals of Game Programming
    Game Loop
    Game Timing
    Game Engine
    The Game Class
    The GameObject Class
    The Sprite Class
    Text Class
    The Animate Class
    The Sound Class
    The Map Class
    Mastering the Big Picture
    Twelve Practical Skills in Your Bucket
    Skill 1: Opening a Window to Host the Game
    Skill 2: Setting the Ambiance
    Skill 3: Populating the Game with Objects
    Adding Text
    Adding a Sprite
    Adding a Drawing
    Adding a Sound
    Adding a Tile Map
    Skill 4: Animating Objects
    Skill 5: Intervening in the Game State
    Skill 6: Querying Game Objects
    Getting an Object by Its Index
    Filtering Objects by Type
    Getting an Object with Its Name
    Skill 7: Intercepting Events
    Skill 8: Detecting Collisions
    Skill 9: Implementing and Testing the Gameplay
    Skill 10: Organizing and Refactoring Code
    Skill 11: Distributing Your Game on Many Platforms
    Skill 12: Monitoring Your Game Performance
    A Complete Game in Ring
    Before You Make It, Play It!
    Loading Globals
    Write the Game Loop
    Write the Game World Function
    Write the Game Initialization Function
    Protect the World Frontiers
    Attack the Enemies
    Accept to Be Attacked!
    You’re Captured, Write a Collision Function
    Destroy the Enemies, Without Mercy!
    It Exploded, Show the Fire!
    Monitor Your Energy
    Grow the Stars, They Are Bonuses!
    The Stars, Captured!
    To Be Captured, They Must Be Harvested
    Your Score, Updated
    Play Again or Quit?
    Sure, I Want to Play Again!
    Game Over!
    Beyond Gaming, Video Games Culture
    Chapter 9: A Gamified Foundation for Mastering Ring
    Nine Things You Will Learn
    Programming: Toward a New Metaphor
    A Critic of the “Construction” Metaphor
    The Problem of Software Construction
    Design of a Solution Strategy
    Gaming as a New Metaphor for Programming
    Defining the Word Metaphor
    Defining Programming
    Gaming, as a Programming Metaphor
    Programming, Redefined!
    A Target Skillset of Our Gamified Learning Experience
    Ringoria, the Programming Land of Ring
    The Ringorialand Map
    The Floating Castle
    Watermania
    The Flower of Athingza
    The Bay of Sand
    The Ringuter
    The Cap of Lights
    The Training Camp
    The Underground Station
    The Royal Library
    In the Pocket of Every Ringler
    An Iron Compass
    A Ringometer
    A Sociogram
    A Set of Teamcards
    A Mission “Titiey”
    A Spectrogram
    Rules of the Game
    Believe in Ringaros
    Be Clean
    Be Strong
    Be Wise
    Be Beautiful
    The Holy Book of Ringoria
    Follow the Roadmap of King Ringamesh
    Ringza by Heart, Ringza by Hand!
    Ringza by Heart
    Ringza by Hand
    Ringza Is a Visual Language of Thinking
    Harvest the Stars, Design a Learning Path
    You Are the Ringler!
    Conclusion
    Appendix A: A Dialogue with Mahmoud Fayed
    Network Programming in Ring
    Composition over Inheritance
    Parallelization in Ring
    A Language Copying Ring
    Ring Data Type System
    About the Ring Compiler and VM
    When the Default Value of NULL Is Changed
    Speed of Ring List vs. C Code Array
    Level Designer in Ring Games
    Advice on the Use of Operator Overloading
    Numeric Overflow Error
    A Strange Behavior in len() of Lists
    Your Approach to Testing
    The Secret Behind Mahmoud’s Responsiveness
    The Story Behind the Name of Ring
    Ring vs. Python
    Ring in 10 Years
    Monetizing PWCT
    Ring Foundation
    Ring vs. PWCT
    Your Final Word to the Reader
    Index


    📜 SIMILAR VOLUMES


    Beginning Ring Programming: From Novice
    ✍ Mansour Ayouni 📂 Library 📅 2020 🏛 Apress 🌐 English

    <p><p>Gain a gentle introduction to the world of Ring programming with clarity as a first concern using a lot of practical examples. The first part lays the foundations of the language and its basic features (data types, control structures, functions, and classes). The unique way to rigorously struc

    Beginning Ring Programming: From Novice
    ✍ Mansour Ayouni 📂 Library 📅 2020 🏛 Apress 🌐 English

    Gain a gentle introduction to the world of Ring programming with clarity as a first concern using a lot of practical examples. The first part lays the foundations of the language and its basic features (data types, control structures, functions, and classes). The unique way to rigorously structure R

    Beginning Ada Programming: From Novice T
    ✍ Andrew T. Shvets 📂 Library 📅 2020 🏛 Apress 🌐 English

    Discover the Ada programming language by being gently guided through the various parts of the language and its latest available stable release. The goal in this book is to slowly ease you into the different topics. It is understood that you do not always have ample free time, so the text is easy to

    Beginning Perl Programming: From Novice
    ✍ William "Bo" Rothwell 📂 Library 📅 2019 🏛 Apress 🌐 English

    <p><p>Get started with Perl 5 and learn the important core concepts of Perl programming, such as variables, flow control, expressions, and I/O. Additionally, this book covers pattern matching and shows that Perl is extremely flexible and powerful, and that it isn’t afraid of the cloud. After reading

    Beginning Ballerina Programming: From No
    ✍ Anjana Fernando, Lakmal Warusawithana 📂 Library 📅 2020 🏛 Apress 🌐 English

    <p><span>Discover the Ballerina programming language for next-generation microservices and cloud-native application development. This book shows you that Ballerina is a cutting-edge programming language which incorporates many of the latest technological advancements in programming language theory.