This document discusses exception handling in C++. It begins by explaining that errors are inevitable and traditional error handling obscures normal logic. It then introduces exceptions as a way to separate normal and exceptional control flow in C++. Exceptions respect code modularity but can cause problems if code is not exception-safe. The document advocates using resource management objects that ensure cleanup of resources like memory even if an exception occurs. This approach avoids problems with try-catch blocks and does not require language features like finally.
Having checked ReactOS's code I managed to fulfill three of my wishes at once. Firstly, I had wanted for a long time to write an article on a common project. It's not interesting to check the source code of projects like Chromium: its quality is too high and a lot of resources are spent to maintain it, which are unavailable to common projects. Secondly, it's a good example to demonstrate the necessity of static analysis in a large project, especially when it is developed by a diverse and distributed team. Thirdly, I've got a confirmation that PVS-Studio is becoming even better and more useful.
This presentation introduces some advanced concepts of generics in Java. These slides introduce the following concepts:
- Generic classes and methods
- Type variable bounds
- Type erasure process
- Generics and inheritance
- Wildcard types
The presentation is took from the Java course I run in the bachelor-level informatics curriculum at the University of Padova.
In this article, we will speak about the static analysis of the doxygen documentation generator tool. This popular and widely used project, which, as its authors claim, not without reason, has become "the de facto standard tool for generating documentation from annotated C++ sources", has never been scanned by PVS-Studio before. Doxygen scans the program source code and generates the documentation relying on it. Now it's time for us to peep into its source files and see if PVS-Studio can find any interesting bugs there.
Java Exception Handling, Assertions and LoggingRiccardo Cardin
This presentation introduces the java exception handling mechanisms. In detail, the main focus of the slides is to show how the language implements its exception handling polices, such as:
- Checked and uncheked exception
- Try / catch blocks
- Assertions
- Logging
The presentation is took from the Java course I run in the bachelor-level informatics curriculum at the University of Padova.
How to find 56 potential vulnerabilities in FreeBSD code in one eveningPVS-Studio
It's high time to recheck FreeBSD project and to show that even in such serious and qualitative projects PVS-Studio easily finds errors. This time I decided to take a look at the analysis process in terms of detecting potential vulnerabilities. PVS-Studio has always been able to identify defects that could potentially be used for a hacker attack. However, we haven't focused on this aspect of the analyzer and described the errors as typos, consequences of sloppy Copy-Paste and so on, but have never classified them according to CWE, for example. Nowadays it is very popular to speak about security and vulnerabilities that's why I will try to broaden at the perception of our analyzer. PVS-Studio helps not only to search for bugs, but it is also a tool that improves the code security.
Having checked ReactOS's code I managed to fulfill three of my wishes at once. Firstly, I had wanted for a long time to write an article on a common project. It's not interesting to check the source code of projects like Chromium: its quality is too high and a lot of resources are spent to maintain it, which are unavailable to common projects. Secondly, it's a good example to demonstrate the necessity of static analysis in a large project, especially when it is developed by a diverse and distributed team. Thirdly, I've got a confirmation that PVS-Studio is becoming even better and more useful.
This presentation introduces some advanced concepts of generics in Java. These slides introduce the following concepts:
- Generic classes and methods
- Type variable bounds
- Type erasure process
- Generics and inheritance
- Wildcard types
The presentation is took from the Java course I run in the bachelor-level informatics curriculum at the University of Padova.
In this article, we will speak about the static analysis of the doxygen documentation generator tool. This popular and widely used project, which, as its authors claim, not without reason, has become "the de facto standard tool for generating documentation from annotated C++ sources", has never been scanned by PVS-Studio before. Doxygen scans the program source code and generates the documentation relying on it. Now it's time for us to peep into its source files and see if PVS-Studio can find any interesting bugs there.
Java Exception Handling, Assertions and LoggingRiccardo Cardin
This presentation introduces the java exception handling mechanisms. In detail, the main focus of the slides is to show how the language implements its exception handling polices, such as:
- Checked and uncheked exception
- Try / catch blocks
- Assertions
- Logging
The presentation is took from the Java course I run in the bachelor-level informatics curriculum at the University of Padova.
How to find 56 potential vulnerabilities in FreeBSD code in one eveningPVS-Studio
It's high time to recheck FreeBSD project and to show that even in such serious and qualitative projects PVS-Studio easily finds errors. This time I decided to take a look at the analysis process in terms of detecting potential vulnerabilities. PVS-Studio has always been able to identify defects that could potentially be used for a hacker attack. However, we haven't focused on this aspect of the analyzer and described the errors as typos, consequences of sloppy Copy-Paste and so on, but have never classified them according to CWE, for example. Nowadays it is very popular to speak about security and vulnerabilities that's why I will try to broaden at the perception of our analyzer. PVS-Studio helps not only to search for bugs, but it is also a tool that improves the code security.
Having checked ReactOS's code I managed to fulfill three of my wishes at once. Firstly, I had wanted for a long time to write an article on a common project. It's not interesting to check the source code of projects like Chromium: its quality is too high and a lot of resources are spent to maintain it, which are unavailable to common projects. Secondly, it's a good example to demonstrate the necessity of static analysis in a large project, especially when it is developed by a diverse and distributed team. Thirdly, I've got a confirmation that PVS-Studio is becoming even better and more useful.
Let's turn the table. Suppose your goal is to deliberately create buggy programs in C and C++ with serious security vulnerabilities that can be "easily" exploited. Then you need to know about things like stack smashing, shellcode, arc injection, return-oriented programming. You also need to know about annoying protection mechanisms such as address space layout randomization, stack canaries, data execution prevention, and more. These slides will teach you the basics of how to deliberately write insecure programs in C and C++.
A PDF version of the slides can be downloaded from my homepage: http://olvemaudal.com/talks
Here is a video recording of me presenting these slides at NDC 2014: http://vimeo.com/channels/ndc2014/97505677
Enjoy!
Programming is hard. Programming correct C and C++ is particularly hard. Indeed, both in C and certainly in C++, it is uncommon to see a screenful containing only well defined and conforming code.Why do professional programmers write code like this? Because most programmers do not have a deep understanding of the language they are using.While they sometimes know that certain things are undefined or unspecified, they often do not know why it is so. In these slides we will study small code snippets in C and C++, and use them to discuss the fundamental building blocks, limitations and underlying design philosophies of these wonderful but dangerous programming languages.
This content has a CC license. Feel free to use it for whatever you want. You may download the original PDF file from: http://www.pvv.org/~oma/DeepC_slides_oct2012.pdf
A Logic Meta-Programming Foundation for Example-Driven Pattern Detection in O...Coen De Roover
Presentation at the Postdoctoral symposium of the 2011 International Conference on Software Maintenance, accompanying the paper
http://soft.vub.ac.be/Publications/2011/vub-soft-tr-11-11.pdf
This presentation introduces some advanced concepts of threads, as implemented in the Java platform. It is part of a series of slides dedicated to threads. This slides introduces the following concepts:
- Callable
- Futures
- Executors and executor services
- Deadlocks (brief introduction)
The presentation is took from the Java course I run in the bachelor-level informatics curriculum at the University of Padova.
Unit testing with PHPUnit - there's life outside of TDDPaweł Michalik
Basics of PHPUnit and why is it even more relevant in legacy code. Key points of the framework are explained, along with mocking objects, test organisation, creating documentations with tests and accessing non-public objects (where applicable).
Live version with additional notes available at: http://pawelmichalik.net/presentations/unit-testing-with-phpunit?showNotes=true
Prezentacja dostępna także w języku polskim: http://pawelmichalik.net/prezentacje/testy-jednostkowe-w-phpunit?showNotes=true
Having checked ReactOS's code I managed to fulfill three of my wishes at once. Firstly, I had wanted for a long time to write an article on a common project. It's not interesting to check the source code of projects like Chromium: its quality is too high and a lot of resources are spent to maintain it, which are unavailable to common projects. Secondly, it's a good example to demonstrate the necessity of static analysis in a large project, especially when it is developed by a diverse and distributed team. Thirdly, I've got a confirmation that PVS-Studio is becoming even better and more useful.
Let's turn the table. Suppose your goal is to deliberately create buggy programs in C and C++ with serious security vulnerabilities that can be "easily" exploited. Then you need to know about things like stack smashing, shellcode, arc injection, return-oriented programming. You also need to know about annoying protection mechanisms such as address space layout randomization, stack canaries, data execution prevention, and more. These slides will teach you the basics of how to deliberately write insecure programs in C and C++.
A PDF version of the slides can be downloaded from my homepage: http://olvemaudal.com/talks
Here is a video recording of me presenting these slides at NDC 2014: http://vimeo.com/channels/ndc2014/97505677
Enjoy!
Programming is hard. Programming correct C and C++ is particularly hard. Indeed, both in C and certainly in C++, it is uncommon to see a screenful containing only well defined and conforming code.Why do professional programmers write code like this? Because most programmers do not have a deep understanding of the language they are using.While they sometimes know that certain things are undefined or unspecified, they often do not know why it is so. In these slides we will study small code snippets in C and C++, and use them to discuss the fundamental building blocks, limitations and underlying design philosophies of these wonderful but dangerous programming languages.
This content has a CC license. Feel free to use it for whatever you want. You may download the original PDF file from: http://www.pvv.org/~oma/DeepC_slides_oct2012.pdf
A Logic Meta-Programming Foundation for Example-Driven Pattern Detection in O...Coen De Roover
Presentation at the Postdoctoral symposium of the 2011 International Conference on Software Maintenance, accompanying the paper
http://soft.vub.ac.be/Publications/2011/vub-soft-tr-11-11.pdf
This presentation introduces some advanced concepts of threads, as implemented in the Java platform. It is part of a series of slides dedicated to threads. This slides introduces the following concepts:
- Callable
- Futures
- Executors and executor services
- Deadlocks (brief introduction)
The presentation is took from the Java course I run in the bachelor-level informatics curriculum at the University of Padova.
Unit testing with PHPUnit - there's life outside of TDDPaweł Michalik
Basics of PHPUnit and why is it even more relevant in legacy code. Key points of the framework are explained, along with mocking objects, test organisation, creating documentations with tests and accessing non-public objects (where applicable).
Live version with additional notes available at: http://pawelmichalik.net/presentations/unit-testing-with-phpunit?showNotes=true
Prezentacja dostępna także w języku polskim: http://pawelmichalik.net/prezentacje/testy-jednostkowe-w-phpunit?showNotes=true
Best Coding Practices For Android Application DevelopmentKetan Raval
Learn how to make coding at the time of android application development. Best practices for coding for android app development. Points to take care at the time of development application.
it describes the main concepts of object oriented programming
For more posts : http://comsciguide.blogspot.com/
For full playlist of Interview puzzles videos : https://www.youtube.com/playlist?list=PL3v9ipJOEEPfI4zt4ExamGJwndkvg0SFc
24 standard interview puzzles: https://www.youtube.com/playlist?list=PL3v9ipJOEEPefIF4nscYOobim1iRBJTjw
Aptitude training playlist link : https://www.youtube.com/playlist?list=PL3v9ipJOEEPfumKHa02HWjCfPvGQiPZiG
for C and C++ questions, that are asked in the interviews, go through the posts in the link : http://comsciguide.blogspot.com/
for more videos, my youtube channel : https://www.youtube.com/channel/UCvMy2V7gYW7VR2WgyvLj3-A
Extension methods, nulls, namespaces and precedence in c#Paul Houle
Extension methods are the most controversial feature that Microsoft has introduced in C# 3.0. Introduced to support the LINQ query framework, extension methods make it possible to define new methods for existing classes.
Although extension methods can greatly simplify code that uses them, many are concerned that they could transform C# into something that programmers find unrecognizable, or that C#’s namespace mechanisms are inadequate for managing large systems that use extension methods. Adoption of the LINQ framework, however, means that extension methods are here to stay, and that .net programmers need to understand how to use them effectively, and, in particular, how extension methods are different from regular methods.
Extension methods, nulls, namespaces and precedence in c#Paul Houle
Extension methods are the most controversial feature that Microsoft has introduced in
C# 3.0. Introduced to support the LINQ query framework, extension methods make
it possible to define new methods for existing classes.
Although extension methods can greatly simplify code that uses them, many are
concerned that they could transform C# into something that programmers find
unrecognizable, or that C#’s namespace mechanisms are inadequate for managing
large systems that use extension methods. Adoption of the LINQ framework,
however, means that extension methods are here to stay, and that .net
programmers need to understand how to use them effectively, and, in particular,
how extension methods are different from regular methods.
This article discusses three ways in which extension methods differ from regular
methods:
1. Extension methods can be called on null objects without throwing an exception
2. Extension methods cannot be called inside of a subclass
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.
Developing Distributed High-performance Computing Capabilities of an Open Sci...Globus
COVID-19 had an unprecedented impact on scientific collaboration. The pandemic and its broad response from the scientific community has forged new relationships among public health practitioners, mathematical modelers, and scientific computing specialists, while revealing critical gaps in exploiting advanced computing systems to support urgent decision making. Informed by our team’s work in applying high-performance computing in support of public health decision makers during the COVID-19 pandemic, we present how Globus technologies are enabling the development of an open science platform for robust epidemic analysis, with the goal of collaborative, secure, distributed, on-demand, and fast time-to-solution analyses to support public health.
Code reviews are vital for ensuring good code quality. They serve as one of our last lines of defense against bugs and subpar code reaching production.
Yet, they often turn into annoying tasks riddled with frustration, hostility, unclear feedback and lack of standards. How can we improve this crucial process?
In this session we will cover:
- The Art of Effective Code Reviews
- Streamlining the Review Process
- Elevating Reviews with Automated Tools
By the end of this presentation, you'll have the knowledge on how to organize and improve your code review proces
Globus Connect Server Deep Dive - GlobusWorld 2024Globus
We explore the Globus Connect Server (GCS) architecture and experiment with advanced configuration options and use cases. This content is targeted at system administrators who are familiar with GCS and currently operate—or are planning to operate—broader deployments at their institution.
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.
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."
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
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.
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?
GraphSummit Paris - The art of the possible with Graph TechnologyNeo4j
Sudhir Hasbe, Chief Product Officer, Neo4j
Join us as we explore breakthrough innovations enabled by interconnected data and AI. Discover firsthand how organizations use relationships in data to uncover contextual insights and solve our most pressing challenges – from optimizing supply chains, detecting fraud, and improving customer experiences to accelerating drug discoveries.
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.
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
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisGlobus
JASMIN is the UK’s high-performance data analysis platform for environmental science, operated by STFC on behalf of the UK Natural Environment Research Council (NERC). In addition to its role in hosting the CEDA Archive (NERC’s long-term repository for climate, atmospheric science & Earth observation data in the UK), JASMIN provides a collaborative platform to a community of around 2,000 scientists in the UK and beyond, providing nearly 400 environmental science projects with working space, compute resources and tools to facilitate their work. High-performance data transfer into and out of JASMIN has always been a key feature, with many scientists bringing model outputs from supercomputers elsewhere in the UK, to analyse against observational or other model data in the CEDA Archive. A growing number of JASMIN users are now realising the benefits of using the Globus service to provide reliable and efficient data movement and other tasks in this and other contexts. Further use cases involve long-distance (intercontinental) transfers to and from JASMIN, and collecting results from a mobile atmospheric radar system, pushing data to JASMIN via a lightweight Globus deployment. We provide details of how Globus fits into our current infrastructure, our experience of the recent migration to GCSv5.4, and of our interest in developing use of the wider ecosystem of Globus services for the benefit of our user community.
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.
Listen to the keynote address and hear about the latest developments from Rachana Ananthakrishnan and Ian Foster who review the updates to the Globus Platform and Service, and the relevance of Globus to the scientific community as an automation platform to accelerate scientific discovery.
1. N
O MATTER HOW GOOD OUR INTENTIONS
are, bad things happen. This is as true of
programs at runtime as it is in everyday life.
The reality differentiates industrial-strength
code from simple, toy code examples. But handling
the bad along with the good is where things can get
ugly.There’s always more that can go wrong than can
go right, so traditional error handling often chops up
and obscures normal logic, making it hard to trace the
original intent.
The intricacy of error handling has sometimes
driven programmers blindly into the arms of the
goto, which has an effect on code similar to that of the
mile-a-minute plant on gardens.To those who are not
forewarned, it initially looks harmless enough, but before
long it’s completely taken over. And it takes more than
a pair of garden shears to disentangle either your
code or your garden.
This is where exceptions fit in. C++’s exception
handling mechanism is a marriage between its object
model and its control-flow features. It supports a
separation between the normal flow of control (the
try block) and the handling of the abnormal and
abominable (the catch handlers). It also simplifies and
broadens the communication of the bad news (the
throw), just as a goto does not. It’s true that exceptions
inflict a certain amount of violence on the normal,
gentle flow of control, but they do so sympathetically.
Exceptions support rather than obstruct the block
structure and modularity of your code, whereas “a goto
completely invalidates the high-level structure of the
code”1
, making it difficult to read, refactor or rescue.
Exceptions also have a dark side. If code isn’t
written to be exception-safe, an exception will lead
to graceless rather than graceful failure – the act of deliv-
ering bad news creates worse news. Code that releas-
es a previously acquired resource, for example, should
be executed regardless of the route out of a function.
Code not written with exceptions in mind normal-
ly fails to do the right thing when they happen.
An object finale
The common focus of exception handling is on sep-
arating the normal and exceptional paths. In contrast,
exception safety focuses on identifying code that’s com-
mon to both paths. In the case of paired actions, such
as acquire–release or open–close, an exception-safe
approach ensures the bracketing action is always exe-
cuted. Consider the following code:
{
resource_type resource = acquire();
.... // use resource, exceptions possible
release(resource);
}
There are two things to notice about this. It’s brief
and clear, and it’s unsafe, with the release action
bypassed if an exception is thrown in the body of the
block. The first instinct of many programmers is to
make the code exception-aware in order to make it safe:
{
resource_type resource = acquire();
try
{
.... // use resource, exceptions possible
}
catch(...)
{
release(resource);
58 APPLICATION DEVELOPMENT ADVISOR q www.appdevadvisor.com
Kevlin Henney is an
independent software
development consultant
and trainer.He can be
reached at
www.curbralan.com
EFFECTIVE C++
q C++’s exception handling mechanism
respects a program’s modularity when it
transfers control
q Exceptions can cause problems if code is
not exception safe
q Some languages use a finally block to
allow clean up of resources on block exit
q The C++ idiom is to use objects to
encapsulate actions rather than extend
the language itself
q A simple, extensible class template can
be written to handle many common
clean-up tasks
FACTS AT A GLANCE
Exception handling in C++ can save your program from digital death, but
it must be treated with care. Kevlin Henney explains how to make your
programs exception-safe
Making an exception
2. 60 APPLICATION DEVELOPMENT ADVISOR q www.appdevadvisor.com
EFFECTIVE C++
throw; // rethrow so caller is aware of failure
}
release(resource);
}
There are three things to notice about this code: it’s verbose,
exception-safe and, because of its verbosity, it’s not immediately obvious
that it’s exception-safe. It’s not enough that code should be
exception-safe, either – it should also be clear that it’s exception-
safe. The code above demonstrates a simple scenario with a single
resource and single release action. Include more of either and it looks
like the mile-a-minute has returned to take over your code.
And finally...
Some languages that adopt an exception handling mechanism like
C++’s also introduce a finally block. For example, Java and C# work
this way. A finally block groups code common to both execution
paths into a single block. C++ doesn’t have finally, but if it did, it
would look something like the following:
{
resource_type resource = acquire();
try
{
.... // use resource, exceptions possible
}
finally // not legal C++
{
release(resource);
}
}
This is clearly briefer and briefly clearer than the previous,
tortured code fragment. Is it an oversight that C++ doesn’t support
such a construct? On the contrary, it’s by design2
. Although finally
reduces the amount of code duplication within a single function,
it still bloats the source of the function and often leads to code
duplication when the resource type is used in many places.The same
finally and release code are repeated everywhere the resource is used.
C++ in addition has a feature that neither Java nor C# supports
– deterministic object lifetime and destruction. An ordinary
local variable will have its destructor called when it goes out of
scope, both for normal exit and as the stack unwinds from an excep-
tion. Destructors are not just for cleaning up the resources used by
the destructing object, they can be used to clean up other objects’
resources as well.
Thanks for the memory
The most common example of this idiom is in managing
memory that is allocated only for a block, although it can also
be used to automate lifetime management for nested objects.
This is one of the roles that the standard auto_ptr class template is
designed to cover:
{
std::auto_ptr<type> ptr(new type);
.... // use ptr, exceptions possible
}
As opposed to:
{
type *ptr = new type;
try
{
.... // use ptr, exceptions possible
}
catch(...)
{
delete ptr;
throw;
}
delete ptr;
}
auto_ptr is clearly a winner in this department. However, beyond
this simple scenario, it’s let down by some rather messy semantics.
auto_ptr’s specification passes all understanding and defies imple-
mentation. It’s clear from the scenario already outlined that such
acquisition objects should not be copyable, as this would lead to
aliasing and attempted multiple deletion of a single object. How-
ever, after a few rounds with standardisation politics, what was once
a simple class that could be implemented by a C++ novice grew into
a monster that supported move rather than copy semantics for its
copy operations – a handful of C++ experts, and not everyone involved
with the standardisation, can implement it. If you want surprising
semantics, consider the following:
{
std::auto_ptr<type> ptr(new type), qtr;
qtr = ptr;
....
}
There is an expectation that assignment leaves the right-hand side
of the assignment unaffected. Alas, auto_ptr fails to live up to expec-
tations: the right-hand side is set to null. While such transfer
functionality is sometimes useful, it isn’t copy assignment. Sadly,
this is the tip of the iceberg with this class template’s problems.
Let’s go back to first principles, see what’s involved in designing
such a class for its original use in simplifying block-scoped memory
management, and then generalise it to other resources while
retaining its essential simplicity. To bind object deletion to block
scope, we need a constructor to be told about the object, a destruc-
tor to destroy it and no copying operations (because that way lies
madness, darkness and the shadow of std::auto_ptr):
template<typename resource_type>
class scoped
{
public: // structors
explicit scoped(resource_type resourced)
: resource(resourced)
{
}
~scoped()
{
delete resource;
}
The solution to the exception-safety problem is to give custody of the
resource to a locally scoped object which then performs the clean-up on
destruction.This solution is a more object-oriented one: the control flow
is abstracted into an object whose responsibility is clear and whose
action is reusable.The resulting code is exception-neutral, meaning that
it’s safe, but not cluttered with try blocks of any kind, and requires no
extension to the language.The technique is well known and well
documented in a number of forms. It is commonly known as the
RESOURCE ACQUISITION IS INITIALIZATION idiom3
, although this name is
something of a misnomer: the idiom has nothing to do with initialisation
and everything to do with finalisation.
3. MAY 2001 61
EFFECTIVE C++
private: // prevention
scoped(const scoped &);
scoped &operator=(const scoped &);
private: // representation
resource_type resource;
};
scoped is simple in both implementation and use:
{
scoped<type *> ptr(new type);
....
}
A change of policy
The precondition to using scoped as it currently stands is that the
pointer must either be null or have been allocated using new. If you’re
using a different allocator, such as malloc or new[], then delete is the
wrong deallocation. Instead, you need free and delete[] respectively.
Rather than write a separate class template for each possibility, it
would be simpler to allow scoped to be parameterised by a destruc-
tion policy. A policy class describes a STRATEGY4
that can be used
as a template parameter to control some aspect of the template’s
behaviour. By default, we tend to work with single objects rather
than arrays, which suggests the following usage:
{
scoped<type *> ptr(new type);
scoped<type *, array_deleter> array(new type[size]);
....
}
Treating the policy as a function object type means we get the
desired flexibility, a simple syntax to use inside scoped, and the pos-
sibility of passing in a policy object that has its own state. Here is
the revised scoped template:
template<
typename resource_type, typename destructor = deleter>
class scoped
{
public: // structors
explicit scoped(
resource_type resourced,
destructor on_destruct = destructor())
: resource(resourced), destruct(on_destruct)
{
}
~scoped()
{
destruct(resource);
}
private: // prevention
scoped(const scoped &);
scoped &operator=(const scoped &);
private: // representation
resource_type resource;
destructor destruct;
};
The default object deletion policy and function object type are
simple:
struct deleter
{
template<typename deleted_type>
void operator()(deleted_type to_delete)
{
delete to_delete;
}
};
A member template is used so that this simple class will work with
any pointer type.The alternative would be to make the whole class
a template, which would make its use verbose: to use it, you
would have to spell out the class template name and its parame-
ter types, rather than just use the class name and let the compiler
deduce the type from the argument of the function call operator
– deleter<type *> as opposed to deleter.
As a function-object type, deleter can be reused in contexts
other than scoped. For instance, consider the common need to delete
each object pointed to by a container:
std::list<type *> objects;
objects.push_back(new type);
....
Rather than the following, slightly long-winded loop:
for(std::list<type *>::iterator at = objects.begin();
at != objects.end();
++at)
{
delete *at;
}
You can write the following:
std::for_each(objects.begin(), objects.end(), deleter());
Given deleter, array_deleter is quite straightforward:
struct array_deleter
{
template<typename deleted_type>
void operator()(deleted_type to_delete)
{
delete[] to_delete;
}
};
A sense of closure
Not all pointers want deleting. Some have more complex finalisation.
If, for compatibility reasons, you end up using C-style I/O, you may
be using FILE * with fopen and fclose from the C standard library.
In this case, the pointer is ‘allocated’ using fopen and ‘deallocated’
using fclose. We can provide a simple closer function object type
to handle this:
struct closer
{
void operator()(FILE *to_close)
{
fclose(to_close);
}
};
And to use it, scoped needs no change:
{
scoped<FILE *, closer> file(fopen(name, mode));
....
}
4. 62 APPLICATION DEVELOPMENT ADVISOR q www.appdevadvisor.com
EFFECTIVE C++
Now, the way that I have written the scoped template allows any
type to be used as a resource, not just pointers. For instance, you
can use scoped with an int. An int? Why would an int need tidy-
ing up in the event of an exception? In the POSIX API, int is the
type used for file handles. So, although the int itself does not need
any extra management, an open needs to be matched with a close.
Given that ‘close’ is the most common name for any close action,
we can generalise the closer function object type beyond just FILE
* and int:
struct closer
{
template<typename closed_type>
void operator()(closed_type to_close)
{
close(to_close);
}
void operator()(FILE *to_close)
{
fclose(to_close);
}
};
This now takes the appropriate action depending on the type of
the resource:
{
scoped<FILE *, closer> file(fopen(name, mode));
....
} // fclose called
{
scoped<int, closer> file(open(name, flags));
....
} // close called
Getting a result
As it stands, the scoped template is simple, flexible – and almost
useless.The only public interface it currently sports is a constructor
and a destructor. This is something of a write-only interface:
there’s no way to get your hands on the actual resource to use it.
We can provide a simple outward conversion with a user-
defined conversion operator:
template<
typename resource_type, typename destructor = deleter>
class scoped
{
....
operator resource_type() const
{
return resource;
}
....
};
For the common case of just getting your hands on the value of
the resource, the implicit conversion makes the use of scoped
practically transparent:
{
scoped<FILE *, closer> file(fopen(name, mode));
....
fflush(file); // implicit conversion to FILE *
....
}
Except for pointers. For instance, auto_ptr, like most other
smart pointers, supports operator* and operator-> for dereferencing.
The arrow operator is easy enough:
template<
typename resource_type, typename destructor = deleter>
class scoped
{
....
resource_type operator->() const
{
return resource;
}
....
};
If resource_type is a pointer, or another class that supports its own
operator->, the operator-> just defined can be used. If not, any attempt
to use it will result in a compile time error. So the code is valid when
it’s supposed to be, and isn’t when it isn’t, which is just the level of
type checking we want.
operator* presents us with a bit more of a challenge: what’s the
return type in the case of a pointer-based resource, and how do we
prevent it being used with non-pointer resources? How do we get
from resource_type to the type of *resource? C++ doesn’t support
a typeof operator, which would make this trivial, so we resolve the
situation using theTRAITS idiom. A trait class allows compile-time
deduction of features of another type based on template speciali-
sation. We are going to define a simple, single-feature trait that allows
us to deduce a legal result type for operator*:
template<
typename resource_type, typename destructor = deleter>
class scoped
{
....
dereferenced<resource_type>::type operator*() const
{
return *resource;
}
....
};
The dereferenced trait class has a nested typedef that resolves to
the right type. For non-pointer types, operator* is unusable because
the *resource expression isn’t legal. Template functions aren’t fully
checked and compiled unless they are used, but they still need to
have legal signatures. In this case, a return type of void will do the
trick. So, the default implementation for dereferenced does just that:
template<typename value_type>
struct dereferenced
{
typedef void type;
};
For pointer types, we can use partial specialisation to offer the
dereferenced result type we are expecting:
template<typename element_type>
struct dereferenced<element_type *>
{
typedef element_type &type;
};
This specialisation effectively overrides the primary template for
all types that match form T *, and which dereferenced would there-
5. MAY 2001
fore be T &. The only other case we need to specialise for is that
of void *. There’s no such thing, however, as a reference to void.
In the event that we are working at a low level, we may find our-
selves working with raw memory, but we still want the safety and
convenience of scoped at our disposal. At the moment, the com-
piler will reject any attempt to use scoped<void *>, as indeed it
does for auto_ptr<void>, because the type void & isn’t well formed.
We can add a full specialisation for this case, silencing the com-
piler and disabling use of operator* while still offering the core
scoped features:
template<>
struct dereferenced<void *>
{
typedef void type;
};
There are many benefits to the traits-based approach, not
least of which is that it makes the scoped template’s operator* work!
Another is that traits are open to further specialisation by other
users. For instance, if you have your own smart pointer class that
you would like to use with scoped, you could specialise derefer-
erenced accordingly.
Exceptions are a simple mechanism that can be used to send
bad news from one part of a program to another. They can also
be used to make bad news if the programmer isn’t aware of a hand-
ful of simple exception-safe practices. Rather than introducing
a finally block to guarantee resource release, C++ encourages a more
object-oriented approach that abstracts control flow and reduces
code duplication. Exception-neutral code that uses this technique
is safer and more concise than exception-aware code that labo-
riously addresses each outcome in turn. The simple principles and
techniques described in this article can be taken to quite an
advanced level5,6
.
auto_ptr is useful for the simple task of scope-managed mem-
ory, but it doesn’t generalise beyond delete of new-allocated
objects. It is further complicated for both the user and the stan-
dard library implementor by its move semantics for copying. So,
if nothing else is available, use auto_ptr. However, you might want
to experiment with other libraries, such as Boost7
, or the scoped
template presented here. The only feature currently missing
from scoped is the ability to transfer ownership of a resource: this
is left as an exercise for the reader. s
References
1. Taligent’s Guide to Designing Programs: Well-Mannered
Object-Oriented Design in C++, Addison-Wesley, 1994
http://pcroot.cern.ch/TaligentDocs/TaligentOnline/Docu-
mentRoot/1.0/Docs/books/WM/WM_1.html.
2. Bjarne Stroustrup, The Design and Evolution of C++,
Addison-Wesley, 1994
3. Bjarne Stroustrup, The C++ Programming Language, Third
edition, Addison-Wesley, 1997
4. Erich Gamma, Richard Helm, Ralph Johnson and John
Vlissides, Design Patterns: Elements of Reusable Object-
Oriented Software, Addison-Wesley, 1995
5. Kevlin Henney, “C++ Patterns: Executing Around
Sequences”, EuroPLoP 2000, July 2000,
www.curbralan.com.
6. Andrei Alexandrescu and Petru Marginean, “Generic<Pro-
gramming>: Simplifying Your Exception-Safe Code”,
C/C++ Users Journal web site, December 2000,
www.cuj.com/experts/1812/alexandr.htm.
7. Boost library web site, www.boost.org.