The presentation starts with some basic theory on types. Later, different classifications for type systems are described, with the static/dynamic and strong/weak dimensions the ones we spend more time on.
The third topic addressed is how the mix of polimorsfism with covariance and descendant hiding affects the type system, and what new problems arise and have to be addressed by the type system.
We finished the presentation with a discussion about pros and cons of the PHP type system.
For More :
https://www.facebook.com/Computer-Programming-Assignments-826290177441561/
-
https://www.facebook.com/A-Tech-and-Software-Development-1683037138630673/
Static typing vs dynamic typing languagesJawad Khan
Scripting languages take lesser time as compared to compiler based languages. Static and Dynamic assignment of memory, on the other hand saves memory besides posing run-time errors. The static variables are thus useful for fast execution and dynamic typing is useful for redefinition of variables. This presentation is all about static typing and dynamic typing and differentiate between compilers that require less computation power at start.
For More :
https://www.facebook.com/Computer-Programming-Assignments-826290177441561/
-
https://www.facebook.com/A-Tech-and-Software-Development-1683037138630673/
Static typing vs dynamic typing languagesJawad Khan
Scripting languages take lesser time as compared to compiler based languages. Static and Dynamic assignment of memory, on the other hand saves memory besides posing run-time errors. The static variables are thus useful for fast execution and dynamic typing is useful for redefinition of variables. This presentation is all about static typing and dynamic typing and differentiate between compilers that require less computation power at start.
These slides show you how to use each major Dart feature, from variables and operators to classes and libraries, with the assumption that you already know, how to program in another language.
To learn more about Dart’s core libraries, see A Tour of the Dart Libraries. Whenever you want more details about a language feature, consult the Dart Language Specification.
Tip: You can play with most of Dart’s language features using DartPad (learn more). Open DartPad at https://dartpad.dartlang.org/
What comes to your mind when you hear the word "type"? Do you think of an integer or string? Do you think of an object type from your favorite OOP language? Do you think about never ending religious debates regarding static vs dynamic types? Do you realize that these things hardly scratch the surface of what it means to be a "type"? Be prepared to understand types on a whole new level.
In this talk, we will explore type systems. What is a type system? Why are type systems important? How have type systems been influenced by functional programming, category theory, and type theory?
We will talk about variance, polymorphisms, higher-kinded types, existential types, algebraic data types, and type classes. We will scratch the surface of type theory and learn how logic systems have influenced programming language design.
This talk will be approachable to a wide audience and previous knowledge of type theory is not needed.
At Tuenti, we do two code pushes per week, sometimes modifying thousands of files and running thousands of automated tests and build operations before, to ensure not only that the code works but also that proper localization is applied, bundles are generated and files get deployed to hundreds of servers as fast and reliable as possible.
We use opensource tools like Mercurial, MySQL, Jenkins, Selenium, PHPUnit and Rsync among our own in-house ones, and have different development, testing, staging and production environments.
We had to fight with problems like statics bundling and versioning, syntax errors and of course the fact that we have +100 engineers working on the codebase, sometimes merging and releasing more than a dozen branches the same day. We also switched from Subversion to Mercurial to obtain more flexibility and faster branching operations.
With this talk we will explain the process of how code changes in ourcode repository end up in live code, detailing some practices and tips that we apply.
These slides show you how to use each major Dart feature, from variables and operators to classes and libraries, with the assumption that you already know, how to program in another language.
To learn more about Dart’s core libraries, see A Tour of the Dart Libraries. Whenever you want more details about a language feature, consult the Dart Language Specification.
Tip: You can play with most of Dart’s language features using DartPad (learn more). Open DartPad at https://dartpad.dartlang.org/
What comes to your mind when you hear the word "type"? Do you think of an integer or string? Do you think of an object type from your favorite OOP language? Do you think about never ending religious debates regarding static vs dynamic types? Do you realize that these things hardly scratch the surface of what it means to be a "type"? Be prepared to understand types on a whole new level.
In this talk, we will explore type systems. What is a type system? Why are type systems important? How have type systems been influenced by functional programming, category theory, and type theory?
We will talk about variance, polymorphisms, higher-kinded types, existential types, algebraic data types, and type classes. We will scratch the surface of type theory and learn how logic systems have influenced programming language design.
This talk will be approachable to a wide audience and previous knowledge of type theory is not needed.
At Tuenti, we do two code pushes per week, sometimes modifying thousands of files and running thousands of automated tests and build operations before, to ensure not only that the code works but also that proper localization is applied, bundles are generated and files get deployed to hundreds of servers as fast and reliable as possible.
We use opensource tools like Mercurial, MySQL, Jenkins, Selenium, PHPUnit and Rsync among our own in-house ones, and have different development, testing, staging and production environments.
We had to fight with problems like statics bundling and versioning, syntax errors and of course the fact that we have +100 engineers working on the codebase, sometimes merging and releasing more than a dozen branches the same day. We also switched from Subversion to Mercurial to obtain more flexibility and faster branching operations.
With this talk we will explain the process of how code changes in ourcode repository end up in live code, detailing some practices and tips that we apply.
Tuenti is an always growing web application, constantly adding services and applications, with two or more releases per week, a lot of branches per release, 100+ engineers hacking code and keeping hundreds of servers running. Dealing with security in such an environment is a tough challenge from different perspectives.
On this talk we will explain how we keep security levels high, the most common attacks and good practices that might help you make your web applications safer. Also, some insight in how security is understood across the whole company (legal, user support, engineering) will be given, as it is crucial for us to have top knotch incident response.
At Tuenti, we do 3 code pushes per week, sometimes modifying thousands of files and running thousands of automated tests and build operations before, to ensure not only that the code works but also that proper localization is applied, bundles are generated and files get deployed to hundreds of servers as fast and reliable as possible.
We use opensource tools like Mercurial, MySQL, Jenkins, Selenium, PHPUnit and Rsync among our own in-house ones, and have different development, testing, staging and production environments.
We had to fight with problems like statics bundling and versioning, syntax errors and of course the fact that we have +100 engineers working on the codebase, merging and releasing more than a 15 branches the same day. We also switched from Subversion to Mercurial to obtain more flexibility and faster branching operations.
With this talk we will explain the process of how code changes in ourcode repository end up in live code, detailing some practices and tips that we apply, problems we had and how we solved them.
Milano JS Meetup - Gabriele Petronella - Codemotion Milan 2016Codemotion
TypeError: “x" is not a function. Quale sviluppatore JavaScript non ha mai incontrato questo errore, magari su un sito in produzione? Non sarebbe invece fantastico intercettare questi errori durante lo sviluppo? In questo talk presenteremo Flow, uno static typechecker per javascript che ci può aiutare a scrivere codice più affidabile e sicuro. Il talk conterrà esempi concreti e demo. ATTENZIONE: può causare forti sbalzi di JavaScript fatigue!
Understanding Typing. Understanding Ruby.Justin Lin
- What is typing?
- Pros and cons of type declarations.
- What does quacking like a dock mean?
- Static Typing vs Unit Testing.
- Making us better at Ruby.
你可以在以下鏈結找到中文說明:
http://www.codedata.com.tw/social-coding/understanding-typing-understanding-ruby/
Overview of Groovy language features and lead to Functional Programming in Groovy. As this is a code along session backed by this presentation, code examples are not include here as I code them live.
Simon Peyton Jones: Managing parallelismSkills Matter
If you want to program a parallel computer, it obviously makes sense to start with a computational paradigm in which parallelism is the default (ie functional programming), rather than one in which computation is based on sequential flow of control (the imperative paradigm). And yet, and yet ... functional programmers have been singing this tune since the 1980s, but do not yet rule the world. In this talk I’ll say why I think parallelism is too complex a beast to be slain at one blow, and how we are going to be driven, willy-nilly, towards a world in which side effects are much more tightly controlled than now. I’ll sketch a whole range of ways of writing parallel program in a functional paradigm (implicit parallelism, transactional memory, data parallelism, DSLs for GPUs, distributed processes, etc, etc), illustrating with examples from the rapidly moving Haskell community, and identifying some of the challenges we need to tackle.
After the end of lesson you will be able to learn Python basics-What Python is? Its releases. Where we can use Python? Python Features. Tokens, comments variables etc... In out next PPT you will learn how to input and get output in Python
Machine Learning With Python From India’s Most Advanced Learner’s Community. 200+ High-Quality Lectures. 4 Months Live Mentor-ship. 15+ Projects. Industry Insights.
Visit- https://insideaiml.com/course-details/Machine-Learning-with-Python-Statistics
This presentation explores the benefits of functional programming, especially with respect to reliability. It presents a sample of types that allow many program invariants to be enforced by compilers. We also discuss the industrial adoption of functional programming, and conclude with a live coding demo in Scala.
Douglas Crockford - Programming Style and Your BrainWeb Directions
Computer programs are the most complicated things that humans make. They must be perfect, which is hard for us because humans are not perfect. Programming is thought to be a “head” activity, but there is a lot of “gut” involved. Indeed, it may be the gut that gives us the insight necessary for solving hard problems. But gut messes us up when it come to matters of style. The systems in our brains that make us vulnerable to advertising and propaganda also influence our programming styles. This talk looks systematically at the development of a programming style that specifically improves the reliability of programs. The examples are given in JavaScript, a language with an uncommonly large number of bad parts, but the principles are applicable to all programming languages.
Erik Schultink's closing keynote at FICOD 2011. He discusses the history of Tuenti, lessons learned along the way, our view of opportunity in the Mobile Web ecosystem today, and the vision of TU addressing that opportunity.
Tuenti Mobile by Davide Mendolia
Mobile devices are becoming one of the most used platform to connect to Internet, In Tuenti we are putting a focus on mobile platforms through applications and mobile web, discover how we are building m.tuenti.com.
Use of a palette of technologies like mobile device detection and capabilities on the server and the client side that help us to server different version as Plain HTML or HTML5.
How we try to bring the best user experience to every device adapting the possibles interactions based on the features or limitations of each them.
GraphRAG is All You need? LLM & Knowledge GraphGuy Korland
Guy Korland, CEO and Co-founder of FalkorDB, will review two articles on the integration of language models with knowledge graphs.
1. Unifying Large Language Models and Knowledge Graphs: A Roadmap.
https://arxiv.org/abs/2306.08302
2. Microsoft Research's GraphRAG paper and a review paper on various uses of knowledge graphs:
https://www.microsoft.com/en-us/research/blog/graphrag-unlocking-llm-discovery-on-narrative-private-data/
Neuro-symbolic is not enough, we need neuro-*semantic*Frank van Harmelen
Neuro-symbolic (NeSy) AI is on the rise. However, simply machine learning on just any symbolic structure is not sufficient to really harvest the gains of NeSy. These will only be gained when the symbolic structures have an actual semantics. I give an operational definition of semantics as “predictable inference”.
All of this illustrated with link prediction over knowledge graphs, but the argument is general.
JMeter webinar - integration with InfluxDB and GrafanaRTTS
Watch this recorded webinar about real-time monitoring of application performance. See how to integrate Apache JMeter, the open-source leader in performance testing, with InfluxDB, the open-source time-series database, and Grafana, the open-source analytics and visualization application.
In this webinar, we will review the benefits of leveraging InfluxDB and Grafana when executing load tests and demonstrate how these tools are used to visualize performance metrics.
Length: 30 minutes
Session Overview
-------------------------------------------
During this webinar, we will cover the following topics while demonstrating the integrations of JMeter, InfluxDB and Grafana:
- What out-of-the-box solutions are available for real-time monitoring JMeter tests?
- What are the benefits of integrating InfluxDB and Grafana into the load testing stack?
- Which features are provided by Grafana?
- Demonstration of InfluxDB and Grafana using a practice web application
To view the webinar recording, go to:
https://www.rttsweb.com/jmeter-integration-webinar
State of ICS and IoT Cyber Threat Landscape Report 2024 previewPrayukth K V
The IoT and OT threat landscape report has been prepared by the Threat Research Team at Sectrio using data from Sectrio, cyber threat intelligence farming facilities spread across over 85 cities around the world. In addition, Sectrio also runs AI-based advanced threat and payload engagement facilities that serve as sinks to attract and engage sophisticated threat actors, and newer malware including new variants and latent threats that are at an earlier stage of development.
The latest edition of the OT/ICS and IoT security Threat Landscape Report 2024 also covers:
State of global ICS asset and network exposure
Sectoral targets and attacks as well as the cost of ransom
Global APT activity, AI usage, actor and tactic profiles, and implications
Rise in volumes of AI-powered cyberattacks
Major cyber events in 2024
Malware and malicious payload trends
Cyberattack types and targets
Vulnerability exploit attempts on CVEs
Attacks on counties – USA
Expansion of bot farms – how, where, and why
In-depth analysis of the cyber threat landscape across North America, South America, Europe, APAC, and the Middle East
Why are attacks on smart factories rising?
Cyber risk predictions
Axis of attacks – Europe
Systemic attacks in the Middle East
Download the full report from here:
https://sectrio.com/resources/ot-threat-landscape-reports/sectrio-releases-ot-ics-and-iot-security-threat-landscape-report-2024/
Epistemic Interaction - tuning interfaces to provide information for AI supportAlan Dix
Paper presented at SYNERGY workshop at AVI 2024, Genoa, Italy. 3rd June 2024
https://alandix.com/academic/papers/synergy2024-epistemic/
As machine learning integrates deeper into human-computer interactions, the concept of epistemic interaction emerges, aiming to refine these interactions to enhance system adaptability. This approach encourages minor, intentional adjustments in user behaviour to enrich the data available for system learning. This paper introduces epistemic interaction within the context of human-system communication, illustrating how deliberate interaction design can improve system understanding and adaptation. Through concrete examples, we demonstrate the potential of epistemic interaction to significantly advance human-computer interaction by leveraging intuitive human communication strategies to inform system design and functionality, offering a novel pathway for enriching user-system engagements.
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Jeffrey Haguewood
Sidekick Solutions uses Bonterra Impact Management (fka Social Solutions Apricot) and automation solutions to integrate data for business workflows.
We believe integration and automation are essential to user experience and the promise of efficient work through technology. Automation is the critical ingredient to realizing that full vision. We develop integration products and services for Bonterra Case Management software to support the deployment of automations for a variety of use cases.
This video focuses on the notifications, alerts, and approval requests using Slack for Bonterra Impact Management. The solutions covered in this webinar can also be deployed for Microsoft Teams.
Interested in deploying notification automations for Bonterra Impact Management? Contact us at sales@sidekicksolutionsllc.com to discuss next steps.
DevOps and Testing slides at DASA ConnectKari Kakkonen
My and Rik Marselis slides at 30.5.2024 DASA Connect conference. We discuss about what is testing, then what is agile testing and finally what is Testing in DevOps. Finally we had lovely workshop with the participants trying to find out different ways to think about quality and testing in different parts of the DevOps infinity loop.
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf91mobiles
91mobiles recently conducted a Smart TV Buyer Insights Survey in which we asked over 3,000 respondents about the TV they own, aspects they look at on a new TV, and their TV buying preferences.
Securing your Kubernetes cluster_ a step-by-step guide to success !KatiaHIMEUR1
Today, after several years of existence, an extremely active community and an ultra-dynamic ecosystem, Kubernetes has established itself as the de facto standard in container orchestration. Thanks to a wide range of managed services, it has never been so easy to set up a ready-to-use Kubernetes cluster.
However, this ease of use means that the subject of security in Kubernetes is often left for later, or even neglected. This exposes companies to significant risks.
In this talk, I'll show you step-by-step how to secure your Kubernetes cluster for greater peace of mind and reliability.
UiPath Test Automation using UiPath Test Suite series, part 4DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 4. In this session, we will cover Test Manager overview along with SAP heatmap.
The UiPath Test Manager overview with SAP heatmap webinar offers a concise yet comprehensive exploration of the role of a Test Manager within SAP environments, coupled with the utilization of heatmaps for effective testing strategies.
Participants will gain insights into the responsibilities, challenges, and best practices associated with test management in SAP projects. Additionally, the webinar delves into the significance of heatmaps as a visual aid for identifying testing priorities, areas of risk, and resource allocation within SAP landscapes. Through this session, attendees can expect to enhance their understanding of test management principles while learning practical approaches to optimize testing processes in SAP environments using heatmap visualization techniques
What will you get from this session?
1. Insights into SAP testing best practices
2. Heatmap utilization for testing
3. Optimization of testing processes
4. Demo
Topics covered:
Execution from the test manager
Orchestrator execution result
Defect reporting
SAP heatmap example with demo
Speaker:
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
2. ... definitions ...
An informal definition:
A type is metadata describing a chunk of memory that classifies
the data stored there. This classification usually implicitly specifies
what sort of operations may be performed on the data.
Common types include primitive types (as strings or numbers),
container types (as arrays), pointers or references and complex
types (as classes or interfaces).
In a pure OOL, every instance (of data) is an object.
3. ... the typing problem ...
In a OOL, the only event than can happen during the
execution of an object-oriented system:
obj.f(arg)
Type violation/failure:
no f applicable to obj
arg no acceptable argument to f
Type safety: not possible to apply invalid operations
4. ... typing rules ...
Every entity must be declared as being of a certain type.
In every assignment and in every routine the type of the source
must conform the type of the target (type conformance rule).
x := y
In a call of the form x.f(arg), f must be a feature of x(feature call
rule).
5. ... implitic type conversions ...
n: INTEGER
n := 0.0
n := 1.0
n := -3,67
n := 3.67 - 3.67
With strict typing, assigning a float value should fail.
Allowing that is ambiguous (do we want the rounded or the
truncated version?).
For implicit conversions to work in a strict typed environment
additional functions are needed (truncate, round, ...).
6. ... static and dynamic typing ...
(... another holy war ...)
Although intermediate variants are possible two main
approaches:
Dynamic typing: type verification at execution time.
Static typing: type verification performed on the text, before
execution.
A dynamically typed language has no type declarations.
'Entities' simply become associated with whatever values the
execution attaches to them.
7. ... static ...
Languages: C, C++, Java, Pascal, Ada,...
Arguments:
catching errors earlier (at compile type or interpreting time)
=> less cost in large projects
readability
efficiency and less memory consumption
Better IDE support
(In a dynamically typed program, it's easy for a human to tell
what type something is likely to be, but no way for a machine
to say for sure what type something is)
8. ... dynamic (i) ...
Languages: Smalltalk, Python, PHP, Ruby, Perl, ...
Martin Fowler:
Static typing is a premature tool to catching bugs, but if you
use TestDrivenDevelopment (as you should) you are
already catching them additionally to more types of bugs
more flow programming (it is difficult to put the experience in
words)
9. ... dynamic (ii) ...
Robert Martin:
"Too many systems crashed in the field due to silly typing
errors."
"I was depending less and less on the type system for safety.
My unit tests were preventing me from making type errors. "
"The flexibility of dynamically typed langauges makes writing
code significantly easier. Modules are easier to write, and
easier to change. There are no build time issues at all. Life in a
dynamically typed world is fundamentally simpler."
10. ... dynamic (iii) ...
Brucke Eckel (not agains static typing):
"I think that statically typed languages give the illusion of
program correctness. "
"llusion that static type checking can solve all of your problems,
followed by the conclusion that more static type checking is
always better."
"Additional forms of static type checking are often added to a
language without regard to the actual cost. "
"In extreme cases you spend all your time arguing with the
compiler."
"In general, my attitude is that static typing is desirable as long
as it doesn't cost you too much"
"With a dynamic language the model becomes the code"
11. ... dynamic (iV) ...
More quotes:
"The early warnings/errors are not the real disadvantage. The
point is more that static typechecks with existing languages
force you to structure programs to suit the particular, single
static type system that the language in question uses."
"Combined with testing, assertions, contracts, and other good
practices (including a more disciplined use of types than the
one I've just described), you can scale up from a prototype to a
more disciplined system without changing to a statically-
checked language."
12. ... binding (i)...
Don´t confuse with typing.
If we have x.f(arg)...
Typing question: When do we now for sure that at run time
there will be an operation corresponding to f and applicable to
the object attached to x (with the argument arg).
> Addresses the existance.
Binding question: Which operation will be executed by the
call?
> Addresses the choice of the right one.
14. ... strong and weak typing (i) ...
Don´t confuse static / dynamic with strong / weak.
Weak typing: Allows incorrect messages to be sent to objects
Just an example of what you could do in a weak typing
language: "1" + 1
Languages with unchecked casts (as C/C++) 'could' also be
considered weak.
Examples of dynamic languages:
weak: php and perl
strong: python and ruby
15. ... strong and weak typing (ii)...
WeakTyping / StrongTyping / StronglyTypedWithoutLoopholes.
There are well known errors with numeric castings.
C has the problem of the unconditional type cast.
C++ introduced new casts but maintained the old one and the
unsafe new static cast (dynamic cast is safe)
Java, provides static type checking and its runtime cast
checking sharply limits the consequences of a bad cast.
Dynamic languages work like java (withouth static typing)
16. ... more definitions (i) ...
Typing dimensions:
is there a nontrivial type associated with each declaration?
StaticTyping: yes
DynamicTyping: no
SoftTyping: optional
if there is, are these types declared explicitly in the source code?
ManifestTyping: yes
TypeInference: optional
does the possibility of a type failure cause a compile-time error?
StaticTyping: yes
SoftTyping or DynamicTyping: no
is the type system strictly enforced, with no loopholes or unsafe
casts?
StronglyTypedWithoutLoopholes: yes
WeakTyping: no
17. ... more definitions (ii) ...
StaticTyping: Type checking before runtime.
DynamicTyping: Type checking at runtime.
StronglyTyped: All operations are checked (either statically or at run-time)
for type correctness, with the exception of only a small number of
loopholes/escapes from typesafety
StronglyTypedWithoutLoopholes: StronlyTypes but withough Loopholes.
WeaklyTyped: Type failures are possible and cause UndefinedBehavior.
ManifestTyping: Requires a type annotation to be given explicitly for each
declaration.
SoftTyping: Where the type checker can prove that the program is type
safe, everything is cool. Where the type checker can't prove correctness it
informs the programmer and inserts appropriate type checks, but doesn't
reject the program.
18. ... more definitions (iii) ...
TypeInference: Analysis of a program to infer the types of some or all
expressions (Haskell).
ImplicitTyping: Typing system which requires few or no type annotations.
DuckTyping, StructuralTyping, MockTyping (tecnique),...
Examples of flavours:
Static typing:
Manifest typing (C, C++)
Type Inference (Haskell)
Implicit typing
Dynamic
Static Type inference
Soft typing
19. ... covariance (i) ...
Covariance: change of argument types in redefinitions.
In general, covariance allows you to express more
information in the derived class interface than is true in the base class
interface. The behaviour of a derived class is more specific than that of
a base class, and covariance expresses (one aspect of) the difference.
In many strictly-typed languages (with the notable exception of Eiffel),
subclassing must allow for substitution. That is, a child class can
always stand in for a parent class. This places restrictions on the sorts
of relationships that subclassing can represent. In particular, it means
that arguments to member functions can only be contravariant and
return types can only be covariant.
20. ... covariance (ii)...
Covariance and descendant hiding can introduce errors that the
language has to resolve.
Problems arise with polymorphism.
s: SKIER; b:BOY; g:GIRL
...
!!b; !!g;
s:=b; -- Polymorphic assignment
s.share(g) -- the type of the argument of share is different in
-- each class (redeclaration)
p: POLYGON; r:RECTANGLE
...
!!r; -- creation
p := r -- polymorphic assignment
p.add_vertex(...) -- ¿accepted in the rectangle? (defined
-- in the father and hidden in the child)
21. ... covariance in c++...
class A {
virtual ~A();
virtual A * f();
...
};
class CovB : public A {
virtual CovB * f();
...
};
class NonCovB : public A {
virtual A * f();
...
};
Also the templates are a covariance mechanism.
22. ... PHP (i) ...
Our most used language is:
dynamic typed
with type hinting
$a = 1; $a = "hello";
function foo(array $arg) {
echo "$arg n";
}
foo($a);
23. ... PHP (i) ...
Our most used language is:
dynamic typed
with type hinting
Catchable fatal error: Argument 1 passed to foo2() must be an array, string
$a = 1; $a = "hello";given...
function foo(array $arg) { <---- !!!!!!!!!
hello
echo "$arg n";
}
foo($a);
24. ... PHP (ii)...
class A {
public function foo1($arg = "hola") { echo "$arg n"; }
public function foo2($arg = NULL) {
if ($arg === NULL) $arg = "hola";
echo "$arg n";
}
public function foo3($arg1) { echo "A::foo3 n";}
public function foo4(array $arg1) { echo "A::foo4 n";}
}
class B extends A {
public function foo1($arg = "hello") { parent::foo1($arg); }
public function foo2($arg = NULL) { parent::foo2($arg); }
public function foo3($arg1, $arg2) { parent::foo3($arg1); }
public function foo4($arg1, $arg2) { echo "B::foo4 n"; }
}
$b = new B();
$b->foo1(); // what is the output?
$b->foo2(); // what is the output?
$b->foo3(1,2); // changing signature allowed
$b->foo4(1);
25. ... PHP (ii)...
class A {
public function foo1($arg = "hola") { echo "$arg n"; }
public function foo2($arg = NULL) {
if ($arg === NULL) $arg = "hola";
hello
echo "$arg n"; hola
} A::foo3
public function foo3($arg1) { echo "A::foo3 n";}
public function foo4(array $arg1) { echo "A::foo4 n";}
Warning: Missing argument 2 for B::foo4(), ...
}
class B extends A { A::foo4
public function foo1($arg = "hello") { parent::foo1($arg); }
public function foo2($arg = NULL) { parent::foo2($arg); }
public function foo3($arg1, $arg2) { parent::foo3($arg1); }
public function foo4($arg1, $arg2) { echo "A::foo4 n"; }
}
$b = new B();
$b->foo1(); // what is the output?
$b->foo2(); // what is the output?
$b->foo3(1,2); // changing signature allowed
$b->foo4(1);
26. ... PHP (iii)...
class A {
// public function foo1() { echo "A::foo1 n";}
private function foo2() { echo "A::foo2 n";}
}
class B extends A {
// Fatal error: Access level to B::foo1()
// must be public (as in class A)
// private function foo1() { echo "B::foo2 n"; }
public function foo2() { echo "B::foo2 n"; }
}
$b = new B();
// $b->foo1();
$b->foo2();
27. ... PHP (iii)...
class A {
// public function foo1() { echo "A::foo1 n";}
private function foo2() { echo "A::foo2 n";}
} B::foo2
class B extends A {
// Fatal error: Access level to B::foo1()
// must be public (as in class A)
// private function foo1() { echo "B::foo2 n"; }
public function foo2() { echo "B::foo2 n"; }
}
$b = new B();
// $b->foo1();
$b->foo2();
28. ... references and links ...
OOSC2nd
Typing: Strong vs. Weak, Static vs. Dynamic
A "fair and balanced" look at the static vs. dynamic typing
schism
Brucke Eckel - 11-16-04 Static vs. Dynamic
Weighing into the static vs dynamic typing debate
Category Language typing
Covariance in C++
Covariance (wikipedia)
Type system (wikipedia)