Functional C#
eBook - ePub

Functional C#

Wisnu Anggoro

Share book
  1. 370 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Functional C#

Wisnu Anggoro

Book details
Book preview
Table of contents
Citations

About This Book

Uncover the secrets of functional programming using C# and change the way you approach your applications forever

About This Book

  • This book focuses on the functional paradigm of C#, which will give you a whole new angle on coding with C#
  • It illustrates the advantages that functional programming brings to the table and the associated coding benefits
  • This practical guide covers all the aspects of functional programming and provides solutions that can be applied in business scenarios

Who This Book Is For

This book is suitable for C# developers with basic prior knowledge of C# and with no functional programming experience at all.

What You Will Learn

  • Develop an application using the functional approach
  • Implement unit testing to functionally program code
  • Create efficient code using functional programming
  • Work through a LINQ query so you can work with data
  • Compose asynchronous programs to create a responsive application
  • Use recursion in function programming in order to simplify code
  • Optimize the program code using Laziness and Caching Techniques

In Detail

Functional programming makes your application faster, improves performance, and increases your productivity. C# code is written at a higher level of abstraction, so that code will be closer to business requirements, abstracting away many low-level implementation details.

This book bridges the language gap for C# developers by showing you how to create and consume functional constructs in C#. We also bridge the domain gap by showing how functional constructs can be applied in business scenarios. We'll take you through lambda expressions and extension methods, and help you develop a deep understanding of the concepts and practices of LINQ and recursion in C#.

By the end of the book, you will be able to write code using the best approach and will be able to perform unit testing in functional programming, changing how you write your applications and revolutionizing your projects.

Style and approach

This book takes a pragmatic approach and shows you techniques to write better functional constructs in C#. We'll also show you how these concepts can be applied in business scenarios.

Frequently asked questions

How do I cancel my subscription?
Simply head over to the account section in settings and click on ā€œCancel Subscriptionā€ - itā€™s as simple as that. After you cancel, your membership will stay active for the remainder of the time youā€™ve paid for. Learn more here.
Can/how do I download books?
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
What is the difference between the pricing plans?
Both plans give you full access to the library and all of Perlegoā€™s features. The only differences are the price and subscription period: With the annual plan youā€™ll save around 30% compared to 12 months on the monthly plan.
What is Perlego?
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, weā€™ve got you covered! Learn more here.
Do you support text-to-speech?
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Is Functional C# an online PDF/ePUB?
Yes, you can access Functional C# by Wisnu Anggoro in PDF and/or ePUB format, as well as other popular books in Informatique & Programmation. We have over one million books available in our catalogue for you to explore.

Information

Year
2016
ISBN
9781785282225
Edition
1

Functional C#


Functional C#

Copyright Ā© 2016 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First published: January 2017
Production reference: 1281216
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham
B3 2PB, UK.
ISBN 978-1-78528-222-5
www.packtpub.com

Credits

Author
Wisnu Anggoro
Copy Editor
Stuti Srivastava
Reviewer
Haridas Nair
Project Coordinator
Izzat Contractor
Commissioning Editor
Kunal Parikh
Proofreader
Safis Editing
Acquisition Editor
Denim Pinto
Indexer
Rekha Nair
Content Development Editor
Priyanka Mehta
Production Coordinator
Shraddha Falebhai
Technical Editors
Bhavin Savalia
Dhiraj Chandanshive

About the Author

Wisnu Anggoro is a Microsoft Certified Professional in C# programming and an experienced C/C++ developer. He has also authored Boost.Asio C++ Network Programming - Second Edition, published by Packt. He has been programming since he was in junior high school (about 20 years ago) and started developing computer applications using the BASIC programming language in the MS-DOS environment. He has a solid experience of smart card programming as well as desktop and web application programming, such as designing, developing, and supporting live use applications for SIM Card Operating System Porting, personalization, PC/SC communication, and other smart card applications that require the use of C# and C/C++. He is currently a senior smart card software engineer at CIPTA, an Indonesian company that specializes in the innovation and technology of smart cards. You can write to him at [email protected].

Acknowledgments

First and above all, I praise God, the almighty, for providing me with this opportunity and granting me the capability to proceed successfully. To my wife, dear Vivin, without whose support and encouragements I could not have finished this book. Thank you for reminding me of the deadline of each chapter, so I could always stay on the writing process schedule. To my beloved sons, the source of my joy: Olav, who makes my life worth living by giving me much happiness, and Oliver, who was born just after I submitted the draft of chapter 5. His first cry boosted my spirit to finish this book. And a thank you to my parents and family for their inspiration.
Also, I would like to express my gratitude to the following individuals who supported me in writing this book:
The team at Packt, especially Denim Pinto, my acquisition editor, who invited me to author this book; Priyanka Mehta, my content development editor, for her constant effort in encouraging me to supply the best content for this book; and to all reviewers who have given input and suggestions to make the content of this book much better.
My best mentor, teacher, and superior at CIPTA (www.cipta.com), Benediktus Dwi Desiyanto, who never let me stop learning new things and always encourages me to catch my dream. Hope this book can be the way to make all my dreams come true.
Chief Executive Officer of CIPTA, Steven Chandra, for providing me with a new Amazon Kindle. Since then, the number of books I have read has increased. The insight from the books I have read was helpful while I wrote this book.
Chief Human Capital Officer of CIPTA, Budi Setiawan, for appreciating my work in authoring my previous book and inviting me to join the C-MAG (CIPTA Magazine) press team. It helped me a lot in enhancing my writing skills.
All my friends and colleagues at CIPTA, especially Muhammad Abdurochman Sanjaya and Seno Budi Utomo, for the insight of C# programming in developing a smart card application. It helped me develop the application I presented in this book. And Andre Tampubolon, for the insight of functional programming in Haskell.
Dave Fancher, the author of The Book of F#, thank you for your amazing site, https://davefancher.com/, my one-stop place to learn functional programming. His website inspired my authoring of this book.

About the Reviewer

Haridas Nair works as a software architect within the Architecture Practice, providing both technical and solution architecture. He is responsibile for defining, documenting, and articulating functional and nonfunctional scope.
He manages various project teams varying in size and location in USA, UK, and offshore (India). The day-to-day duties range from assisting in technical presales activities, responding to RFPs, through to high-level and detailed design phases to actual implementation on enterprise-scale projects.
I would like to thank Praseed Pai for introducing me to this publisher. I would also like to thank the publisher for giving me this opportunity.

www.PacktPub.com

For support files and downloads related to your book, please visit www.PacktPub.com.
Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktPub.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at [email protected] for more details.
At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a range of free newsletters and receive exclusive discounts and offers on Packt books and eBooks.
www.PacktPub.com
https://www.packtpub.com/mapt
Get the most in-demand software skills with Mapt. Mapt gives you full access to all Packt books and video courses, as well as industry-leading tools to help you plan your personal development and advance your career.

Why subscribe?

  • Fully searchable across every book published by Packt
  • Copy and paste, print, and bookmark content
  • On demand and accessible via a web browser

Customer Feedback

Thank you for purchasing this Packt book. We take our commitment to improving our content and products to meet your needs seriously--that's why your feedback is so valuable. Whatever your feelings about your purchase, please consider leaving a review on this book's Amazon page. Not only will this help us, more importantly it will also help others in the community to make an informed decision about the resources that they invest in to learn. You can also review for us on a regular basis by joining our reviewers' club. If you're interested in joining, or would like to learn more about the benefits we offer, please contact us: [email protected].

Preface

Some of us may be used to developing an application using the object orientation programming technique and donā€™t care about the functional programming technique. However, there are benefits to using functional programming. One of the benefits is that we will get a new perspective on our programming code since the function in functional programming is identical to a mathematical function. Because it's identical to a mathematical function, the function in functional programming contains no side-effects, which means that the function invocation will have no effect on other functions in the class. We will discuss more details about the benefits and other things related to functional programming in this book.

What this book covers

Chapter 1, Tasting Functional Style in C#...

Table of contents