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 3DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 3. In this session, we will cover desktop automation along with UI automation.
Topics covered:
UI automation Introduction,
UI automation Sample
Desktop automation flow
Pradeep Chinnala, Senior Consultant Automation Developer @WonderBotz and UiPath MVP
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
Connector Corner: Automate dynamic content and events by pushing a buttonDianaGray10
Here is something new! In our next Connector Corner webinar, we will demonstrate how you can use a single workflow to:
Create a campaign using Mailchimp with merge tags/fields
Send an interactive Slack channel message (using buttons)
Have the message received by managers and peers along with a test email for review
But there’s more:
In a second workflow supporting the same use case, you’ll see:
Your campaign sent to target colleagues for approval
If the “Approve” button is clicked, a Jira/Zendesk ticket is created for the marketing design team
But—if the “Reject” button is pushed, colleagues will be alerted via Slack message
Join us to learn more about this new, human-in-the-loop capability, brought to you by Integration Service connectors.
And...
Speakers:
Akshay Agnihotri, Product Manager
Charlie Greenberg, Host
Key Trends Shaping the Future of Infrastructure.pdfCheryl Hung
Keynote at DIGIT West Expo, Glasgow on 29 May 2024.
Cheryl Hung, ochery.com
Sr Director, Infrastructure Ecosystem, Arm.
The key trends across hardware, cloud and open-source; exploring how these areas are likely to mature and develop over the short and long-term, and then considering how organisations can position themselves to adapt and thrive.
State of ICS and IoT Cyber Threat Landscape Report 2024 previewPrayukth K V
The IoT and OT threat landscape report has been prepared by the Threat Research Team at Sectrio using data from Sectrio, cyber threat intelligence farming facilities spread across over 85 cities around the world. In addition, Sectrio also runs AI-based advanced threat and payload engagement facilities that serve as sinks to attract and engage sophisticated threat actors, and newer malware including new variants and latent threats that are at an earlier stage of development.
The latest edition of the OT/ICS and IoT security Threat Landscape Report 2024 also covers:
State of global ICS asset and network exposure
Sectoral targets and attacks as well as the cost of ransom
Global APT activity, AI usage, actor and tactic profiles, and implications
Rise in volumes of AI-powered cyberattacks
Major cyber events in 2024
Malware and malicious payload trends
Cyberattack types and targets
Vulnerability exploit attempts on CVEs
Attacks on counties – USA
Expansion of bot farms – how, where, and why
In-depth analysis of the cyber threat landscape across North America, South America, Europe, APAC, and the Middle East
Why are attacks on smart factories rising?
Cyber risk predictions
Axis of attacks – Europe
Systemic attacks in the Middle East
Download the full report from here:
https://sectrio.com/resources/ot-threat-landscape-reports/sectrio-releases-ot-ics-and-iot-security-threat-landscape-report-2024/
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/
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf91mobiles
91mobiles recently conducted a Smart TV Buyer Insights Survey in which we asked over 3,000 respondents about the TV they own, aspects they look at on a new TV, and their TV buying preferences.
JMeter webinar - integration with InfluxDB and GrafanaRTTS
Watch this recorded webinar about real-time monitoring of application performance. See how to integrate Apache JMeter, the open-source leader in performance testing, with InfluxDB, the open-source time-series database, and Grafana, the open-source analytics and visualization application.
In this webinar, we will review the benefits of leveraging InfluxDB and Grafana when executing load tests and demonstrate how these tools are used to visualize performance metrics.
Length: 30 minutes
Session Overview
-------------------------------------------
During this webinar, we will cover the following topics while demonstrating the integrations of JMeter, InfluxDB and Grafana:
- What out-of-the-box solutions are available for real-time monitoring JMeter tests?
- What are the benefits of integrating InfluxDB and Grafana into the load testing stack?
- Which features are provided by Grafana?
- Demonstration of InfluxDB and Grafana using a practice web application
To view the webinar recording, go to:
https://www.rttsweb.com/jmeter-integration-webinar
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™UiPathCommunity
In questo evento online gratuito, organizzato dalla Community Italiana di UiPath, potrai esplorare le nuove funzionalità di Autopilot, il tool che integra l'Intelligenza Artificiale nei processi di sviluppo e utilizzo delle Automazioni.
📕 Vedremo insieme alcuni esempi dell'utilizzo di Autopilot in diversi tool della Suite UiPath:
Autopilot per Studio Web
Autopilot per Studio
Autopilot per Apps
Clipboard AI
GenAI applicata alla Document Understanding
👨🏫👨💻 Speakers:
Stefano Negro, UiPath MVPx3, RPA Tech Lead @ BSP Consultant
Flavio Martinelli, UiPath MVP 2023, Technical Account Manager @UiPath
Andrei Tasca, RPA Solutions Team Lead @NTT Data
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Jeffrey Haguewood
Sidekick Solutions uses Bonterra Impact Management (fka Social Solutions Apricot) and automation solutions to integrate data for business workflows.
We believe integration and automation are essential to user experience and the promise of efficient work through technology. Automation is the critical ingredient to realizing that full vision. We develop integration products and services for Bonterra Case Management software to support the deployment of automations for a variety of use cases.
This video focuses on the notifications, alerts, and approval requests using Slack for Bonterra Impact Management. The solutions covered in this webinar can also be deployed for Microsoft Teams.
Interested in deploying notification automations for Bonterra Impact Management? Contact us at sales@sidekicksolutionsllc.com to discuss next steps.
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