This document discusses various anti-patterns and best practices in coding. It covers topics like avoiding magic numbers, proper use of #define, implicit type conversions, assertions, encapsulation, short and descriptive variable names, dead code, and name spacing. The key messages are to form good habits, optimize code for humans, learn rules well to know when to break them, avoid assumptions without assertions, and use proper encapsulation, short methods and naming.
In computer science, conditional statements, conditional expressions and conditional constructs are features of a programming language, which perform different computations or actions depending on whether a programmer-specified boolean condition evaluates to true or false.
In computer science, conditional statements, conditional expressions and conditional constructs are features of a programming language, which perform different computations or actions depending on whether a programmer-specified boolean condition evaluates to true or false.
In
computer
programming languages
, indentation formats program
source code
to
improve readability.
P
rogramming languages make
use of i
ndentation to define program
structure .
Programmers
use
indent
ation
to
understand
the structure of their programs to human
readers. Especially
, inden
tation is the
better way to
represent
the relationship between
control flow
constructs such as selection statements
or
loops and code contained within and outside
them.
This
paper describes about different indentation styles
used in Programming and also describes context of each indentation s
tyle. It also describes indentation
styles used for various
programming constructs and t
he best practice for a particular programming
construct.
This
paper helps the beginners to understand various indentation styles used in programming
and also to ch
oose
suitable indentation style
The following lessons present the knowledge needed to become proficient in creating, evaluating, comparing, and using quantitative methods for forecasting purposes. Each lesson will introduce a concept or method followed by an example.
Some of the most common and easy-to-calculate/easy-to-measure code metrics. Understanding these can help you make your code better: avoiding code rot and writing maintainable code all starts here. Content is created for C# .net, however, the underlying principles apply to other languages/frameworks as well.
A summary of clean code concepts and tips along with some examples and good practices.
These are the slides translated in English from my talk on Clean Code to my coworkers back then
In
computer
programming languages
, indentation formats program
source code
to
improve readability.
P
rogramming languages make
use of i
ndentation to define program
structure .
Programmers
use
indent
ation
to
understand
the structure of their programs to human
readers. Especially
, inden
tation is the
better way to
represent
the relationship between
control flow
constructs such as selection statements
or
loops and code contained within and outside
them.
This
paper describes about different indentation styles
used in Programming and also describes context of each indentation s
tyle. It also describes indentation
styles used for various
programming constructs and t
he best practice for a particular programming
construct.
This
paper helps the beginners to understand various indentation styles used in programming
and also to ch
oose
suitable indentation style
The following lessons present the knowledge needed to become proficient in creating, evaluating, comparing, and using quantitative methods for forecasting purposes. Each lesson will introduce a concept or method followed by an example.
Some of the most common and easy-to-calculate/easy-to-measure code metrics. Understanding these can help you make your code better: avoiding code rot and writing maintainable code all starts here. Content is created for C# .net, however, the underlying principles apply to other languages/frameworks as well.
A summary of clean code concepts and tips along with some examples and good practices.
These are the slides translated in English from my talk on Clean Code to my coworkers back then
We've all seen the big "macro" features in .NET, this presentation is to give praise to the "Little Wonders" of .NET -- those little items in the framework that make life as a developer that much easier!
Vladimir Romanov - How to write code that is easy to read and change? What should you do when you see a piece of code written years ago which is hard to understand? In my experience, this boils down to 4 principles that I would like to share along with some examples in Apex
Why should we use TDD to develop in Elixir? When we are applying it correctly? What are the differences that we can find in a code developed with TDD and in code not developed with it? Is it TDD about testing? Really? In this talk, I'll show what is TDD and how can be used it in functional programming like Elixir to design the small and the big parts of your system, showing what are the difference and the similarities between an OOP and FP environment. Showing what is the values of applying a technique like TDD in Elixir and what we should obtain applying it.
Accord.Net: Looking for a Bug that Could Help Machines Conquer HumankindPVS-Studio
Articles discussing the results of analysis of open-source projects are a good thing as they benefit everyone: some, including project authors themselves, can find out what bugs lurk in a project; others discover for themselves the static analysis technology and start using it to improve their code's quality. For us, it is a wonderful means to promote PVS-Studio analyzer, as well as to put it through some additional testing. This time I have analyzed Accord.Net framework and found lots of interesting issues in its code.
Keep Code Left - How to write better code in almost any languageMick Andrew
Mick claims that 50% of all "else" statements are not needed, and are harmful to your code's readability, reliability and maintainability.
Come hear and see some simple guidelines that can help coders in almost any language that has if-then-else and loop-continue statements write better code, and perform rule-driven code reviews at a glance with no software tools needed. Come learn what a "filter" is, and where they should be coded.
In this presentation I implement the MVVM pattern by combining Core Data and Reactive Cocoa. The MVVM pattern can use any data storage and binding libraries, but I chose Core Data and Reactive Cocoa since they are common on iOS. Demo at https://github.com/rob-brown/Demos/tree/master/MVVMDemo.
The basics of Reactive Cocoa. The tips and tricks in this presentation will cover almost all the use cases for Reactive Cocoa. Demo here: https://github.com/rob-brown/Demos/tree/master/RACDemo.
iOS State Preservation and RestorationRobert Brown
Covers iOS app state preservation and restoration with extra emphasis on NSCoding. WWCD 2012 session 208 glosses over some of the fine details of how NSCoding works. Understanding this foundation better helps in understanding state preservation and restoration.
For the best viewing experience, please download this presentation and view it in Keynote. SlideShare doesn't handle the animations well.
Blocks are a powerful language feature. However, they are underused and under-appreciated in Objective-C, especially compared to Ruby. My intent is to make blocks easy to understand and show many practical uses of blocks.
Core Data can be intimidating at first. With a proper introduction, the transition into using Core Data can be much smoother. This presentation gives an overview of the core and advanced parts of Core Data.
UiPath Test Automation using UiPath Test Suite series, part 6DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 6. In this session, we will cover Test Automation with generative AI and Open AI.
UiPath Test Automation with generative AI and Open AI webinar offers an in-depth exploration of leveraging cutting-edge technologies for test automation within the UiPath platform. Attendees will delve into the integration of generative AI, a test automation solution, with Open AI advanced natural language processing capabilities.
Throughout the session, participants will discover how this synergy empowers testers to automate repetitive tasks, enhance testing accuracy, and expedite the software testing life cycle. Topics covered include the seamless integration process, practical use cases, and the benefits of harnessing AI-driven automation for UiPath testing initiatives. By attending this webinar, testers, and automation professionals can gain valuable insights into harnessing the power of AI to optimize their test automation workflows within the UiPath ecosystem, ultimately driving efficiency and quality in software development processes.
What will you get from this session?
1. Insights into integrating generative AI.
2. Understanding how this integration enhances test automation within the UiPath platform
3. Practical demonstrations
4. Exploration of real-world use cases illustrating the benefits of AI-driven test automation for UiPath
Topics covered:
What is generative AI
Test Automation with generative AI and Open AI.
UiPath integration with generative AI
Speaker:
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
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/
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...SOFTTECHHUB
The choice of an operating system plays a pivotal role in shaping our computing experience. For decades, Microsoft's Windows has dominated the market, offering a familiar and widely adopted platform for personal and professional use. However, as technological advancements continue to push the boundaries of innovation, alternative operating systems have emerged, challenging the status quo and offering users a fresh perspective on computing.
One such alternative that has garnered significant attention and acclaim is Nitrux Linux 3.5.0, a sleek, powerful, and user-friendly Linux distribution that promises to redefine the way we interact with our devices. With its focus on performance, security, and customization, Nitrux Linux presents a compelling case for those seeking to break free from the constraints of proprietary software and embrace the freedom and flexibility of open-source computing.
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex ProofsAlex Pruden
This paper presents Reef, a system for generating publicly verifiable succinct non-interactive zero-knowledge proofs that a committed document matches or does not match a regular expression. We describe applications such as proving the strength of passwords, the provenance of email despite redactions, the validity of oblivious DNS queries, and the existence of mutations in DNA. Reef supports the Perl Compatible Regular Expression syntax, including wildcards, alternation, ranges, capture groups, Kleene star, negations, and lookarounds. Reef introduces a new type of automata, Skipping Alternating Finite Automata (SAFA), that skips irrelevant parts of a document when producing proofs without undermining soundness, and instantiates SAFA with a lookup argument. Our experimental evaluation confirms that Reef can generate proofs for documents with 32M characters; the proofs are small and cheap to verify (under a second).
Paper: https://eprint.iacr.org/2023/1886
Communications Mining Series - Zero to Hero - Session 1DianaGray10
This session provides introduction to UiPath Communication Mining, importance and platform overview. You will acquire a good understand of the phases in Communication Mining as we go over the platform with you. Topics covered:
• Communication Mining Overview
• Why is it important?
• How can it help today’s business and the benefits
• Phases in Communication Mining
• Demo on Platform overview
• Q/A
Essentials of Automations: The Art of Triggers and Actions in FMESafe Software
In this second installment of our Essentials of Automations webinar series, we’ll explore the landscape of triggers and actions, guiding you through the nuances of authoring and adapting workspaces for seamless automations. Gain an understanding of the full spectrum of triggers and actions available in FME, empowering you to enhance your workspaces for efficient automation.
We’ll kick things off by showcasing the most commonly used event-based triggers, introducing you to various automation workflows like manual triggers, schedules, directory watchers, and more. Plus, see how these elements play out in real scenarios.
Whether you’re tweaking your current setup or building from the ground up, this session will arm you with the tools and insights needed to transform your FME usage into a powerhouse of productivity. Join us to discover effective strategies that simplify complex processes, enhancing your productivity and transforming your data management practices with FME. Let’s turn complexity into clarity and make your workspaces work wonders!
How to Get CNIC Information System with Paksim Ga.pptxdanishmna97
Pakdata Cf is a groundbreaking system designed to streamline and facilitate access to CNIC information. This innovative platform leverages advanced technology to provide users with efficient and secure access to their CNIC details.
In his public lecture, Christian Timmerer provides insights into the fascinating history of video streaming, starting from its humble beginnings before YouTube to the groundbreaking technologies that now dominate platforms like Netflix and ORF ON. Timmerer also presents provocative contributions of his own that have significantly influenced the industry. He concludes by looking at future challenges and invites the audience to join in a discussion.
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024Neo4j
Neha Bajwa, Vice President of Product Marketing, 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.
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Albert Hoitingh
In this session I delve into the encryption technology used in Microsoft 365 and Microsoft Purview. Including the concepts of Customer Key and Double Key Encryption.
Maruthi Prithivirajan, Head of ASEAN & IN Solution Architecture, Neo4j
Get an inside look at the latest Neo4j innovations that enable relationship-driven intelligence at scale. Learn more about the newest cloud integrations and product enhancements that make Neo4j an essential choice for developers building apps with interconnected data and generative AI.
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...Neo4j
Leonard Jayamohan, Partner & Generative AI Lead, Deloitte
This keynote will reveal how Deloitte leverages Neo4j’s graph power for groundbreaking digital twin solutions, achieving a staggering 100x performance boost. Discover the essential role knowledge graphs play in successful generative AI implementations. Plus, get an exclusive look at an innovative Neo4j + Generative AI solution Deloitte is developing in-house.
2. Ask Questions
My best presentations are not from what I say but
rather what you ask
It’s also fine not to agree with me
3. What is an anti-pattern?
James Dempsey:
Good intentions gone awry
Code and practices you should avoid
The code you write when you are writing it wrong
4. Principles to Remember
Form good habits
Optimize to humans
Learn the rules well so you know when and how to
break them.
6. #define
#define is a simple copy-and-paste operation with no
sense of context
There are lots of gotchas
Rule of thumb: If #if isn’t involved, don’t use #define
11. Mass Constant Files
Constant files make code less reusable
Constants should be as close possible to their relevant
code
Categories are often a good place for constants
12. Implicit Type Conversions
Operations must be performed on the same primitive
types
Type conversions may not be what you expect
13. Implicit Type Conversions
Common mistakes:
(-1 < 0u) => False
(1 / 2) => 0
for (uint32 i = 10; i >= 0; i--) { } => Infinite loop
14. Implicit Type Conversions
Rules:
Signed int to larger signed int
The smaller value is sign-extended
Signed int to same-sized unsigned int
Bit pattern preserved
15. Implicit Type Conversions
Rules:
Signed int to larger unsigned int
Sign-extended then interpreted as unsigned
Signed int to larger unsigned int
Zero-extended
16. Implicit Type Conversions
Rules:
Unsigned int to same-sized int
Interpreted as signed, may become negative
Unsigned into to larger-sized int
Zero-extended, then interpreted as signed
22. Unenforced Assumptions
If you ever make an assumption, assert it
If the assertion fails, you immediately know either your
code or your assumption is wrong
Assertions help catch bugs closer to the source
Assumptions should also be documented
27. Overly Intimate Code
Outside classes should only know what they need
Encapsulation is one of the key principles of OOP
Class extensions are great for private methods/data
Categories are great for protected methods/data
30. Dead Code
Dead code is just clutter
Increases compile time
Even though the code is no longer used, it still has
mental maintenance costs
Massive commented out methods are just as bad
31. Instance Variables
Instance variables should not be accessed directly
Getters and setters should be used instead
Essentially internal encapsulation
32. Instance Variables
Benefits of accessors:
Enforce constraints KVO
Protect data integrity Accessors don’t need
to be backed by an
Provide flexibility
ivar
Only minimal efficiency
loss
33. Branching on Classes
Branching on classes is essentially reimplementing
polymorphism
Categories solve this problem
Not all languages support categories
34. Branching on Classes
// Bad example
if ([asset isKindOfClass:[Video class]])
[asset processVideo];
else if ([asset isKindOfClass:[Photo class]])
[asset processPhoto];
38. Long Lines
Shorter lines are easier to read
Not everyone has 27+ inch screens
Xcode doesn’t auto-wrap text very well
Rule of thumb:
80-100 characters per line
39. Whitespace
Whitespace makes code more readable
It separates parts of methods into natural sections
These sections are best accompanied with comments
40. Name Spacing
Often classes have the same name
Example: User, Tweet, Photo
Naming conflicts are painful to fix
41. Name Spacing
Some languages, such as C++, include name spaces
The convention in Objective-C is to use 2-3 character
prefixes
42. Want to Learn More?
Code Complete
24 Deadly Sins of Software Security
http://www.cprogramming.com/tutorial/
cpreprocessor.html
By default, all code is compiled and the dead code is stripped. This keeps the app size smaller, but requires extra time. Just leave out dead code in the first place.\nEmpty -viewDidUnload, -viewDidLoad, etc should removed.\n
\n\n
\n
\n
\n
\n
\n
100 lines is roughly one computer screen of code.\n