This document discusses different types of substitutability in C++ that provide a useful way to structure a system's meaning. It identifies several types of substitutability based on C++ mechanisms: conversions, overloading, derivation, mutability, and genericity. These types capture various forms of polymorphism in C++ and draw together many language features to make sense of mechanisms and establish practices for working with the language.
Lecture 2: From Semantics To Semantic-Oriented ApplicationsMarina Santini
From the "Natural Language Processing" LinkedIn group:
John Kontos, Professor of Artificial Intelligence
I wonder whether translating into formal logic is nothing more than transliteration which simply isolates the part of the text that can be reasoned upon using the simple inference mechanism of formal logic. The real problem I think lies with the part of text that CANNOT be translated one the one hand and the one that changes its meaning due to civilization advances. My own proposal is to leave NL text alone and try building inference mechanisms for the UNTRANSLATED text depending on the task requirements.
All the best
John"
The spread and abundance of electronic documents requires automatic techniques for extracting useful information from the text they contain. The availability of conceptual taxonomies can be of great help, but manually building them is a complex and costly task. Building on previous work, we propose a technique to automatically extract conceptual graphs from text and reason with them. Since automated learning of taxonomies needs to be robust with respect to missing or partial knowledge and flexible with respect to noise, this work proposes a way to deal with these problems. The case of poor data/sparse concepts is tackled by finding generalizations among disjoint pieces of knowledge. Noise is
handled by introducing soft relationships among concepts rather than hard ones, and applying a probabilistic inferential setting. In particular, we propose to reason on the extracted graph using different kinds of relationships among concepts, where each arc/relationship is associated to a number that represents its likelihood among all possible worlds, and to face the problem of sparse knowledge by using generalizations among distant concepts as bridges between disjoint portions of knowledge.
Dependency Analysis of Abstract Universal Structures in Korean and EnglishJinho Choi
This thesis gives two contributions in the form of lexical resourcesto (1) dependency parsing in Korean and (2) semantic parsing in English. First,we describe our methodology for building three dependency treebanks in Korean derived from existing treebanks and pseudo-annotated according to the latest guidelines from the Universal Dependencies (UD). The original Google Korean UD Treebank is re-tokenized to ensure morpheme-level annotation consistency with other corpora while maintaining linguistic validity of the revised tokens. Phrase structure trees in the Penn Korean Treebank and the Kaist Treebank are automatically converted into UD dependency trees by applying head-percolation rules and linguistically motivated heuristics. A total of 38K+ dependency trees are generated.To the best of our knowledge, this is the first time that the three Korean treebanks are converted into UD dependency treebanks following the latest annotation guidelines. Second, we introduce an on-going project for augmenting the OntoNotes phrase structure treebank with semantic features found in the Abstract Meaning Representation (AMR), as part of an effort to build an accurate AMR parser. We propose a novel technique for AMR parsing that first trains a dependency parser on the OntoNotes corpus augmented with numbered arguments in the Proposition Bank (PropBank), and then does a transfer learning of the trained dependency parser for the AMR parsing task. A preliminary step is to prepare dependency data by performing an automatic replacement of dependencies that define predicate argument structure with their corresponding PropBank argument labels during constituent-to-dependency conversion. To the best of our knowledge, this is the first time that the PropBank labels are directly inserted into dependency structure, producing a new dependency corpus with rich syntactic information as well as semantic role information provided by PropBank that fully describes the predicate-argument structure, making it an ideal resource for AMR parsing and, broadly, semantic parsing.
Lecture 2: From Semantics To Semantic-Oriented ApplicationsMarina Santini
From the "Natural Language Processing" LinkedIn group:
John Kontos, Professor of Artificial Intelligence
I wonder whether translating into formal logic is nothing more than transliteration which simply isolates the part of the text that can be reasoned upon using the simple inference mechanism of formal logic. The real problem I think lies with the part of text that CANNOT be translated one the one hand and the one that changes its meaning due to civilization advances. My own proposal is to leave NL text alone and try building inference mechanisms for the UNTRANSLATED text depending on the task requirements.
All the best
John"
The spread and abundance of electronic documents requires automatic techniques for extracting useful information from the text they contain. The availability of conceptual taxonomies can be of great help, but manually building them is a complex and costly task. Building on previous work, we propose a technique to automatically extract conceptual graphs from text and reason with them. Since automated learning of taxonomies needs to be robust with respect to missing or partial knowledge and flexible with respect to noise, this work proposes a way to deal with these problems. The case of poor data/sparse concepts is tackled by finding generalizations among disjoint pieces of knowledge. Noise is
handled by introducing soft relationships among concepts rather than hard ones, and applying a probabilistic inferential setting. In particular, we propose to reason on the extracted graph using different kinds of relationships among concepts, where each arc/relationship is associated to a number that represents its likelihood among all possible worlds, and to face the problem of sparse knowledge by using generalizations among distant concepts as bridges between disjoint portions of knowledge.
Dependency Analysis of Abstract Universal Structures in Korean and EnglishJinho Choi
This thesis gives two contributions in the form of lexical resourcesto (1) dependency parsing in Korean and (2) semantic parsing in English. First,we describe our methodology for building three dependency treebanks in Korean derived from existing treebanks and pseudo-annotated according to the latest guidelines from the Universal Dependencies (UD). The original Google Korean UD Treebank is re-tokenized to ensure morpheme-level annotation consistency with other corpora while maintaining linguistic validity of the revised tokens. Phrase structure trees in the Penn Korean Treebank and the Kaist Treebank are automatically converted into UD dependency trees by applying head-percolation rules and linguistically motivated heuristics. A total of 38K+ dependency trees are generated.To the best of our knowledge, this is the first time that the three Korean treebanks are converted into UD dependency treebanks following the latest annotation guidelines. Second, we introduce an on-going project for augmenting the OntoNotes phrase structure treebank with semantic features found in the Abstract Meaning Representation (AMR), as part of an effort to build an accurate AMR parser. We propose a novel technique for AMR parsing that first trains a dependency parser on the OntoNotes corpus augmented with numbered arguments in the Proposition Bank (PropBank), and then does a transfer learning of the trained dependency parser for the AMR parsing task. A preliminary step is to prepare dependency data by performing an automatic replacement of dependencies that define predicate argument structure with their corresponding PropBank argument labels during constituent-to-dependency conversion. To the best of our knowledge, this is the first time that the PropBank labels are directly inserted into dependency structure, producing a new dependency corpus with rich syntactic information as well as semantic role information provided by PropBank that fully describes the predicate-argument structure, making it an ideal resource for AMR parsing and, broadly, semantic parsing.
MORPHOLOGICAL SEGMENTATION WITH LSTM NEURAL NETWORKS FOR TIGRINYAijnlc
Morphological segmentation is a fundamental task in language processing. Some languages, such as
Arabic and Tigrinya,have words packed with very rich morphological information.Therefore, unpacking
this information becomes a necessary taskfor many downstream natural language processing tasks. This
paper presents the first morphological segmentation research forTigrinya. We constructed a new
morphologically segmented corpus with 45,127 manually segmented tokens. Conditional random fields
(CRF) and window-based longshort-term memory (LSTM) neural networkswere employed separately to
develop our boundary detection models. We appliedlanguage-independent character and substring features
for the CRFand character embeddings for the LSTM networks. Experimentswere performed with four
variants of the Begin-Inside-Outside (BIO) chunk annotation scheme. We achieved 94.67% F1 scoreusing
bidirectional LSTMs with fixed-sizewindow approach to morphemeboundary detection.
This paper performs a detailed analysis on the alignment of Portuguese contractions, based on a previously aligned bilingual corpus. The alignment task was performed manually in a subset of the English-Portuguese CLUE4Translation Alignment Collection. The initial parallel corpus was pre-processed and a decision was made as to whether the contraction should be maintained or decomposed in the alignment. Decomposition was required in the cases in which the two words that have been concatenated, i.e., the preposition and the determiner or pronoun, go in two separate translation alignment pairs (PT- [no seio de] [a União Europeia] EN- [within] [the European Union]). Most contractions required decomposition in contexts where they are positioned at the end of a multiword unit. On the other hand, contractions tend to be maintained when they occur at the beginning or in the middle of the multiword unit, i.e., in the frozen part of the multiword (PT- [no que diz respeito a] EN- [with regard to] or PT- [além disso] EN-[in addition]. A correct alignment of multiwords and phrasal units containing contractions is instrumental for machine translation, paraphrasing, and variety adaptation.
A Distributional Semantics Approach for Selective Reasoning on Commonsense Gr...Andre Freitas
Tasks such as question answering and semantic search are dependent
on the ability of querying & reasoning over large-scale commonsense knowledge
bases (KBs). However, dealing with commonsense data demands coping with
problems such as the increase in schema complexity, semantic inconsistency, incompleteness
and scalability. This paper proposes a selective graph navigation
mechanism based on a distributional relational semantic model which can be applied
to querying & reasoning over heterogeneous knowledge bases (KBs). The
approach can be used for approximative reasoning, querying and associational
knowledge discovery. In this paper we focus on commonsense reasoning as the
main motivational scenario for the approach. The approach focuses on addressing
the following problems: (i) providing a semantic selection mechanism for facts
which are relevant and meaningful in a specific reasoning & querying context
and (ii) allowing coping with information incompleteness in large KBs. The approach
is evaluated using ConceptNet as a commonsense KB, and achieved high
selectivity, high scalability and high accuracy in the selection of meaningful nav-
igational paths. Distributional semantics is also used as a principled mechanism
to cope with information incompleteness.
The process of language learning involves the mastery of countless tasks: making the constituent sounds of
the language being learned, learning the grammatical patterns, and acquiring the requisite vocabulary for
reception and production.
While a plethora of computational tools exist to facilitate the first and second of these tasks, a number of
challenges arise with respect to enabling the third. This paper describes a tool that has been designed to
support language learners with the challenge of understanding the use of ‘closed-class’ lexical items.
The process of learning the Arabic for ‘office’ is (mktb) is relatively simple and should be possible by
means of simple repetition of the word. However, it is much more difficult to learn and correctly use the
Arabic equivalent of the word ‘on’. The current paper describes a mechanism for the delivery of diagnostic
information regarding specific lexical examples, with the aim of clearly demonstrating why a particular
translation of a given closed-class item may be appropriate in certain situations but not others, thereby
helping learners to understand and use the term correctly.
Corpus-based part-of-speech disambiguation of PersianIDES Editor
In this paper we introduce a method for part-ofspeech
disambiguation of Persian texts, which uses word class
probabilities in a relatively small training corpus in order to
automatically tag unrestricted Persian texts. The experiment
has been carried out in two levels as unigram and bi-gram
genotypes disambiguation. Comparing the results gained from
the two levels, we show that using immediate right context to
which a given word belongs can increase the accuracy rate of
the system to a high degree
Nakov S., Nakov P., Paskaleva E., Improved Word Alignments Using the Web as a...Svetlin Nakov
Nakov P., Nakov S., Paskaleva E., Improved Word Alignments Using the Web as a Corpus, Proceedings of the International Conference RANLP 2007 (Recent Advances in Natural Language Processing), pp. 400-405, ISBN 978-954-91743-7-3, Borovets, Bulgaria, 27-29 September 2007
Automatic Identification of False Friends in Parallel Corpora: Statistical an...Svetlin Nakov
Scientific article: False friends are pairs of words in two languages that are perceived as similar but have different meanings. We present an improved algorithm for acquiring false friends from sentence-level aligned parallel corpus based on statistical observations of words occurrences and co-occurrences in the parallel sentences. The results are compared with an entirely semantic measure for cross-lingual similarity between words based on using the Web as a corpus through analyzing the wordsâ local contexts extracted from the text snippets returned by searching in Google. The statistical and semantic measures are further combined into an improved algorithm for identification of false friends that achieves almost twice better results than previously known algorithms. The evaluation is performed for identifying cognates between Bulgarian and Russian but the proposed methods could be adopted for other language pairs for which parallel corpora and bilingual glossaries are available.
MORPHOLOGICAL SEGMENTATION WITH LSTM NEURAL NETWORKS FOR TIGRINYAijnlc
Morphological segmentation is a fundamental task in language processing. Some languages, such as
Arabic and Tigrinya,have words packed with very rich morphological information.Therefore, unpacking
this information becomes a necessary taskfor many downstream natural language processing tasks. This
paper presents the first morphological segmentation research forTigrinya. We constructed a new
morphologically segmented corpus with 45,127 manually segmented tokens. Conditional random fields
(CRF) and window-based longshort-term memory (LSTM) neural networkswere employed separately to
develop our boundary detection models. We appliedlanguage-independent character and substring features
for the CRFand character embeddings for the LSTM networks. Experimentswere performed with four
variants of the Begin-Inside-Outside (BIO) chunk annotation scheme. We achieved 94.67% F1 scoreusing
bidirectional LSTMs with fixed-sizewindow approach to morphemeboundary detection.
This paper performs a detailed analysis on the alignment of Portuguese contractions, based on a previously aligned bilingual corpus. The alignment task was performed manually in a subset of the English-Portuguese CLUE4Translation Alignment Collection. The initial parallel corpus was pre-processed and a decision was made as to whether the contraction should be maintained or decomposed in the alignment. Decomposition was required in the cases in which the two words that have been concatenated, i.e., the preposition and the determiner or pronoun, go in two separate translation alignment pairs (PT- [no seio de] [a União Europeia] EN- [within] [the European Union]). Most contractions required decomposition in contexts where they are positioned at the end of a multiword unit. On the other hand, contractions tend to be maintained when they occur at the beginning or in the middle of the multiword unit, i.e., in the frozen part of the multiword (PT- [no que diz respeito a] EN- [with regard to] or PT- [além disso] EN-[in addition]. A correct alignment of multiwords and phrasal units containing contractions is instrumental for machine translation, paraphrasing, and variety adaptation.
A Distributional Semantics Approach for Selective Reasoning on Commonsense Gr...Andre Freitas
Tasks such as question answering and semantic search are dependent
on the ability of querying & reasoning over large-scale commonsense knowledge
bases (KBs). However, dealing with commonsense data demands coping with
problems such as the increase in schema complexity, semantic inconsistency, incompleteness
and scalability. This paper proposes a selective graph navigation
mechanism based on a distributional relational semantic model which can be applied
to querying & reasoning over heterogeneous knowledge bases (KBs). The
approach can be used for approximative reasoning, querying and associational
knowledge discovery. In this paper we focus on commonsense reasoning as the
main motivational scenario for the approach. The approach focuses on addressing
the following problems: (i) providing a semantic selection mechanism for facts
which are relevant and meaningful in a specific reasoning & querying context
and (ii) allowing coping with information incompleteness in large KBs. The approach
is evaluated using ConceptNet as a commonsense KB, and achieved high
selectivity, high scalability and high accuracy in the selection of meaningful nav-
igational paths. Distributional semantics is also used as a principled mechanism
to cope with information incompleteness.
The process of language learning involves the mastery of countless tasks: making the constituent sounds of
the language being learned, learning the grammatical patterns, and acquiring the requisite vocabulary for
reception and production.
While a plethora of computational tools exist to facilitate the first and second of these tasks, a number of
challenges arise with respect to enabling the third. This paper describes a tool that has been designed to
support language learners with the challenge of understanding the use of ‘closed-class’ lexical items.
The process of learning the Arabic for ‘office’ is (mktb) is relatively simple and should be possible by
means of simple repetition of the word. However, it is much more difficult to learn and correctly use the
Arabic equivalent of the word ‘on’. The current paper describes a mechanism for the delivery of diagnostic
information regarding specific lexical examples, with the aim of clearly demonstrating why a particular
translation of a given closed-class item may be appropriate in certain situations but not others, thereby
helping learners to understand and use the term correctly.
Corpus-based part-of-speech disambiguation of PersianIDES Editor
In this paper we introduce a method for part-ofspeech
disambiguation of Persian texts, which uses word class
probabilities in a relatively small training corpus in order to
automatically tag unrestricted Persian texts. The experiment
has been carried out in two levels as unigram and bi-gram
genotypes disambiguation. Comparing the results gained from
the two levels, we show that using immediate right context to
which a given word belongs can increase the accuracy rate of
the system to a high degree
Nakov S., Nakov P., Paskaleva E., Improved Word Alignments Using the Web as a...Svetlin Nakov
Nakov P., Nakov S., Paskaleva E., Improved Word Alignments Using the Web as a Corpus, Proceedings of the International Conference RANLP 2007 (Recent Advances in Natural Language Processing), pp. 400-405, ISBN 978-954-91743-7-3, Borovets, Bulgaria, 27-29 September 2007
Automatic Identification of False Friends in Parallel Corpora: Statistical an...Svetlin Nakov
Scientific article: False friends are pairs of words in two languages that are perceived as similar but have different meanings. We present an improved algorithm for acquiring false friends from sentence-level aligned parallel corpus based on statistical observations of words occurrences and co-occurrences in the parallel sentences. The results are compared with an entirely semantic measure for cross-lingual similarity between words based on using the Web as a corpus through analyzing the wordsâ local contexts extracted from the text snippets returned by searching in Google. The statistical and semantic measures are further combined into an improved algorithm for identification of false friends that achieves almost twice better results than previously known algorithms. The evaluation is performed for identifying cognates between Bulgarian and Russian but the proposed methods could be adopted for other language pairs for which parallel corpora and bilingual glossaries are available.
Worse Is Better, for Better or for WorseKevlin Henney
Presented at GOTO Aarhus 2014 (2nd October 2013)
Over two decades ago, Richard P Gabriel proposed the thesis of "Worse Is Better" to explain why some things that are designed to be pure and perfect are eclipsed by solutions that are seemingly limited and incomplete. This is not simply the observation that things that should be better are not, but that some solutions that were not designed to be the best were nonetheless effective and were the better option. We find many examples of this in software development, some more provocative and surprising than others. In this talk we revisit the original premise and question in the context of product development and user experience, challenging some common ideas of what delights the user, the customer and the market and what should (or should not) be simple in a product.
Presented at NDC London (5th December 2014)
How much should you rely on your IDE to govern your coding style? How many asserts should a test case have or not have? How much work should a constructor (not) do? How do you name your classes and other identifiers? How closed or open should your classes be? How do you lay out your code? These questions and others have standard answers based on received and repeated mantras, practices that are communicated in good faith to be passed on as habits. But how much reason supports these assertions? It turns out that the advice often fails, even for the novices they are intended to guide, or simply doesn't make sense.
This talk has little respect for ritual and tradition and takes no prisoners: What actually makes sense and what doesn't when it comes to matters of practice? What guidelines offer the greatest effect and the greatest learning?
Keynote presented at SDD (12th May 2015)
Somewhere in the heart of a development process, essential to the very being of a product's existence, are the people who write, consider and wrestle with code. What motivates and demotivates them? What are the intellectual challenges and rewards? What are the skills they have and need and cognitive biases and environment they work with and against?
This talk by the editor of 97 Things Every Programmer Should Know considers the act of programming and those who do it and want to get better at it, from the perspective of development process to craft, from architecture to code.
Formal treatments of inheritance are rather scarce and those that do exist are often more suited for
analysis of existing systems than as guides to language designers. One problem that adds complexity to
previous efforts is the need to pass a reference to the original invoking object throughout the method call
tree. In this paper, a novel specification of inheritance semantics is given. The approach dispenses with
self-reference, instead using static and dynamic scope to accomplish similar behaviour. The result is a
methodology that is simpler than previous specification attempts, easy to understand, and sufficiently
expressive. Moreover, an inheritance system based on this approach can be implemented with relatively
few lines of code in environment-passing interpreters.
John Backus identified value-level (object-level) programming languages as programming languages
that combine various values to form other values until the final result values are obtained. Virtually
all our classic programming languages today including C, C++, and Java belong into this category.
Here we identify pattern-level (term-level) programming languages that combine various patterns
to form other patterns until the final result patterns are obtained. New patterns are constructed
from existing ones by the application of pattern-to-pattern functions exploiting pattern matching and
constructors. First-order logic programming languages such as Prolog, OBJ, and Maude belong into
this category. Our insight that pattern-level and value-level programming gives rise to a patternvalue duality is used as the foundation of the design of a new programming language called Asteroid.
Hallmarks of this new programming language design are the developer’s ability to explicitly control
the interpretation or model of expression terms and the notion of ‘patterns as first class citizens’.
In addition to a complete implementation of pattern-level programming Asteroid also supports an
object-oriented style of programming based on prototypes and also subject to pattern matching.
A Survey of Object Oriented Programming LanguagesMaya Hris.docxdaniahendric
A Survey of Object Oriented Programming Languages
Maya Hristakeva, RadhaKrishna Vuppala
Univ. of California, Santa Cruz
{mayah,vrk}@soe.ucsc.edu
1 Abstract
Object-oriented programming has become a very important programming paradigm of our times.
From the time it was brought into existence by Simula, object-oriented programming has seen wide
acceptance. Object-oriented programming languages (OOPLs) directly support the object notions of
classes, inheritance, information hiding (encapsulation), and dynamic binding (polymorphism). There
is a wide variety of implementations for each of these concepts, and there is no general agreement as to
how a particular concept must be interpreted. This survey takes a detailed look at some of the concepts
considered fundamental to object-orientation, namely inheritance and polymorphism. Different aspects
of inheritance and polymorphism are implemented in various popular OOPLs. We conclude with the
observation that there is still lot of work to be done to reach a common ground for these crucial features
of OOPLs. This survey presents a detailed comparison of Java, C++, C# , Eiffel, Smalltalk, Ruby and
Python in terms of their inheritance and polymorphism implementations. The paper also presents a
compilation of the observations made by several earlier surveys [1, 27].
2 Introduction
There is a big variety of programming languages catering to various kinds of development require-
ments. Three of the main categories are procedural languages (e.g. C, Pascal, etc.), functional languages
(e.g. Haskel, Ocaml, etc.), and object-oriented programming languages (e.g. C++, Java, etc.). The
object-oriented design paradigm has been popular for quite some time owing its success to the powerful
features it offers for making program development easy and robust. OOPLs, such as C++ and Java,
offer an intuitive way of developing programs and provide powerful features for supporting the program
development. While languages like C can be used to develop programs that follow an object-oriented
design, the support of features such as inheritance, encapsulation, strong type support, exception han-
dling, etc. in the OOPLs make them more suitable for such development.
While the object-oriented programming paradigm provides a more intuitive way of programming, it
is also has complexities. This is due to the various complex features that the paradigm offers. OOPLs
differ widely in the way they implement features that are associated with the object design. For example,
some languages support multiple inheritance while some languages consider it a bad feature. In this sur-
vey we discuss the various features of object-oriented programs and how the languages we considered
1
(Java, C++, C# , Eiffel, Smalltalk, Ruby and Python) differ in implementing these features.
The survey is organized as follows. The Section 3 describes in detail the key concepts of OOPLs. Sec-
tion 4 presents a brief historical view of the OOPLs and gives a ...
If you're looking to land a technical job, then you already know that the interview process can be rigorous and challenging. That's why we've created an eBook that focuses on the Top 30 Technical Interview Questions that you're likely to face during the interview process.
Our eBook is a comprehensive guide that covers all the technical aspects of the interview, including software development, database administration, system administration, and much more. With each question, we've included a detailed explanation of the concept and a step-by-step solution to help you answer the question with confidence.
The Top 30 Technical Interview Questions eBook is perfect for anyone who is preparing for a technical interview. Whether you're a student, a recent graduate, or an experienced professional, our eBook will provide you with the knowledge and skills you need to succeed in your interview.
In this paper we present the SMalL Ontology for malicious software classification, SMalL Java Application for antivirus systems comparison and the SMalL knowledge based file format for malware related attacks. We believe that our ontology is able to aid the development of malware prevention software by offering a common knowledge base and a clear classification of the existing malicious software. The application is a prototype regarding how this ontology might be used in conjunction with known antivirus capabilities to offer a comprehensive comparison.
Presented at .NET South West (2024-03-26)
https://www.meetup.com/dotnetsouthwest/events/299766807/
One of the greatest shifts in modern programming practices has been how programmers across many different domains, languages and environments have embraced unit testing. Good unit testing, however, is more than waving NUnit at your C# source. Tests help to make long-term product development cost effective rather than a cost centre, they underpin the effective flow of CI/CD and reduce failure demand on a team.
But the discussion of unit testing goes further than simply writing tests: what makes a good unit test? It is not enough to have tests; poor quality tests can hold back development just as good tests can streamline it. This session provides a perspective on what good unit tests (GUTs) can look like with a couple of examples.
Presented at Agile meets Architecture (2023-10-05)
Video at https://www.youtube.com/watch?v=LLEXAdO3X1o
One of the (most overlooked) principles of the Manifesto for Agile Software Development is that "Continuous attention to technical excellence and good design enhances agility". All too often, work that focuses on addressing technical issues is deprioritised in the name of focusing on business value.
Is there a case for technical excellence — in code, in architecture, in people — beyond its appearance on a might-as-well-be-hidden page on a manifesto that's over two decades old? Is technical excellence only the concern of technical roles? Is a good architecture in conflict with business value or a vehicle for it?
This session looks to go beyond buzzwords to build a case for technical excellence that appeals to all roles in a development organisation, noting that "The best architectures, requirements, and designs emerge from self-organizing teams".
Presented online for Build Stuff meetup (https://www.buildstuff.events/events/online-build-stuff-meetup-with-kevlin-henney-and-cassandra-faris)
Whether we are talking about software architecture, coding practices or our development process, it's important to keep it real. All too often we find ourselves attracted to ideas that sound great in theory, but may not work out in practice. All too often we assume we are right — the planned release schedule, the key architectural decisions, the good practices we saw in a blog — but fail to adjust for reality. We fail to acknowledge that our knowledge was incomplete or that the situation has changed, sticking to the plan and practice regardless.
In this talk we will look at what an empirical approach to development means in practice, why it is that up-front architecture is risky and expensive, why it is that most teams who say they're doing agile development are not, and how we can use uncertainty and instability to structure our time and our code.
Presented online for C++ on Sea (2020-07-17)
Video at https://www.youtube.com/watch?v=Bai1DTcCHVE
Lambdas. All the cool kid languages have them. But does lambda mean what C++ and other languages, from Java to Python, mean by lambda? Where did lambdas come from? What were they originally for? What is their relationship to data abstraction?
In this session we will into the history, the syntax, the uses and abuses of lambdas and the way in which lambda constructs in C++ and other languages do (or do not) match the original construct introduced in lambda calculus.
Presented online for javaBin (2020-04-14)
Video at https://www.youtube.com/watch?v=orcSUE0Jjdc
Lambdas. All the cool kid languages have them. But does ‘lambda’ mean what Java, JavaScript, etc. mean by ‘lambda’? Where did lambdas come from? What were they originally for? What is their relationship to data abstraction?
In this session we will look into the history, the syntax and the uses of lambdas and the way in which lambda constructs in Java and other languages do (or do not) match the original construct introduced in lambda calculus.
Presented at DevSum (2018-05-31)
The SOLID principles are often presented as being core to good code design practice. Each of S, O, L, I and D do not, however, necessarily mean what programmers expect they mean or are taught. By understanding this range of beliefs we can learn more about practices for objects, components and interfaces than just S, O, L, I and D.
This talk reviews the SOLID principles and reveals contradictions and different interpretations. It is through paradoxes and surprises we often gain insights. We will leave SOLID somewhat more fluid, but having learnt from them more than expected.
Presented at Foo Café (2019-03-21)
Video at https://www.youtube.com/watch?v=tLSKLLxrZyY
Programmers use coding katas to kick the tyres of their programming languages, paradigms and practices. Typically anchored in a TDD cycle, katas are simple problems that give programmers the opportunity to exercise deliberate practice and explore different approaches, whether programming style, pair programming or test-first programming.
But the simplicity can be deceptive, with many programmers tiring of these katas too soon, missing out on some of the more mind-bending and paradigm-expanding opportunities on offer.
This session will pick on a couple of katas and dig deeper into TDD, lambdas, language(s), (dys)functional programming and Alcubierre drive. It will present code in a variety of languages, highlight the weaknesses of some common mantras, play around with ideas — and blend code, humour and general nerdiness to be both an enjoyable and educational session.
Procedural Programming: It’s Back? It Never Went AwayKevlin Henney
Presented at ACCU Conference 2018 (2018-04-12)
Video at https://www.youtube.com/watch?v=mrY6xrWp3Gs
When programmers describe code as 'procedural', it’s generally not meant as a compliment. There is a belief that we have collectively moved pass such thinking and onto better paradigms. But a paradigm is no more than a pattern language, a family of solutions fit for a context. Change the kind of problem you are solving and you may find a different solution makes sense — even, in these days where pure functions battle it out with classy objects, procedural programming.
This talk takes a look at some of the past, present and future of procedural programming, looking at how there’s more to it than many first assume, how it has informed and continues to influence language design and how it relates to other paradigms, such as functional and OO.
Structure and Interpretation of Test CasesKevlin Henney
Presented at ACCU Cambridge (2018-10-23)
Throw a line of code into many codebases and it's sure to hit one or more testing frameworks. There's no shortage of frameworks for testing, each with their particular spin and set of conventions, but that glut is not always matched by a clear vision of how to structure and use tests — a framework is a vehicle, but you still need to know how to drive. The computer science classic, Structure and Interpretation of Computer Programs, points out that "Programs must be written for people to read, and only incidentally for machines to execute". The same is true of test code.
This talk takes a deep dive into unit testing, looking at examples and counterexamples across a number of languages and frameworks, from naming to nesting, exploring the benefits of data-driven testing, the trade-offs between example-based and property-based testing, how to get the most out of the common given–when–then refrain and knowing how far to follow it.
Keynote present at Agile Tour Vienna (2018-10-06)
Velocity. Sprints. More points, more speed. An obsession with speed often overtakes the core values of agile software development. It’s not just development of software; it’s development of working software. Sprints are not about sprinting; they’re about sustainable pace. Time to market is less important than time in market. Full-stack development is normally a statement about technology, but it also applies to individuals and interactions. The full stack touches both the code and the world outside the code, and with that view comes responsibility and pause for thought. Doing the wrong thing smarter is not smart. The point of a team is its group intelligence not its numbers. Is scaling up the challenge, or is scaling down the real challenge? The distraction and misuse of speed, velocity, point-based systems, time, team size, scale, etc. is not the accelerant of agile development. Agility lies in experimentation, responsiveness and team intelligence.
Keynote presented at NewCrafts (2018-06-18)
Video available at https://vimeo.com/276832516
It has been said that immutability changes everything. But what does that mean in practice? What does it mean for existing code that looks more like the mutant apocalypse than an elegant application of mathematical thinking? Immutability can be an ideal that is hard to reach. Refactoring, on the other hand, is all about the art of the possible. In this talk we'll be clarifying motivation and exploring some approaches to help reducing state mutability in code.
Keynote presented at GOTO Chicago (2018-04-26)
Video available at https://www.youtube.com/watch?v=AbgsfeGvg3E
Everything is changing. Everything is new. Frameworks, platforms and trends are displaced on a weekly basis. Skills are churning.
And yet... Beneath this seemingly turbulent flow there is a slow current, strong and steady, changing relatively little over the decades. Concepts with a long history appear in new forms and fads and technologies. Principles are revisited. Ideas once lost to the mainstream are found again.
In this keynote we revisit the present through the past, looking at the enduring principles that shape programming languages, architecture, development practice and development process, the ideas that cycle round, each time becoming perhaps a little better defined, a little more mature, and look to see what else might be on the horizon.
Presented at SwanseaCon (2017-09-26)
We default to considering systems from an insider's perspective; the view from outside can be quite different. Can we apply this inversion to more than just requirements?
We may say we want testing, but what do we want from testing? We may say we want logging, but what do we want from logging? We may say we want clean code, but what do we want from clean code? We may say we want an agile process, but what do we want from an agile process? These are harder questions, but their answers can make for better solutions.
Presented at .NET South West (2017-07-25)
Code is basically made up of three things: names, spacing and punctuation. With these three tools a programmer needs to communicate intent, and not simply instruct. But if we look at most approaches to naming, they are based on the idea that names are merely labels, so that discussion of identifier naming becomes little more than a discussion of good labelling.
A good name is more than a label; a good name should change the way the reader thinks. A good name should describe structure with intention, as opposed to the affix-heavy approach common to many naming conventions in current use, where the addition of more prefixes and suffixes becomes homeopathic, diluting the meaning. Good naming is part of good design. This session looks at why and what it takes to get a good name.
Clean Coders Hate What Happens To Your Code When You Use These Enterprise Pro...Kevlin Henney
Presented at code::dive (2016-11-15)
Video available at https://www.youtube.com/watch?v=brfqm9k6qzc
It is all to easy to dismiss problematic codebases on some nebulous idea of bad practice or bad programmers. Poor code, however, is rarely arbitrary and random in its structure or formulation. Systems of code, well or poorly structured, emerge from systems of practice, whether effective or ineffective. To improve code quality, it makes more sense to pick apart the specific practices and see their interplay — the cause — than to simply focus on the code itself — the effect. This talk looks at how a handful of coding habits, design practices and assumptions can systematically balloon code and compound its accidental complexity.
Thinking Outside the Synchronisation QuadrantKevlin Henney
Presented at code::dive (2016-11-16)
Video available at https://www.youtube.com/watch?v=yl25p91flLY
Ask programmers what comes to mind when you say concurrency and most are likely to say threads. Ask what comes to mind when you say threads and most are likely to say locks or synchronisation. These assumptions are so deeply held that they define and constrain how programmers are taught and think about concurrency: thread safety is almost synonymous with the avoidance of race conditions and the guarded protection of mutable state. But this is only one quadrant of four possibilities, a quadrant diagram partitioned by mutable–immutable along one axis and shared–unshared along another. Modern C++ supports programmers in all four quadrants, not just the synchronisation quadrant. From immutability to actors, this talk will take a look at patterns and practices that encourage thinking and coding outside the locked box.
Presented at GOTO Amsterdam (2017-06-13)
Video available at https://www.youtube.com/watch?v=YyhfK-aBo-Y
What is risk? Many people aren't sure, but it's not just uncertainty: risk is exposure to uncertainty.
Instead of just plastering over the cracks, security should also involve reducing the size and number of cracks, reducing the opportunities for cracks to appear, reducing the class of errors and oversights that can open a system to failure instigated from the outside. We can learn a lot from other kinds of software failure, because every failure unrelated to security can be easily reframed as a security-failure opportunity.
This is not a talk about access control models, authentication, encryption standards, firewalls, etc. This is a talk about reducing risk that lives in the code and the assumptions of architecture, reducing the risk in development practices and in the blind spot of development practices.
Keynote presented at SATURN (2nd May 2017)
Video available at https://www.youtube.com/watch?v=MS3c9hz0bRg
"It's just a detail." Have you ever said that or been told that? Whether it's about implementation or requirements, we often use the word detail to suggest that something is not important enough to worry about. There are so many things to worry about in software development that we need to prioritize—too much detail, not enough focus. The problem is that in software, the details matter because that is what software is: lots of details brought together in combination. If we don't focus on the details, we get debt, defects, and delays.
Presented at Agile Bath & Bristol (21st March 2017)
If software development is a co-operative game, as Alistair Cockburn observed, then what kind of game is Scrum? Lots of people are playing it — or say they are — but there seems to be some disagreement about what the point of the game is, how to play it and even, in many cases, what the rules are. This talk looks at Scrum and other agile approaches through the lens of nomic games, hypothesis-driven development and fun.
Presented at the European Bioinformatics Institute (17th March 2017)
We often talk about good code — that we would like to write it, that there isn't enough of it, that it should not be considered an optional attribute of a codebase. We often talk about it but, when it comes to being precise, we don't always agree what constitutes good code, nor do we necessarily share a common view on its value.
A Study of Variable-Role-based Feature Enrichment in Neural Models of CodeAftab Hussain
Understanding variable roles in code has been found to be helpful by students
in learning programming -- could variable roles help deep neural models in
performing coding tasks? We do an exploratory study.
- These are slides of the talk given at InteNSE'23: The 1st International Workshop on Interpretability and Robustness in Neural Software Engineering, co-located with the 45th International Conference on Software Engineering, ICSE 2023, Melbourne Australia
Software Engineering, Software Consulting, Tech Lead.
Spring Boot, Spring Cloud, Spring Core, Spring JDBC, Spring Security,
Spring Transaction, Spring MVC,
Log4j, REST/SOAP WEB-SERVICES.
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamtakuyayamamoto1800
In this slide, we show the simulation example and the way to compile this solver.
In this solver, the Helmholtz equation can be solved by helmholtzFoam. Also, the Helmholtz equation with uniformly dispersed bubbles can be simulated by helmholtzBubbleFoam.
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Crescat
Crescat is industry-trusted event management software, built by event professionals for event professionals. Founded in 2017, we have three key products tailored for the live event industry.
Crescat Event for concert promoters and event agencies. Crescat Venue for music venues, conference centers, wedding venues, concert halls and more. And Crescat Festival for festivals, conferences and complex events.
With a wide range of popular features such as event scheduling, shift management, volunteer and crew coordination, artist booking and much more, Crescat is designed for customisation and ease-of-use.
Over 125,000 events have been planned in Crescat and with hundreds of customers of all shapes and sizes, from boutique event agencies through to international concert promoters, Crescat is rigged for success. What's more, we highly value feedback from our users and we are constantly improving our software with updates, new features and improvements.
If you plan events, run a venue or produce festivals and you're looking for ways to make your life easier, then we have a solution for you. Try our software for free or schedule a no-obligation demo with one of our product specialists today at crescat.io
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI AppGoogle
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
👉👉 Click Here To Get More Info 👇👇
https://sumonreview.com/ai-fusion-buddy-review
AI Fusion Buddy Review: Key Features
✅Create Stunning AI App Suite Fully Powered By Google's Latest AI technology, Gemini
✅Use Gemini to Build high-converting Converting Sales Video Scripts, ad copies, Trending Articles, blogs, etc.100% unique!
✅Create Ultra-HD graphics with a single keyword or phrase that commands 10x eyeballs!
✅Fully automated AI articles bulk generation!
✅Auto-post or schedule stunning AI content across all your accounts at once—WordPress, Facebook, LinkedIn, Blogger, and more.
✅With one keyword or URL, generate complete websites, landing pages, and more…
✅Automatically create & sell AI content, graphics, websites, landing pages, & all that gets you paid non-stop 24*7.
✅Pre-built High-Converting 100+ website Templates and 2000+ graphic templates logos, banners, and thumbnail images in Trending Niches.
✅Say goodbye to wasting time logging into multiple Chat GPT & AI Apps once & for all!
✅Save over $5000 per year and kick out dependency on third parties completely!
✅Brand New App: Not available anywhere else!
✅ Beginner-friendly!
✅ZERO upfront cost or any extra expenses
✅Risk-Free: 30-Day Money-Back Guarantee!
✅Commercial License included!
See My Other Reviews Article:
(1) AI Genie Review: https://sumonreview.com/ai-genie-review
(2) SocioWave Review: https://sumonreview.com/sociowave-review
(3) AI Partner & Profit Review: https://sumonreview.com/ai-partner-profit-review
(4) AI Ebook Suite Review: https://sumonreview.com/ai-ebook-suite-review
#AIFusionBuddyReview,
#AIFusionBuddyFeatures,
#AIFusionBuddyPricing,
#AIFusionBuddyProsandCons,
#AIFusionBuddyTutorial,
#AIFusionBuddyUserExperience
#AIFusionBuddyforBeginners,
#AIFusionBuddyBenefits,
#AIFusionBuddyComparison,
#AIFusionBuddyInstallation,
#AIFusionBuddyRefundPolicy,
#AIFusionBuddyDemo,
#AIFusionBuddyMaintenanceFees,
#AIFusionBuddyNewbieFriendly,
#WhatIsAIFusionBuddy?,
#HowDoesAIFusionBuddyWorks
Atelier - Innover avec l’IA Générative et les graphes de connaissancesNeo4j
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Allez au-delà du battage médiatique autour de l’IA et découvrez des techniques pratiques pour utiliser l’IA de manière responsable à travers les données de votre organisation. Explorez comment utiliser les graphes de connaissances pour augmenter la précision, la transparence et la capacité d’explication dans les systèmes d’IA générative. Vous partirez avec une expérience pratique combinant les relations entre les données et les LLM pour apporter du contexte spécifique à votre domaine et améliorer votre raisonnement.
Amenez votre ordinateur portable et nous vous guiderons sur la mise en place de votre propre pile d’IA générative, en vous fournissant des exemples pratiques et codés pour démarrer en quelques minutes.
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...Juraj Vysvader
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I didn't get rich from it but it did have 63K downloads (powered possible tens of thousands of websites).
Graspan: A Big Data System for Big Code AnalysisAftab Hussain
We built a disk-based parallel graph system, Graspan, that uses a novel edge-pair centric computation model to compute dynamic transitive closures on very large program graphs.
We implement context-sensitive pointer/alias and dataflow analyses on Graspan. An evaluation of these analyses on large codebases such as Linux shows that their Graspan implementations scale to millions of lines of code and are much simpler than their original implementations.
These analyses were used to augment the existing checkers; these augmented checkers found 132 new NULL pointer bugs and 1308 unnecessary NULL tests in Linux 4.4.0-rc5, PostgreSQL 8.3.9, and Apache httpd 2.2.18.
- Accepted in ASPLOS ‘17, Xi’an, China.
- Featured in the tutorial, Systemized Program Analyses: A Big Data Perspective on Static Analysis Scalability, ASPLOS ‘17.
- Invited for presentation at SoCal PLS ‘16.
- Invited for poster presentation at PLDI SRC ‘16.
Understanding Globus Data Transfers with NetSageGlobus
NetSage is an open privacy-aware network measurement, analysis, and visualization service designed to help end-users visualize and reason about large data transfers. NetSage traditionally has used a combination of passive measurements, including SNMP and flow data, as well as active measurements, mainly perfSONAR, to provide longitudinal network performance data visualization. It has been deployed by dozens of networks world wide, and is supported domestically by the Engagement and Performance Operations Center (EPOC), NSF #2328479. We have recently expanded the NetSage data sources to include logs for Globus data transfers, following the same privacy-preserving approach as for Flow data. Using the logs for the Texas Advanced Computing Center (TACC) as an example, this talk will walk through several different example use cases that NetSage can answer, including: Who is using Globus to share data with my institution, and what kind of performance are they able to achieve? How many transfers has Globus supported for us? Which sites are we sharing the most data with, and how is that changing over time? How is my site using Globus to move data internally, and what kind of performance do we see for those transfers? What percentage of data transfers at my institution used Globus, and how did the overall data transfer performance compare to the Globus users?
Enhancing Research Orchestration Capabilities at ORNL.pdfGlobus
Cross-facility research orchestration comes with ever-changing constraints regarding the availability and suitability of various compute and data resources. In short, a flexible data and processing fabric is needed to enable the dynamic redirection of data and compute tasks throughout the lifecycle of an experiment. In this talk, we illustrate how we easily leveraged Globus services to instrument the ACE research testbed at the Oak Ridge Leadership Computing Facility with flexible data and task orchestration capabilities.
OpenMetadata Community Meeting - 5th June 2024OpenMetadata
The OpenMetadata Community Meeting was held on June 5th, 2024. In this meeting, we discussed about the data quality capabilities that are integrated with the Incident Manager, providing a complete solution to handle your data observability needs. Watch the end-to-end demo of the data quality features.
* How to run your own data quality framework
* What is the performance impact of running data quality frameworks
* How to run the test cases in your own ETL pipelines
* How the Incident Manager is integrated
* Get notified with alerts when test cases fail
Watch the meeting recording here - https://www.youtube.com/watch?v=UbNOje0kf6E
Essentials of Automations: The Art of Triggers and Actions in FMESafe Software
In this second installment of our Essentials of Automations webinar series, we’ll explore the landscape of triggers and actions, guiding you through the nuances of authoring and adapting workspaces for seamless automations. Gain an understanding of the full spectrum of triggers and actions available in FME, empowering you to enhance your workspaces for efficient automation.
We’ll kick things off by showcasing the most commonly used event-based triggers, introducing you to various automation workflows like manual triggers, schedules, directory watchers, and more. Plus, see how these elements play out in real scenarios.
Whether you’re tweaking your current setup or building from the ground up, this session will arm you with the tools and insights needed to transform your FME usage into a powerhouse of productivity. Join us to discover effective strategies that simplify complex processes, enhancing your productivity and transforming your data management practices with FME. Let’s turn complexity into clarity and make your workspaces work wonders!
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns
Unlocking Business Potential: Tailored Technology Solutions by Prosigns
Discover how Prosigns, a leading technology solutions provider, partners with businesses to drive innovation and success. Our presentation showcases our comprehensive range of services, including custom software development, web and mobile app development, AI & ML solutions, blockchain integration, DevOps services, and Microsoft Dynamics 365 support.
Custom Software Development: Prosigns specializes in creating bespoke software solutions that cater to your unique business needs. Our team of experts works closely with you to understand your requirements and deliver tailor-made software that enhances efficiency and drives growth.
Web and Mobile App Development: From responsive websites to intuitive mobile applications, Prosigns develops cutting-edge solutions that engage users and deliver seamless experiences across devices.
AI & ML Solutions: Harnessing the power of Artificial Intelligence and Machine Learning, Prosigns provides smart solutions that automate processes, provide valuable insights, and drive informed decision-making.
Blockchain Integration: Prosigns offers comprehensive blockchain solutions, including development, integration, and consulting services, enabling businesses to leverage blockchain technology for enhanced security, transparency, and efficiency.
DevOps Services: Prosigns' DevOps services streamline development and operations processes, ensuring faster and more reliable software delivery through automation and continuous integration.
Microsoft Dynamics 365 Support: Prosigns provides comprehensive support and maintenance services for Microsoft Dynamics 365, ensuring your system is always up-to-date, secure, and running smoothly.
Learn how our collaborative approach and dedication to excellence help businesses achieve their goals and stay ahead in today's digital landscape. From concept to deployment, Prosigns is your trusted partner for transforming ideas into reality and unlocking the full potential of your business.
Join us on a journey of innovation and growth. Let's partner for success with Prosigns.
We describe the deployment and use of Globus Compute for remote computation. This content is aimed at researchers who wish to compute on remote resources using a unified programming interface, as well as system administrators who will deploy and operate Globus Compute services on their research computing infrastructure.
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...Shahin Sheidaei
Games are powerful teaching tools, fostering hands-on engagement and fun. But they require careful consideration to succeed. Join me to explore factors in running and selecting games, ensuring they serve as effective teaching tools. Learn to maintain focus on learning objectives while playing, and how to measure the ROI of gaming in education. Discover strategies for pitching gaming to leadership. This session offers insights, tips, and examples for coaches, team leads, and enterprise leaders seeking to teach from simple to complex concepts.
Navigating the Metaverse: A Journey into Virtual Evolution"Donna Lenk
Join us for an exploration of the Metaverse's evolution, where innovation meets imagination. Discover new dimensions of virtual events, engage with thought-provoking discussions, and witness the transformative power of digital realms."
Navigating the Metaverse: A Journey into Virtual Evolution"
Substitutability
1. FROM MECHANISM TO METHOD
Substitutability
IF I WERE TO SAY that C++ is a language with a large number
of features, it is unlikely that I would be in much danger of
igniting a flame war. Where fact gives way to opinion—and
sometimes to the holiest and most heated of wars—is in the
recommendation of how to work with these features. What is their
purpose? What concepts do they express? In short, what methods
give sense to the mechanisms, elevating the programmer's view
of the language from a shopping list of features to recipes that
marshal features into designs? Sure, programmers need knowledge
of syntax and semantics to make any headway with the language,
but this learning curve quickly levels out to a plateau with the sheer
face of design rising above it.
Idioms offer a steady and complementary companion route—
patterns that capture an understanding of problem and solution
married together at the level of the language.1,2 Idioms establish
a vocabulary for communicating and formulating design, where
"design is the activity of aligning the structure of the application
analysis with the available structures of the solution domain."3
On the other hand, while practices based on accepted wisdom
generate comfortable habits that generally simplify day-to-day de-velopment,
this is no reason to be complacent. Occasionally re-visiting
old maxims can reveal other useful insights that were
hiding in the shadows.4
IS-A IS NOT ENOUGH Attractive as the idea first seems, the Eng-lish
language does not offer consistently useful guidance for the
analysis of problems and the statement of software structure.
Excitement about nouns as objects and verbs as methods often
wears off when the nouning of verbs and verbing of nouns is rec-ognized
as common usage.
So it is with the common good practice recommendation
guiding the use of public inheritance: that it should model an is-a
relationship rather than ad hoc code reuse. For example, a save
dialog is a dialog box and a list is a sequence, whereas a bounded
list is not an unbounded list and vice versa. The view is that
reuse-(over)driven approaches lead to the kind of spaghetti in-heritance
hierarchies that give inheritance a bad name, and the
is-a approach constrains inheritance hierarchies to more closely
model expected classifications.
Kevlin Henney is an
independent con-sultant
and trainer
based in the UK. He
may be contacted at
kevlin@curbralan.com.
However, like all analogies, it has a breaking point beyond
which rhyme and reason denatures to protracted theological de-bate
around the coffee machine. For instance, Rex is a dog, and
although his owner might regard him in a class of his own, it is
more likely that developers would view this as an instance-of re-lationship.
Preferring is-a-kind-of to is-a steers us clear of many
of the vagaries of natural language, but not so clear that it clari-fies
how state models are inherited or how a virtual function
should be overridden. For example, can a function that in the base
class is guaranteed to accommodate null pointer arguments and
never return a null pointer be sensibly overridden to accept only
non-null arguments and return null pointers? The linguistic view
does not provide a useful map through such territory.
Liskov Substitution Principle The Liskov Substitution Principle
(LSP)1,5 is often cited as giving more detailed guidance on the use
of inheritance. It makes a clear separation between type—
described in terms of the behavior of operations—and class—the
realization of the behavior in programmatic detail. LSP then es-tablishes
the criteria for subtyping relationships in terms of con-formant
behavior5:
A type hierarchy is composed of subtypes and supertypes.
The intuitive idea of a subtype is one whose objects provide
all the behavior of objects of another type (the supertype) plus
something extra. What is wanted here is something like the
following substitution property: If for each object o1 of type S
there is an object o2 of type T such that for all programs P de-fined
in terms of T, the behavior of P is unchanged when o1
is substituted for o2, then S is a subtype of T.
So, in answer to the previous question: No, a function cannot sen-sibly
be overridden to strengthen the requirements on its arguments
and weaken the requirements on its return type. This same rec-ommendation
can be found echoed in Design by Contract.6
Polymorphic Polymorphism LSP is normally presented as an in-heritance
guideline, but taking a step back we can see that it need
not be so narrow: It is a relationship about types, not implemen-
28 May 2000
2. 29
tations—i.e., subtyping, not subclassing. LSP relies on polymor-phism;
the concept of structural relationships, such as public in-heritance,
need not enter into it.
C++ developers have “inherited” from other OO languages
and literature the notion that polymorphism concerns only in-heritance
and virtual functions. Deserving of its name, polymor-phism
manifests itself in many forms (see Table 1). This
classification7 gives us a broader and more liberated view of type
relationships. Constraining C++ solely to OO usage ignores its
other strengths and denies its multiparadigm nature.
TYPES OF SUBSTITUTABILITY Substitutability is the property that
different elements have if they are grouped—and then treated—
in terms of their commonality; variations that are not relevant to
their use are not a part of this abstraction, or rather they do not
dominate.3 Building on the previous discussion allows us to think
outside the box, giving a broader view of substitutability grounded
in C++'s mechanisms (see Table 2).
The substitutability types are neither perfect peers nor perfectly
hierarchical; they overlap and build on each other. Nonetheless
they offer a useful way to understand and reason about features.
There is a close correspondence between these substitutability types
and the polymorphism categories described in Table 1.
Conversions Conversions may be implicit or explicit, which places
them under the control of the compiler or developer, respec-tively.
Whether a conversion should be implicit or explicit is a mat-ter
of taste, safety, and requirement. Widening conversions—from
a specific to a general type—are always safe and can be implicit
without offending sensibilities or the compiler, e.g., int to double
or derived to base. Narrowing conversions—from a general to a
specific type—are not guaranteed to be safe and should be explicit.
One would hope that narrowing conversions would be re-quired
to be explicit, but this is not always the case, e.g., double to
int. Even though the compiler does not require it, one might ar-gue
that taste does. Where possible, narrowing conversions should
be checked, e.g., the use of dynamic_cast to go from base to derived.
Developers need to consider the interoperability of new and
existing types. Particularly for value types—i.e., for fine-grained
objects such as strings, which express quantities, rather than
persistent or strongly behavioral objects—the use of conver-sions
to and from other types makes more sense than the use of
inheritance relationships.
A single argument constructor is also, by default, a converting
constructor. Where a type may be safely, sensibly, and easily used
in place of another type, an implicit conversion into that type ei-ther
by a converting constructor or a user-defined conversion
(UDC) operator may be justified, e.g., use of const char * in many
places that a string may be used:
class string
{
public:
string(const char *);
...
};
class file
{
public:
explicit file(const string &);
...
};
...
const char *const log_name = getenv(“LOGFILENAME”);
file log(log_name ? log_name : “default.log”);
Otherwise—and this applies especially to UDCs—single argu-ment
constructors should be declared explicit and UDCs left un-written,
e.g., a string may not be sensibly used in most of the
places a file object is expected, nor may a string always be used safely
where a const char * is expected:
class string
{
public:
...
operator const char *( ) const; // questionable
...
};
string operator+(const string &, const string &);
...
const string log_suffix = “.log”;
const char *const log_name = getenv(“LOGBASENAME”) + log_suffix;
file log(log_name);
Overloading Overloading is based on the idea that a common
name implies a common purpose, which frees programmers from
indulging in their own name-mangling to differentiate similar
functions (this is the job of the compiler). Overloading works
C++ Report ∫ http://www.creport.com
Table 2. Different kinds of substitutability in C++.
Substitutability Mechanisms
Conversions Implicit and explicit conversions
Overloading Overloaded functions and operators,
often in combination with conversions
Derivation Inheritance
Mutability Qualification (typically const) and the
use of conversions, overloading, and derivation
Genericity Templates and the use of conversions,
overloading, derivation, and mutability
Table 1. Different kinds of polymorphism.
Polymorphism Description
Inclusion Conventional OO model of polymorphism,
i.e., virtual functions
Parametric Based on provision or deduction of extra type
information that determines the types used in
a function, i.e., templates
Overloading Based on the use of the same name denoting
different functions, with selection based on the
context of use, i.e., argument number and type
Coercion Based on the conversion of an object of one
type to an object of another type based on its
context of use
3. FROM MECHANISM TO METHOD
closely with—and sometimes against—conversions. Developers
are cautioned to keep any eye open for any such interference.
30
Operators provide a predefined set of names and definitions, and
therefore expectations: Overloading operator-> suggests the smart
pointer idiom, and overloading operator( ) suggests the function ob-ject
idiom. Although compilers do not run through code checking it
for stylistic content (e.g., use of meaningful variable names, sensible
use of overloading, and conformant use of inheritance) these con-ventions
derive from the language itself to establish a common frame
for working with the language “when in doubt, do as the ints do.”8
Extension through overloading forms an important part of oper-ator
overloading–based substitutability. For instance, a class that is oth-erwise
closed to change can apparently be extended to work within a
framework, e.g., “extending” iostreams to understand new types.
Some extension is less transparent, but it is important that it
follow as much of the base form as possible. An obvious example
is the use of placement new operators, which, in spite of taking
additional arguments, have the same purpose and much of the
same form as the vanilla new. Tagged overloads, such as
new(std::nothrow), provide a means of compile-time selection that
is a compromise between operators and named functions.
Derivation Substitutability with respect to derivation is perhaps
the most familiar category for programmers coming to C++ with
a conventional OO angle. A public class interface establishes a be-havioral
contract that the user relies on; derivation through pub-lic
inheritance tells the compiler that the types are interchangeable,
which only makes sense if the derived class developer promises to
still fulfill the contract, even if it is extended in some way. Drop-ping
LSP can lead to surprising behavior.
In terms of coupling, derivation is also the strongest relation-ship
one can have in a C++ system: It defines a dependency that
is strongly physical, e.g., with respect to #include, as well as one
that is strongly logical. The combined effect can lead to a tsunami-like
recompilation of a whole system, rather than a gentle ripple
effect, whenever the slightest change is made. Although C++ does
not clearly separate the concepts of subtyping and subclassing in
its inheritance mechanism, it is possible to effect this with inter-face
classes,9 i.e., abstract classes containing only pure virtual func-tions.
This offers a vehicle for substitutability independent of
representation issues. Interestingly, this means that as a mecha-nism,
inheritance may be used to either significantly increase or
significantly decrease the coupling in a system.
Mutability Mutability is concerned with the effects of change. For
objects in C++ this means qualification: const and volatile. ...Well,
const if we are being really honest with ourselves. From this per-spective
every class has two public interfaces: the interface for
const qualified objects and the interface for non-const qualified
objects. The const interface is effectively a subset of the non-const
interface, and therefore a non-const object may be used wherever
a const one is expected; i.e., the qualified interface may be con-sidered
a supertype of the unqualified one. Note that the subtyp-ing
relationship need not be strict: Overloaded functions differing
only in const or non-const will be selected according to the call-ing
const-ness. In OO terms this can be considered a form of
compile-time overriding of the const function by the non-const
variant, typically to return something more specific:
class string
{
public:
char operator[](size_t) const;
char &operator[](size_t); // 'overrides' const version
...
};
...
const string read_only = ...;
cout << read_only[0];
string read_write = ...;
cin >> read_write[0];
cout << read_write[0];
Genericity Templates offer a route to substitutability that grows
out of the basic concept of overloading. A templated function can
be considered to have a potentially infinite number of overloads
all sharing a common name, purpose, and structure, but differ-ing
in their parameter types. A similar view can be extended to
template classes, and from there, to member templates.
Generic programming, as typified by the part of the standard
library derived from the STL, is based on the compile-time poly-morphism
of C++ templates, as well as the concepts and mecha-nisms
of the other substitutability categories.
CONCLUSION Substitutability provides a useful way to structure
a system's meaning. It can be recognized as reaching further than
a commonplace recommendation for inheritance, drawing to-gether
many C++ features in a set of practices that make sense of
mechanism.
Future columns will explore the different types of substi-tutability
in greater detail, looking at language features and their
use in idioms, and highlighting the practices that commonly (or
uncommonly) appear in application and library code. ˘
References
1. Coplien, J. Advanced C++: Programming Styles and Idioms,
Addison–Wesley, Reading, MA, 1992.
2. Coplien, J. Software Patterns, SIGS, New York, 1996.
3. Coplien, J. Multi-Paradigm Design for C++, Addison–Wesley,
Reading, MA, 1999.
4. Henney, K. “Creating Stable Assignments,” C++ Report, 10(6):
25–30, June 1998.
5. Liskov, B. “Data Abstraction and Hierarchy,” OOPSLA '87
Addendum to the Proceedings, Oct. 1987.
6. Meyer, B. Object-Oriented Software Construction, 2nd ed.,
Prentice–Hall, Englewood Cliffs, NJ, 1997.
7. Cardelli, L. and P. Wegner. “On Understanding Types, Data
Abstraction, and Polymorphism,” Computing Surveys, 17(4):
471–522, Dec. 1985.
8. Meyers, S. More Effective C++: 35 New Ways to Improve Your
Programs and Designs, Addison–Wesley, Reading, MA, 1996.
9. Carroll, M. D. and M. A. Ellis. Designing and Coding Reusable
C++, Addison–Wesley, Reading, MA, 1995.
May 2000