Pro C# 10 with .NET 6: Foundational Principles and Practices in Programming 11th Edition Andrew Troelsen download
Pro C# 10 with .NET 6: Foundational Principles and Practices in Programming 11th Edition Andrew Troelsen download
https://ebookmeta.com/product/pro-c-10-with-net-6-foundational-
principles-and-practices-in-programming-11th-edition-andrew-
troelsen/
https://ebookmeta.com/product/pro-c-10-with-net-6-foundational-
principles-and-practices-in-programming-11th-edition-andrew-
troelsen-2/
https://ebookmeta.com/product/pro-c-9-with-net-5-foundational-
principles-and-practices-in-programming-10th-edition-andrew-
troelsen/
https://ebookmeta.com/product/pro-c-7-with-net-and-net-core-
eighth-edition-andrew-troelsen/
https://ebookmeta.com/product/old-age-and-political-behavior-
frank-a-pinner/
Meta Television: A History of US Popular Television's
Self-Awareness 1st Edition Erin Giannini
https://ebookmeta.com/product/meta-television-a-history-of-us-
popular-televisions-self-awareness-1st-edition-erin-giannini/
https://ebookmeta.com/product/strategic-corporate-communication-
in-the-digital-age-1st-edition-mark-anthony-camilleri/
https://ebookmeta.com/product/bolt-action-world-war-ii-wargames-
rules-2nd-edition-warlord-games-peter-dennis-illustrations/
https://ebookmeta.com/product/essential-econometric-techniques-a-
guide-to-concepts-and-applications-3rd-edition-elia-kacapyr/
Win the day seven daily habits to help you stress less
and accomplish more First Edition. Edition Mark
Batterson
https://ebookmeta.com/product/win-the-day-seven-daily-habits-to-
help-you-stress-less-and-accomplish-more-first-edition-edition-
mark-batterson/
Semiconductor Basics A Qualitative Non mathematical
Explanation of How Semiconductors Work and How They are
Used 1st Edition George Domingo
https://ebookmeta.com/product/semiconductor-basics-a-qualitative-
non-mathematical-explanation-of-how-semiconductors-work-and-how-
they-are-used-1st-edition-george-domingo/
Pro C# 10 with .NET 6
Foundational Principles and Practices
in Programming
Eleventh Edition
Andrew Troelsen
Phil Japikse
Pro C# 10 with .NET 6: Foundational Principles and Practices in Programming
■
■Part I: Introducing C# and .NET 6������������������������������������������������������� 1
■
■Chapter 1: Introducing C# and .NET 6�������������������������������������������������������������������� 3
Exploring Some Key Benefits of the .NET Platform���������������������������������������������������������� 4
Understanding the .NET Support Lifecycle����������������������������������������������������������������������� 4
Previewing the Building Blocks of the .NET Platform������������������������������������������������������� 5
The Role of the Base Class Libraries������������������������������������������������������������������������������������������������������ 5
What C# Brings to the Table������������������������������������������������������������������������������������������������������������������� 6
Managed vs. Unmanaged Code�������������������������������������������������������������������������������������������������������������� 7
v
■ Table of Contents
vi
■ Table of Contents
vii
■ Table of Contents
Summary���������������������������������������������������������������������������������������������������������������������� 117
viii
■ Table of Contents
■
■Chapter 4: Core C# Programming Constructs, Part 2���������������������������������������� 119
Understanding C# Arrays���������������������������������������������������������������������������������������������� 119
Looking at the C# Array Initialization Syntax�������������������������������������������������������������������������������������� 120
Understanding Implicitly Typed Local Arrays�������������������������������������������������������������������������������������� 121
Defining an Array of Objects��������������������������������������������������������������������������������������������������������������� 122
Working with Multidimensional Arrays����������������������������������������������������������������������������������������������� 122
Using Arrays As Arguments or Return Values������������������������������������������������������������������������������������� 124
Using the System.Array Base Class���������������������������������������������������������������������������������������������������� 125
Using Indices and Ranges (New 8.0, Updated 10.0)��������������������������������������������������������������������������� 126
ix
■ Table of Contents
Summary���������������������������������������������������������������������������������������������������������������������� 179
■
■Part III: Object Oriented Programming with C#������������������������������ 181
■
■Chapter 5: Understanding Encapsulation���������������������������������������������������������� 183
Introducing the C# Class Type�������������������������������������������������������������������������������������� 183
Allocating Objects with the new Keyword������������������������������������������������������������������������������������������ 185
x
■ Table of Contents
xi
■ Table of Contents
Summary���������������������������������������������������������������������������������������������������������������������� 243
■
■Chapter 6: Understanding Inheritance and Polymorphism�������������������������������� 245
Understanding the Basic Mechanics of Inheritance����������������������������������������������������� 245
Specifying the Parent Class of an Existing Class�������������������������������������������������������������������������������� 246
Regarding Multiple Base Classes������������������������������������������������������������������������������������������������������� 248
Using the sealed Keyword������������������������������������������������������������������������������������������������������������������ 248
xii
■ Table of Contents
Summary���������������������������������������������������������������������������������������������������������������������� 288
■
■Chapter 7: Understanding Structured Exception Handling�������������������������������� 289
Ode to Errors, Bugs, and Exceptions���������������������������������������������������������������������������� 289
The Role of .NET Exception Handling��������������������������������������������������������������������������� 290
The Building Blocks of .NET Exception Handling�������������������������������������������������������������������������������� 291
The System.Exception Base Class������������������������������������������������������������������������������������������������������ 291
xiii
■ Table of Contents
xiv
■ Table of Contents
Summary���������������������������������������������������������������������������������������������������������������������� 355
■
■Chapter 9: Understanding Object Lifetime��������������������������������������������������������� 357
Classes, Objects, and References�������������������������������������������������������������������������������� 357
The Basics of Object Lifetime��������������������������������������������������������������������������������������� 359
The CIL of new������������������������������������������������������������������������������������������������������������������������������������ 359
Setting Object References to null������������������������������������������������������������������������������������������������������� 361
xv
■ Table of Contents
Summary���������������������������������������������������������������������������������������������������������������������� 384
■
■Part IV: Advanced C# Programming����������������������������������������������� 385
■
■Chapter 10: Collections and Generics���������������������������������������������������������������� 387
The Motivation for Collection Classes�������������������������������������������������������������������������� 387
The System.Collections Namespace�������������������������������������������������������������������������������������������������� 389
A Survey of System.Collections.Specialized Namespace������������������������������������������������������������������� 390
xvi
■ Table of Contents
Summary���������������������������������������������������������������������������������������������������������������������� 426
■
■Chapter 11: Advanced C# Language Features��������������������������������������������������� 427
Understanding Indexer Methods���������������������������������������������������������������������������������� 427
Indexing Data Using String Values������������������������������������������������������������������������������������������������������ 429
Overloading Indexer Methods������������������������������������������������������������������������������������������������������������� 430
Indexers with Multiple Dimensions���������������������������������������������������������������������������������������������������� 431
Indexer Definitions on Interface Types������������������������������������������������������������������������������������������������ 432
Understanding Operator Overloading��������������������������������������������������������������������������� 432
Overloading Binary Operators������������������������������������������������������������������������������������������������������������� 433
What of the += and –= Operators?���������������������������������������������������������������������������������������������������� 435
Overloading Unary Operators������������������������������������������������������������������������������������������������������������� 436
Overloading Equality Operators���������������������������������������������������������������������������������������������������������� 437
Overloading Comparison Operators���������������������������������������������������������������������������������������������������� 437
Final Thoughts Regarding Operator Overloading�������������������������������������������������������������������������������� 438
xvii
■ Table of Contents
Summary���������������������������������������������������������������������������������������������������������������������� 465
■
■Chapter 12: Delegates, Events, and Lambda Expressions��������������������������������� 467
Understanding the Delegate Type��������������������������������������������������������������������������������� 468
Defining a Delegate Type in C#����������������������������������������������������������������������������������������������������������� 468
The System.MulticastDelegate and System.Delegate Base Classes�������������������������������������������������� 470
xviii
■ Table of Contents
Summary���������������������������������������������������������������������������������������������������������������������� 506
xix
■ Table of Contents
■
■Chapter 13: LINQ to Objects������������������������������������������������������������������������������� 509
LINQ-Specific Programming Constructs����������������������������������������������������������������������� 509
Implicit Typing of Local Variables������������������������������������������������������������������������������������������������������� 510
Object and Collection Initialization Syntax����������������������������������������������������������������������������������������� 511
Lambda Expressions��������������������������������������������������������������������������������������������������������������������������� 511
Extension Methods����������������������������������������������������������������������������������������������������������������������������� 512
Anonymous Types������������������������������������������������������������������������������������������������������������������������������� 513
Understanding the Role of LINQ����������������������������������������������������������������������������������� 513
LINQ Expressions Are Strongly Typed������������������������������������������������������������������������������������������������� 514
The Core LINQ Assemblies������������������������������������������������������������������������������������������������������������������ 514
xx
■ Table of Contents
Summary���������������������������������������������������������������������������������������������������������������������� 549
■
■Chapter 14: Processes, AppDomains, and Load Contexts��������������������������������� 551
The Role of a Windows Process����������������������������������������������������������������������������������� 551
The Role of Threads���������������������������������������������������������������������������������������������������������������������������� 552
xxi
■ Table of Contents
Summary���������������������������������������������������������������������������������������������������������������������� 622
■
■Part V: Programming with .NET Core Assemblies�������������������������� 623
■
■Chapter 16: Building and Configuring Class Libraries��������������������������������������� 625
Defining Custom Namespaces (Updated 10.0)������������������������������������������������������������� 625
Resolving Name Clashes with Fully Qualified Names������������������������������������������������������������������������ 627
Resolving Name Clashes with Aliases������������������������������������������������������������������������������������������������ 628
Creating Nested Namespaces������������������������������������������������������������������������������������������������������������ 629
Change the Root Namespace Using Visual Studio 2022��������������������������������������������������������������������� 630
Change the Root Namespace Using the Project File�������������������������������������������������������������������������� 630
xxiii
■ Table of Contents
xxiv
■ Table of Contents
■
■Chapter 17: Type Reflection, Late Binding, Attribute, and Dynamic Types�������� 661
The Necessity of Type Metadata����������������������������������������������������������������������������������� 661
Viewing (Partial) Metadata for the EngineStateEnum Enumeration��������������������������������������������������� 662
Viewing (Partial) Metadata for the Car Type��������������������������������������������������������������������������������������� 663
Examining a TypeRef�������������������������������������������������������������������������������������������������������������������������� 665
Documenting the Defining Assembly�������������������������������������������������������������������������������������������������� 665
Documenting Referenced Assemblies������������������������������������������������������������������������������������������������ 665
Documenting String Literals��������������������������������������������������������������������������������������������������������������� 666
Understanding Reflection��������������������������������������������������������������������������������������������� 667
The System.Type Class����������������������������������������������������������������������������������������������������������������������� 667
Obtaining a Type Reference Using System.Object.GetType()�������������������������������������������������������������� 668
Obtaining a Type Reference Using typeof()����������������������������������������������������������������������������������������� 669
Obtaining a Type Reference Using System.Type.GetType()����������������������������������������������������������������� 669
xxv
■ Table of Contents
Summary���������������������������������������������������������������������������������������������������������������������� 712
xxvi
■ Table of Contents
■
■Chapter 18: Understanding CIL and the Role of Dynamic Assemblies��������������� 713
Motivations for Learning the Grammar of CIL�������������������������������������������������������������� 713
Examining CIL Directives, Attributes, and Opcodes������������������������������������������������������ 715
The Role of CIL Directives������������������������������������������������������������������������������������������������������������������� 715
The Role of CIL Attributes������������������������������������������������������������������������������������������������������������������� 715
The Role of CIL Opcodes��������������������������������������������������������������������������������������������������������������������� 716
The CIL Opcode/CIL Mnemonic Distinction����������������������������������������������������������������������������������������� 716
Pushing and Popping: The Stack-Based Nature of CIL������������������������������������������������� 717
Understanding Round-Trip Engineering����������������������������������������������������������������������� 718
The Role of CIL Code Labels��������������������������������������������������������������������������������������������������������������� 721
Interacting with CIL: Modifying an *.il File������������������������������������������������������������������������������������������ 721
Compiling CIL Code with ILASM.EXE�������������������������������������������������������������������������������������������������� 722
Compiling CIL Code with Microsoft.NET.Sdk.il Projects���������������������������������������������������������������������� 722
.NET Base Class Library, C#, and CIL Data Type Mappings������������������������������������������� 730
Defining Type Members in CIL�������������������������������������������������������������������������������������� 731
Defining Field Data in CIL������������������������������������������������������������������������������������������������������������������� 731
Defining Type Constructors in CIL������������������������������������������������������������������������������������������������������� 732
Defining Properties in CIL������������������������������������������������������������������������������������������������������������������� 732
Defining Member Parameters������������������������������������������������������������������������������������������������������������� 733
xxvii
■ Table of Contents
Summary���������������������������������������������������������������������������������������������������������������������� 748
■
■Part VI: File Handling, Object Serialization, and Data Access�������� 749
■
■Chapter 19: File I/O and Object Serialization���������������������������������������������������� 751
Exploring the System.IO Namespace��������������������������������������������������������������������������� 751
The Directory(Info) and File(Info) Types������������������������������������������������������������������������ 752
The Abstract FileSystemInfo Base Class�������������������������������������������������������������������������������������������� 753
xxviii
■ Table of Contents
Summary���������������������������������������������������������������������������������������������������������������������� 796
■
■Chapter 20: Data Access with ADO.NET������������������������������������������������������������� 797
ADO.NET vs. ADO���������������������������������������������������������������������������������������������������������� 797
Understanding ADO.NET Data Providers����������������������������������������������������������������������� 798
ADO.NET Data Providers��������������������������������������������������������������������������������������������������������������������� 799
xxix
■ Table of Contents
xxx
■ Table of Contents
Summary���������������������������������������������������������������������������������������������������������������������� 858
■
■Part VII: Entity Framework Core����������������������������������������������������� 859
■
■Chapter 21: Introducing Entity Framework Core����������������������������������������������� 861
Object-Relational Mappers������������������������������������������������������������������������������������������� 862
Understanding the Role of the Entity Framework Core������������������������������������������������ 862
The Building Blocks of the Entity Framework�������������������������������������������������������������� 863
The DbContext Class��������������������������������������������������������������������������������������������������������������������������� 864
The DbSet<T> Class��������������������������������������������������������������������������������������������������������������������������� 869
The ChangeTracker����������������������������������������������������������������������������������������������������������������������������� 870
Entities������������������������������������������������������������������������������������������������������������������������������������������������ 872
Owned Entity Types���������������������������������������������������������������������������������������������������������������������������� 903
Query Types���������������������������������������������������������������������������������������������������������������������������������������� 906
xxxi
■ Table of Contents
Summary���������������������������������������������������������������������������������������������������������������������� 920
■
■Chapter 22: Exploring Entity Framework Core�������������������������������������������������� 921
Creating Records���������������������������������������������������������������������������������������������������������� 921
Entity State����������������������������������������������������������������������������������������������������������������������������������������� 922
Add a Single Record Using Add���������������������������������������������������������������������������������������������������������� 922
Add a Single Record Using Attach������������������������������������������������������������������������������������������������������ 923
Add Multiple Records at Once������������������������������������������������������������������������������������������������������������ 924
Identity Column Considerations When Adding Records���������������������������������������������������������������������� 925
Adding an Object Graph���������������������������������������������������������������������������������������������������������������������� 927
Add Many-to-Many Records��������������������������������������������������������������������������������������������������������������� 928
Add Sample Records�������������������������������������������������������������������������������������������������������������������������� 929
xxxii
■ Table of Contents
Summary���������������������������������������������������������������������������������������������������������������������� 989
■
■Chapter 23: Build a Data Access Layer with Entity Framework Core���������������� 991
Create the AutoLot.Dal and AutoLot.Models Projects��������������������������������������������������� 991
Add the Database View������������������������������������������������������������������������������������������������ 992
Scaffold the DbContext and Entities����������������������������������������������������������������������������� 993
Examine the Results��������������������������������������������������������������������������������������������������������������������������� 993
xxxiii
■ Table of Contents
xxxiv
■ Table of Contents
Summary�������������������������������������������������������������������������������������������������������������������� 1050
■
■Chapter 24: Test-Driving AutoLot�������������������������������������������������������������������� 1051
Setting Up the Test-Drives������������������������������������������������������������������������������������������ 1051
Create the Project����������������������������������������������������������������������������������������������������������������������������� 1051
Make the AutoLot.Dal Internals Visible to AutoLot.Dal.Tests������������������������������������������������������������� 1053
Add the GlobalUsings File����������������������������������������������������������������������������������������������������������������� 1053
A First Look at xUnit������������������������������������������������������������������������������������������������������������������������� 1053
Configure the Project and DbContext Instances������������������������������������������������������������������������������� 1055
Add the BaseTest Class�������������������������������������������������������������������������������������������������������������������� 1056
Add the EnsureAutoLotDatabase Test Fixture Class������������������������������������������������������������������������� 1058
Add the Integration Test Classes������������������������������������������������������������������������������������������������������ 1059
xxxv
■ Table of Contents
Summary�������������������������������������������������������������������������������������������������������������������� 1096
■
■Part VIII: Windows Client Development���������������������������������������� 1097
■
■Chapter 25: Introducing Windows Presentation Foundation and XAML���������� 1099
The Motivation Behind WPF���������������������������������������������������������������������������������������� 1099
Unifying Diverse APIs������������������������������������������������������������������������������������������������������������������������ 1100
Providing a Separation of Concerns via XAML���������������������������������������������������������������������������������� 1100
Providing an Optimized Rendering Model���������������������������������������������������������������������������������������� 1101
Simplifying Complex UI Programming���������������������������������������������������������������������������������������������� 1101
xxxvi
■ Table of Contents
Summary�������������������������������������������������������������������������������������������������������������������� 1136
■
■Chapter 26: WPF Controls, Layouts, Events, and Data Binding������������������������ 1137
A Survey of the Core WPF Controls���������������������������������������������������������������������������� 1137
The WPF Ink Controls������������������������������������������������������������������������������������������������������������������������ 1138
The WPF Document Controls������������������������������������������������������������������������������������������������������������ 1138
WPF Common Dialog Boxes�������������������������������������������������������������������������������������������������������������� 1138
xxxvii
■ Table of Contents
xxxviii
■ Table of Contents
Summary�������������������������������������������������������������������������������������������������������������������� 1195
■
■Chapter 27: WPF Graphics Rendering Services����������������������������������������������� 1197
Understanding WPF’s Graphical Rendering Services������������������������������������������������� 1197
WPF Graphical Rendering Options���������������������������������������������������������������������������������������������������� 1198
xxxix
■ Table of Contents
Summary�������������������������������������������������������������������������������������������������������������������� 1231
■
■Chapter 28: WPF Resources, Animations, Styles, and Templates�������������������� 1233
Understanding the WPF Resource System����������������������������������������������������������������� 1233
Working with Binary Resources������������������������������������������������������������������������������������������������������� 1234
xl
■ Table of Contents
Summary�������������������������������������������������������������������������������������������������������������������� 1271
xli
■ Table of Contents
■
■Chapter 29: WPF Notifications, Validations, Commands, and MVVM��������������� 1273
Introducing Model-View-ViewModel�������������������������������������������������������������������������� 1273
The Model����������������������������������������������������������������������������������������������������������������������������������������� 1273
The View������������������������������������������������������������������������������������������������������������������������������������������� 1274
The View Model�������������������������������������������������������������������������������������������������������������������������������� 1274
Anemic Models or Anemic View Models������������������������������������������������������������������������������������������� 1274
xlii
■ Table of Contents
xliii
■ Table of Contents
Summary�������������������������������������������������������������������������������������������������������������������� 1353
■
■Chapter 31: Diving Into ASP.NET Core�������������������������������������������������������������� 1355
What’s New in ASP.NET Core�������������������������������������������������������������������������������������� 1355
Razor Pages��������������������������������������������������������������������������������������������������������������� 1355
The Razor Page File�������������������������������������������������������������������������������������������������������������������������� 1356
The PageModel Class����������������������������������������������������������������������������������������������������������������������� 1356
Page Handler Methods��������������������������������������������������������������������������������������������������������������������� 1357
xliv
■ Table of Contents
No one who has seen a cloud of locusts can question the realism
even of this picture: the heavy gloom of the immeasurable mass of
them, shot by gleams of light where a few of the sun’s imprisoned
beams have broken through or across the storm of lustrous wings.
This is like dawn beaten down upon the hilltops, and crushed by
rolling masses of cloud, in conspiracy to prolong the night. No: the
only point at which Joel leaves absolute fact for the wilder
combinations of Apocalypse is at the very close of his description,
chap. ii. 10 and 11, and just before his call to repentance. Here we
find, mixed with the locusts, earthquake and thunderstorm; and Joel
has borrowed these from the classic pictures of the Day of the Lord,
using some of the very phrases of the latter:—
Joel, then, describes, and does not unduly enhance, the terrors
of an actual plague. At first his whole strength is so bent to make his
people feel these, that, though about to call to repentance, he does
not detail the national sins which require it. In his opening verses he
summons the drunkards,[1183] but that is merely to lend vividness to
his picture of facts, because men of such habits will be the first to
feel a plague of this kind. Nor does Joel yet ask his hearers what the
calamity portends. At first he only demands that they shall feel it, in
its uniqueness and its own sheer force.
Hence the peculiar style of the passage. Letter for letter, this is
one of the heaviest passages in prophecy. The proportion in Hebrew
of liquids to the other letters is not large; but here it is smaller than
ever. The explosives and dentals are very numerous. There are
several keywords, with hard consonants and long vowels, used again
and again: Shuddadh, ‘ābhlah, ‘umlal, hôbhîsh. The longer lines into
which Hebrew parallelism tends to run are replaced by a rapid series
of short, heavy phrases, falling like blows. Critics have called it
rhetoric. But it is rhetoric of a very high order and perfectly suited to
the prophet’s purpose. Look at chap. i. 10: Shuddadh sadheh,
‘ābhlah ‘adhamah, shuddadh daghan, hôbhîsh tîrôsh, ‘umlal yiṣḥar.
[1184]Joel loads his clauses with the most leaden letters he can find,
and drops them in quick succession, repeating the same heavy word
again and again, as if he would stun the careless people into some
sense of the bare, brutal weight of the calamity which has befallen
them.
Now Joel does this because he believes that, if his people feel the
plague in its proper violence, they must be convinced that it comes
from Jehovah. The keynote of this part of the prophecy is found in
chap. i. 15: “Keshôdh mishshaddhai,” like violence from the All-
violent doth it come. “If you feel this as it is, you will feel Jehovah
Himself in it. By these very blows, He and His Day are near. We had
been forgetting how near.” Joel mentions no crime, nor enforces any
virtue: how could he have done so in so strong a sense that “the
Judge was at the door”? To make men feel that they had forgotten
they were in reach of that Almighty Hand, which could strike so
suddenly and so hard—Joel had time only to make men feel that,
and to call them to repentance. In this we probably see some
reflection of the age: an age when men’s thoughts were thrusting
the Deity further and further from their life; when they put His Law
and Temple between Him and themselves; and when their religion,
devoid of the sense of His Presence, had become a set of formal
observances, the rending of garments and not of hearts. But He,
whom His own ordinances had hidden from His people, has burst
forth through nature and in sheer force of calamity. He has revealed
Himself, El-Shaddhai, God All-violent, as He was known to their
fathers, who had no elaborate law or ritual to put between their
fearful hearts and His terrible strength, but cowered before Him,
helpless on the stripped soil, and naked beneath His thunder. By just
these means did Elijah and Amos bring God home to the hearts of
ancient Israel. In Joel we see the revival of the old nature-religion,
and the revenge that it was bound to take upon the elaborate
systems which had displaced it, but which by their formalism and
their artificial completeness had made men forget that near
presence and direct action of the Almighty which it is nature’s own
office to enforce upon the heart.
The thing is true, and permanently valid. Only the great natural
processes can break up the systems of dogma and ritual in which we
make ourselves comfortable and formal, and drive us out into God’s
open air of reality. In the crash of nature’s forces even our particular
sins are forgotten, and we feel, as in the immediate presence of
God, our whole, deep need of repentance. So far from blaming the
absence of special ethics in Joel’s sermon, we accept it as natural
and proper to the occasion.
Such, then, appears to be the explanation of the first part of the
prophecy, and its development towards the call to repentance, which
follows it. If we are correct, the assertion[1185] is false that no plan
was meant by the prophet. For not only is there a plan, but the plan
is most suitable to the requirements of Israel, after their adoption of
the whole Law in 445, and forms one of the most necessary and
interesting developments of all religion: the revival, in an artificial
period, of those primitive forces of religion which nature alone
supplies, and which are needed to correct formalism and the
forgetfulness of the near presence of the Almighty. We see in this,
too, the reason of Joel’s archaic style, both of conception and
expression: that likeness of his to early prophets which has led so
many to place him between Elijah and Amos.[1186] They are wrong.
Joel’s simplicity is that not of early prophecy, but of the austere
forces of this revived and applied to the artificiality of a later age.
One other proof of Joel’s conviction of the religious meaning of
the plague might also have been pled by the earlier prophets, but
certainly not in the terms in which Joel expresses it. Amos and
Hosea had both described the destruction of the country’s fertility in
their day as God’s displeasure on His people and (as Hosea puts it)
His divorce of His Bride from Himself.[1187] But by them the physical
calamities were not threatened alone: banishment from the land and
from enjoyment of its fruits was to follow upon drought, locusts and
famine. In threatening no captivity Joel differs entirely from the early
prophets. It is a mark of his late date. And he also describes the
divorce between Jehovah and Israel, through the interruption of the
ritual by the plague, in terms and with an accent which could hardly
have been employed in Israel before the Exile. After the rebuilding of
the Temple and restoration of the daily sacrifices morning and
evening, the regular performance of the latter was regarded by the
Jews with a most superstitious sense of its indispensableness to the
national life. Before the Exile, Jeremiah, for instance, attaches no
importance to it, in circumstances in which it would have been not
unnatural for him, priest as he was, to do so.[1188] But after the
Exile, the greater scrupulousness of the religious life, and its
absorption in ritual, laid extraordinary emphasis upon the daily
offering, which increased to a most painful degree of anxiety as the
centuries went on.[1189] The New Testament speaks of the Twelve
Tribes constantly serving God day and night;[1190] and Josephus,
while declaring that in no siege of Jerusalem before the last did the
interruption ever take place in spite of the stress of famine and war
combined, records the awful impression made alike on Jew and
heathen by the giving up of the daily sacrifice on the 17th of July,
A.D.70, during the investment of the city by Titus.[1191] This disaster,
which Judaism so painfully feared at every crisis in its history,
actually happened, Joel tells us, during the famine caused by the
locusts. Cut off are the meal and the drink offerings from the house
of Jehovah.[1192] Is not food cut off from our eyes, joy and gladness
from the house of our God?[1193] Perhaps He will turn and relent,
and leave a blessing behind Him, meal and drink offering for
Jehovah our God.[1194] The break “of the continual symbol of
gracious intercourse between Jehovah and His people, and the main
office of religion,” means divorce between Jehovah and Israel. Wail
like a bride girt in sackcloth for the husband of her youth! Wail, O
ministers of the altar, O ministers of God![1195] This then was
another reason for reading in the plague of locusts more than a
physical meaning. This was another proof, only too intelligible to
scrupulous Jews, that the great and terrible Day of the Lord was at
hand.
Thus Joel reaches the climax of his argument. Jehovah is near,
His Day is about to break. From this it is impossible to escape on the
narrow path of disaster by which the prophet has led up to it. But
beneath that path the prophet passes the ground of a broad truth,
and on that truth, while judgment remains still as real, there is room
for the people to turn from it. If experience has shown that God is in
the present, near and inevitable, faith remembers that He is there
not willingly for judgment, but with all His ancient feeling for Israel
and His zeal to save her. If the people choose to turn, Jehovah, as
their God and as one who works for their sake, will save them. Of
this God assures them by His own word. For the first time in the
prophecy He speaks for Himself. Hitherto the prophet has been
describing the plague and summoning to penitence. But now oracle
of Jehovah of Hosts.[1196] The great covenant name, Jehovah your
God, is solemnly repeated as if symbolic of the historic origin and
age-long endurance of Jehovah’s relation to Israel; and the very
words of blessing are repeated which were given when Israel was
called at Sinai and the covenant ratified:—
Then did Jehovah become jealous for His land, and took pity upon
His people—with these words Joel opens the second half of his book.
Our Authorised Version renders them in the future tense, as the
continuation of the prophet’s discourse, which had threatened the
Day of the Lord, urged the people to penitence, and now promises
that their penitence shall be followed by the Lord’s mercy. But such a
rendering forces the grammar;[1221] and the Revised English Version
is right in taking the verbs, as the vast majority of critics do, in the
past. Joel’s call to repentance has closed, and has been successful.
The fast has been hallowed, the prayers are heard. Probably an
interval has elapsed between vv. 17 and 18, but in any case, the
people having repented, nothing more is said of their need of doing
so, and instead we have from God Himself a series of promises, vv.
19–27, in answer to their cry for mercy. These promises relate to the
physical calamity which has been suffered. God will destroy the
locusts, still impending on the land, and restore the years which His
great army has eaten. There follows in vv. 28–32 (Eng.; Heb. chap,
iii.) the promise of a great outpouring of the Spirit on all Israel, amid
terrible manifestations in heaven and earth.