Programming a Discord bot was my first real start to familiarizing myself with Node.js and what a ride it has been. This will be my stab at an overview of the process of making a Discord bot with the Discord.js library, both self bots and bot accounts. No prior knowledge of Node assumed. As with most new things, you need some sort of context or project before learning something new and maybe Discord bots could be that impetus as it was for me.
I see Discord as the successful spiritual successor to Raidcall: a VoIP software built for a scalable number of users (like TeamSpeak, but not Skype) but with on free server hosting, user identification, and friend's list. Although primarily marketed at gamers, Discord has achieved a wide enough audience, coupled with a sufficiently comprehensive permissions system and low barrier to entry, that it has also become usable for a general purpose. And so too has the demand for bots for various purposes grown.
Supplements to Tae Kim's Guide to Japanese
The common view on Tae Kim's guide is it's really great for beginners due to how terse, concise, and easy to follow everything. It is hailed as one of the best starter free resources for learning Japanese grammar. More than a few explanations can be questionable or out-right wrong, I still think Tae Kim's guide indeed nail the balance on simplicity and covered scope.
The goal of the first section is to an attempt to disambiguate how to mark subject and object. The part following trying to disambiguate は and が is. This list of grammar points is tailored for intermediate (or more experienced) learners.
Table of Contents
(Coming soon)
(Last Updated 7 September, 2017)
Below is a list of important supplements to what the guide is missing. Keep in mind that the line of between
The goal of the first section is to an attempt to disambiguate how to mark subject and object. The part following trying to disambiguate は and が is. This list of grammar points is tailored for intermediate (or more experienced) learners.
Table of Contents
(Coming soon)
(Last Updated 7 September, 2017)
Below is a list of important supplements to what the guide is missing. Keep in mind that the line of between
Javascript Inheritance Part 4: Putting it All Together
This is part 4 of a four part series on Javascript inheritance.
Part 1: Overview and Use Case
Part 2: Delegation
Part 3: Concatenation
Part 4: Putting it All Together
For this part of the series I will no refer to class-based inheritance as 'class inheritance' and prototypal inheritance as 'object composition'.
Part 1: Overview and Use Case
Part 2: Delegation
Part 3: Concatenation
Part 4: Putting it All Together
For this part of the series I will no refer to class-based inheritance as 'class inheritance' and prototypal inheritance as 'object composition'.
Final Terminology Clarification
There are several programming paradigms or ways of thinking about how to break down a problem so that your program can solve. Javascript is multi-paradigm, but one of the ways you can choose to structure your program is object-oriented, whose goal is to break a problem down into objects that interact with each other. In general, there are two styles of approaching how to determine the relationship between these objects: class inheritance and object composition. Another way to call these is class-based inheritance and prototype-based inheritance respectively. Or to use adjectives, classical inheritance and prototypal inheritance. Yes, this is a source of confusion. Many choose to refrain from using inheritance to refer to object composition.Javascript Inheritance Part 3: Concatenation
This is part 3 of a four part series on Javascript inheritance.
Part 1: Overview and Use Case
Part 2: Delegation
Part 3: Concatenation
Part 4: Putting it All Together
Part 1: Overview and Use Case
Part 2: Delegation
Part 3: Concatenation
Part 4: Putting it All Together
Concatenation Implementation
Concatenation works by copying the methods from a prototypal to the object that wants to inherit without reference to the prototypal. Delegation works by copying just a reference to the prototypals via a call stack, but concatenation copies the methods over and attaches them to the object directly. Concentation has the following properties:Javascript Inheritance Part 2: Delegation
This is part 2 of a four part series on Javascript inheritance.
Part 1: Overview and Use Case
Part 2: Delegation
Part 3: Concatenation
Part 4: Putting it All Together
Part 1: Overview and Use Case
Part 2: Delegation
Part 3: Concatenation
Part 4: Putting it All Together
Prototypal Inheritance
There are two types of prototype-based inheritance: delegation (aka. differential) and concatenation (aka. cloning). And because Javascript allows for a lot of freedom, there are several design patterns to implement either type of prototypal inheritance, each with its own name. This combination of different inheritance paradigms, delegation vs concatenation, and implementations in combination with Javascript being the first to bring many of these concepts to the mainstream is what makes the terminology so confusing.Javascript Inheritance Part 1: Overview and Use Case
Despite having programmed in Javascript for several years now, and I never knew until recently that the type of object-orientated programming that it follows is prototype-based and not class-based. And indeed I did not know even know object-orientated programming was not synonymous with classes. When researching the subject, I found most material didn't explain clearly, and thus this is aimed to remedy that. It is aimed at those with an understanding of closure in Javascript, a tutorial for which you can find here.
Because Javascript is very grassroots in its development, the terminology surrounding these concepts is a tad unclear. The goal of this series is to clarify. If you are already familiar with the concepts and just want a top-down overview, feel free to skip to part 4.
Because Javascript is very grassroots in its development, the terminology surrounding these concepts is a tad unclear. The goal of this series is to clarify. If you are already familiar with the concepts and just want a top-down overview, feel free to skip to part 4.
Pronouns + Gerund Form
Someone linked 'Seven Bar Jokes Involving Grammar and Punctuation' by Eric K. Auld in a language exchange forum, of which I personally like three and four, and after some discussion about the second one in particular, I made some interesting discovers about English grammar.
I stumbled upon a post by Jakub Marian on the 'pronoun + gerund' pattern, the very pattern we are seeing in the joke in question (note: as a prepositional phrase not a gerund). The summary is that traditionally, the accusative or direct object pronoun before the gerund is incorrect and the genitive or possessive form before the gerund is correct, however now it's become part of the vernacular so both are correct. Additionally, it may come across as confusing to use the traditionally correct possessive as in, 'They objected to the youngest girl’s being given the command position', where it could be misheard as 'several girls being the command position'.
Another resource, an answer on Stack Exchange by nohat and RegDwigHt, goes into specifics, referencing the Cambridge Grammar of the English Language. The 'gerund clauses' can accept the accusative (direct object him) or the genitive (possessive his) as subject, however 'present particple clauses' can accept the accusative (direct object him) or the nominative (subject him) as subject, accusative being less formal in both situations.
Some further reading on phrase types.
'A dangling modifier walks into a bar. After finishing a drink, the bartender asks it to leave.'Without a dangling modifier, the latter sentence would read as:
'After finishing a drink, it was asked by the bartender to leave.'One person then ask would it be possible to add it as in, 'After it finishing a drink', citing the people's use of 'After him finishing'. Now the knee-jerk reaction was no, 'After it finishes a drink' is correct. So I decided to research further into it.
I stumbled upon a post by Jakub Marian on the 'pronoun + gerund' pattern, the very pattern we are seeing in the joke in question (note: as a prepositional phrase not a gerund). The summary is that traditionally, the accusative or direct object pronoun before the gerund is incorrect and the genitive or possessive form before the gerund is correct, however now it's become part of the vernacular so both are correct. Additionally, it may come across as confusing to use the traditionally correct possessive as in, 'They objected to the youngest girl’s being given the command position', where it could be misheard as 'several girls being the command position'.
Another resource, an answer on Stack Exchange by nohat and RegDwigHt, goes into specifics, referencing the Cambridge Grammar of the English Language. The 'gerund clauses' can accept the accusative (direct object him) or the genitive (possessive his) as subject, however 'present particple clauses' can accept the accusative (direct object him) or the nominative (subject him) as subject, accusative being less formal in both situations.
Thus, 'After it finishing a drink, the dangling particple was asked by the bartender to leave.' is a perfectly grammatical sentence.I would wager that the reason 'After it finishing a drink' sounds as if it should be conjugated is because with it the nominative and accusative case are the same: 'It eats it' versus 'She eats her'. There's no distinction, thus a native speaker defaults to this phrase to sounding as a clause with a subject (reading it as a nominative) rather than as a present participal clause within the prepositional phrase (reading it as either nominative or accusative, accusative being more natural in my opinion).
Some further reading on phrase types.
Subscribe to:
Posts (Atom)