fabiochiu/medium-articles huggingface dataset:
Code Smell 35 — State as Properties
By: Maximiliano Contieri
Tags: Code Smells, Clean Code, Software Development, Software Engineering, Programming

Code Smell 35 — State as Properties

Photo by Tom Crew on Unsplash

Problems

Mutability

Attributes polluting

Setters

Solutions

Model states as mathematical set inclusion. State is accidental, take it away from the object.

Examples

State diagrams

Sample Code

Wrong

Right

Detection

If we want to be extreme, we should consider every setter to be a potential state change. Linters can warn us. But we might end up getting too many false positives.

Exceptions

Over Design

Performance issues (if a serious benchmark supports it).

Tags

Mutation

Conclusion

This technique is very elegant but can lead to over design. For example changing a visual component its color should be a counterexample to this smell.

We should be aware and very caution like with any other smell.

They are hints and not rigid rules.

Relations

More info
Chapter 1: Clean Code| 無暇的程式碼
Tags: Clean Code, Programming

在開始討論 Clean Code之前，我們先來談談甚麼是 Bad Code，糟糕的程式碼。

不知道各位讀者是否為糟糕的程式碼，而陷入困擾過? 如果各位是個有點經驗的程式設計師，一定會遇到這種困擾。在這本書稱這種現象為: 沼澤(wading)。我們深陷這片沼澤。我們穿過這灌木密林、瀑布暗藏的沼澤地。我們拼命想要找到出路，期望有點線索能告啟發我們到底發生甚麼是；但眼前看到的，是越來越死氣沉沉的程式碼。

那麼，Bad Code怎麼產生的?

有可能是想快點完成工作?也有可能是因為趕時間?以上都有可能，但這不是藉口。我們或許還知道正在寫 Bad Code，但總是說服自己先做完再說，完成老闆的要求後，我們再將之變成 Clean Code。當然，在那些日子裡，我們都沒聽過勒布朗(LeBlanc)法則: 稱后等於永不(Later equals never)。

Bjarne Stroutrup, C++語言發明者。

I like my code to be elegant and efficient . The logic should be straightforward to make it hard for bugs to hide, the dependencies minimal to ease maintenance, error handling complete according to an articulated strategy, and performance close to optimal so as not to tempt people to make the code messy with unprincipled optimizations. Clean code does one thing well.

Bjarne使用到 elegant，優雅，說得好! Bjarne認為Clean Code 是很優雅的，讀起來是會令人愉悅。除此之外，本書還有訪問大神，他們對無暇程式碼的見解。綜合大師所述，我歸納無暇程式碼有以下特點:

當然還有許多規範，就好像武術家，每個流派有每個流派的武術，巴西柔道、八光流柔術、截拳道、空手道，詠春…等。任何門派都並非絕對正確或錯誤，自在人心。

回到無暇程式碼的第一個特點 可讀性。或許我們會認為，程式碼真正「讀」的成分有多少?難道主要不是在「寫」的部分嗎 ? 這本書給了例子。

Bob enters the module.

He scrolls down to the function needing change.

He pauses, considering his options.

Oh, he’s scrolling up to the top of the module to check the initialization of a variable.

Now he scrolls back down and begins to type.

Ooops, he’s erasing what he typed!

He types it again.

He erases it again!

He types half of something else but then erases that!

He scrolls down to another function that calls the function he’s changing to see how it is

called.

He scrolls back up and types the same code he just erased.

He pauses.

He erases that code again!

He pops up another window and looks at a subclass. Is that function overridden?

. . .
8 Life Lessons That Will Make You A Better Programmer
By: Erik Van Baaren
Tags: Data Science, Life Lessons, Clean Code, Software Development, Programming

3. Voodoo coding

Sometimes you fixed a bug, but you don’t understand why. We’ve all been there, more than once. I promise it’ll get better; keep learning and practicing. But never, ever leave it at this. Always make sure you understand your code. Don’t be ashamed and ask someone else if you need to.

The same holds for copy-paste code. Yup, we all use StackOverflow sometimes! But if you don’t understand the code: either don’t use it or ask someone else for help.

Creating or using code you don’t understand is also referred to as voodoo coding. It’s is a bug waiting to happen.

If you force yourself to keep going until you understand, you’ll become that senior developer much faster. Added bonus: you’ll feel more confident too.
Code Smell 33 — Abbreviations. Abbreviating is very important so that…
By: Maximiliano Contieri
Tags: Code Smells, Naming, Clean Code, Software Engineering, Programming

Code Smell 33 — Abbreviations

Photo by Jessica Knowlden on Unsplash

Problems

Coupling

Bad Naming

Declarativeness

Ambiguity

Readability

Premature Optimization

Solutions

Use meaningful and declarative names.

Examples

Variable naming

Function naming

Package naming

Class Naming

Sample Code

Wrong

Right

Detection

We can’t automate choosing what is a short name and a declarative.

Some “modern” and shinny languages enforce this bad practice. So we should wisely choose a good language instead.

Tags

Declarative

Conclusion

Computer science was born from the mother of science (mathematics). In math, the assignment of single letter variables (i, j, x, y) is a good practice.

The concept of reference arose from the variable.

Many people wondered why mathematicians can work with such short variables, and computer scientists cannot.

For mathematicians, once entered into a formula, variables lose all semantics and become indistinguishable.

Our brain wastes a lot of energy figuring out what is the meaning of an abbreviation.

It is 2020, We need to write software for humans, not for compilers.

Relations

More info
ViewState and Interactions — an easy contract between view and ViewModel
By: Mateusz Budzar
Tags: Viewmodel, Android App Development, Clean Code, Android, Refactoring

What I liked in MVP architecture approach was the interface, the contract between a Presenter and a View (yes, I was the one who created an interface for each Presenter :). In a glace I knew, what user could do on that screen and I could imagine how the screen looks like by going through methods Presenter calls on the View. Everything was clear, everything in one place.

When moving to MVVM I kind of a lost it. Don’t know why to be honest but with this new way of handling presentation layer communication I just did it differently. I decided to came back to my lovely contract. Is it possible with ViewModel ? Of course it is.

Let’s take this one as an example:

Simple Fragment example. Imagine we’ve created screen with settings that allows us to change our name, enable/disable notifications and go to other, more specific settings screens. Now let’s take a look at ViewModel .

This implementation of ViewModel is also nothing complicated. We can see there user interactions methods and couple of LiveData s for views changes. There is nothing wrong about this ViewModel . It looks pretty good, right? I’m just missing my contract… or at least some place that I could go and see what is happening in this screen. What could be changed, as simple as possible, to make me happy?

What do you say about these changes?

First, I’ve created ViewState class which corresponds to everything that could be shown on the screen, each state of each view. Now just this one class will be used to render the screen data.

Second, Interaction class was introduced. It’s a collection of interactions that user can perform on the screen.

Of course I could wrap these two classes into an interface to make it more formal and mandatory to implement by both the Fragment and ViewModel , but to not complicate this example with additional inheritance, let’s just leave it as it is, it’s simple now.

Ok, so how our SettingsFragment looks like now?

Nothing really changed, right? It looks almost the same, but now from its perspective performing actions are more similar to calling commands. Rendering view’s data also is very similar to what we had before, with the small difference — now there is just one observer and we render the state as a whole.

What about SettingsViewModel ?

Couple of things have changed here:

currentViewState — it’s a ViewState cache, when submitting new ViewState we can just change some of its properties, take a look at notificationsSwitchChanged() method;

— it’s a cache, when submitting new we can just change some of its properties, take a look at method; onInteraction() — method which handles all of the interactions;

— method which handles all of the interactions; public methods becomes private.

The rest of the code is pretty much the same.
Java Predicate
By: Kaan Ardar
Tags: Readable Code, Java Predicate, Clean Code, Java8, Java

We can think of it as a function that processes the entered parameter or parameters and returns them whether they are true or false.

- f(x) = true | false

Java Predicate Class

The predicate is a functional interface. The predicate uses for filter and I think, helps improve the readability of your code. for example one such method is filter() method from Stream interface.

/**

* Returns a stream consisting of the elements of this stream that match

* the given predicate.

*

* <p>This is an <a href="package-summary.html#StreamOps">intermediate

* operation</a>.

*

* @param predicate a <a href="package-summary.html#NonInterference">non-interfering</a>,

* <a href="package-summary.html#Statelessness">stateless</a>

* predicate to apply to each element to determine if it

* should be included

* @return the new stream

*/

Stream<T> filter(Predicate<? super T> predicate);

Sample Predicate Usage

we have a user class as below:

package sample.predicate;



import lombok.*;



@Getter

@Setter

@Builder

@AllArgsConstructor

@NoArgsConstructor

public class User {



private String id;

private String name;

private Integer age;

private String country;



}

We created a predicate class for the user class for readability.

package sample.predicate;



import sample.predicate.User;



import java.util.Objects;

import java.util.function.Predicate;



public class UserPredicate {



public static Predicate<User> findCountry(String country){

return u -> u.getCountry().equalsIgnoreCase(country);

}



public static Predicate<User> filterAge(Integer age){

return u -> u.getAge() >= age;

}



public static Predicate<User> checkNonNullAge(){

return u -> Objects.nonNull(u.getAge());

}



public static Predicate<User> filterAndCheckAge(Integer age){

return u -> Objects.nonNull(u.getAge()) && u.getAge() >= age;

}



}

You can the test class as below: we did filter country and age in the user collection.

package sample.predicate;



import java.util.Arrays;

import java.util.List;

import java.util.stream.Collectors;



public class PredicateTest {



public static void main(String[] args) {

List<User> users = Arrays.asList(

User.builder().id("1").name("kaan").age(28).country("TR").build(),

User.builder().id("2").name("Ardar").age(28).country("TR").build(),

User.builder().id("3").name("Mert").age(35).country("DE").build(),

User.builder().id("4").name("Sevki").age(32).country("GB").build(),

User.builder().id("5").name("Emre").age(35).country("FR").build(),

User.builder().id("6").name("Sinan").age(null).country("SY").build()

);



//we want to filter TR users.

List<User> trUsers = users.stream()

.filter(UserPredicate.findCountry("TR"))

.collect(Collectors.toList());



//we want to filter age

List<User> ageUser = users.stream()

.filter(UserPredicate.filterAndCheckAge(33))

.collect(Collectors.toList());



System.out.println("TR users : ");

System.out.println(trUsers.toString());



System.out.println("Filter age users : ");

System.out.println(ageUser.toString());



}



}

I wish good and happy coding. [KA]
The Future of Testing
By: Huba Albu
Tags: Testing, Clean Code, Technology, Oop, Java

Recently I was facing the issue of reasoning with people when, what and why to test. For me the answer is relatively simple: myself, as a developer, it is my responsibility to be proud of my work and I should do everything in my power to prove it so. And of course, there are more practical things too, such as why do I even bother unit tests…

If I am thinking out loud, testing is a process that applies as much to hardware as to software.

“Testing is the name given to the process of discovering if something works and if so if it works well. Testing is used in computer hardware and software development to determine whether objectives are being met.”

Long story short for me testing is all about mentality and not about the fact of writing test cases. Whenever I am talking with a PO or any other stakeholder in any setup in any company, I would like to understand the requirements. The easiest way is to start working is to have an end goal, which is represented in a unit test, for every feature request I must ask: “how do I validate this”.

Having so many possibilities like unit, functional, integration, black box, white box, smoke, sanity, system, acceptance, QA testing, and domain-specific testing, not mentioning the non-functional part, it can be hard to choose the best practices. One spends more time refactoring code than writing it, and since a pillar of refactoring are tests, I would say no matter how good one is, tests will prove you are wrong (“No amount of experimentation can ever prove me right; a single experiment can prove me wrong” — Albert Einstein).

Since unit tests are a pillar to refactoring, this whole topic is extremely dear to my heart, every week I am doing one kata style refactoring in a random language (preferably OOP capable). Doing so I had to come up with a definition for a unit and going back and forth for a long time, I’ve stumbled upon the following fact: you have to be able to run the unit test disconnected from the world, perhaps thousands of meters high on Mount Everest or on an airplane going from Copenhagen to Amsterdam. And the unit itself is anything that exyou consider as a unit, literary it can be a single line of code, a class or a functionality, merge request, etc.

Conclusion

Having a healthy mentality towards testing is essential in building responsible software. One shall not reason if tests are necessary since that is one’s responsibility. The whole idea to have separate and dedicated time for writing tests should not exist since this must be an integral part of any developer’s blood. Tests help you to ask good questions and get clear(er) requirements.
第一章 無瑕的程式碼 — Clean Code 閱讀筆記
By: Mowli 微風
Tags: Clean Code

Learn more. Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Make Medium yours. Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore
You spend much more time reading code than writing code.
By: Bayrhammer Klaus
Tags: Programming Tips, Clean Code, Programming, Refactoring

I like my code to be in order. I like my code to be easy to read and easy to understand. And I’m willing to go the extra mile to make my code adhere to those standards. But is it worth it? Is writing clean code a good investment?

When discussing this with colleagues I usually get one of two reactions: Either they care a lot about writing readable code, or the readability of code is not important to them at all. But what’s far more interesting is that usually, they have a really hard time explaining why they feel one way or another.

Especially on new teams or after major personnel changes on existing teams I’ve seen this topic being discussed more often. But I’ve also seen that this discussion oftentimes lacks objective arguments and metrics. My primary argument in those discussions is usually quoting Bob Martin.

On the one hand, I love the idea of simply comparing time spent reading and time spent writing code. On the other hand, I grew more and more curious, because I felt this ratio for me is way higher than 10 to 1. Besides if we could make this metric more objective — potentially even let individual engineers compute this metric for themselves — it would be much easier to argue for or against spending time to make code more readable.
How to implement your next project in Django using Hexagonal Architecture
By: Aristóbulo Meneses
Tags: Hexagonal Architecture, Django Framework, Clean Code, Django

Photo by Naveen Kumar on Unsplash

How to implement your next project in Django using Hexagonal Architecture Aristóbulo Meneses ·Nov 19, 2020

I’m glad you asked, the answer is very simple:

You Don’t.

There you go, I just saved you from many, many, many hours of pain.
Code Smell 28 — Setters. The first exercise junior programmers…
By: Maximiliano Contieri
Tags: Information Hiding, Code Smells, Clean Code, Refactoring, Programming

The first exercise junior programmers do. IDEs, tutorials and senior developers keep teaching them this anti-pattern.

Photo by Victor Rodriguez on Unsplash

Problems

Mutability

Information Hiding

Anemic Models

Fail Fast

Integrity

Duplicated Code

Solutions

Avoid Setters Set essential attributes on private initialization.

Sample Code

Wrong

Mutation brings lots of problems

Information Hiding Violated

Right

Detection

First step will be to forbid public attributes (if language allows them).

Secondly, we will search for methods setXXXX(), analyzing method structure (should be an assignment to attribute xxxx).

We should not forbid methods setting accidental state since this is valid. They should not be named setters since they ask the object to change, but they don’t set anything.

Examples

DTOs

Exceptions

Setting attributes is safe for non-essential attributes.

Essential behavior is what distinguishes one object from another.

It is related to behavior and not data. It’s not a primary key definition.

Some patterns, like Builder require setting the parts in a controlled, incremental way. Validations are done at the end and the real entity metaphor requires it.

Setting accidental values has many drawbacks and considerations already mentioned.

Tags

Mutation

Information Hiding

Conclusion

Creating incomplete and anemic objects is a very bad practice violating

mutability, fail fast principle and real world bijections.

Relations

More Info

Here is the full discussion on Setters
Clean code exercises — part 1. You’ve probably read and listen a lot…
By: Eder Diaz
Tags: JavaScript, Code Review, Clean Code, Programming

Illustration by Ivan Haidutski from Icons8

You’ve probably read and listen a lot about Clean Code and probably you’re tired of acronyms like YAGNI, DRY and KISS. All of this usually goes directly to your brain’s recycle bin because you don’t practice it enough.

After years of reading other people’s code in code reviews, I’ve developed an ‘eye’ to catch bad code, and I think you can develop it too by reading the scenarios I’ve designed.

The following examples aren’t necessarily flawed code, I mean, imagine they don’t have any bugs and they do the job, but the aren’t as maintainable as they could be. Read each example, try to identify the problem and imagine what would you do to solve it.

(don’t read until you are done with above’s code)

The problem in this example is the arbitrary numbers that are being used in the if statement. Because of the method context you might infer that 21 is the legal age to drink and 20 is the beer price, but this isn't too straight forward at first sight. These are usually called magic numbers .

One way to solve this is creating named constants for the numbers. This makes it easier to read.

Also if in the future something changes, like the beer price, it will be less prone to error by changing the constant value instead of finding and replacing the appearances of 20 .

(Remember to try to identify this by yourself first) There’s too many things happening in that return statement. The person that wrote this might thing is clever to use idiomatic features to solve things in a line or a couple of lines of code, that’s why this is called clever code .

Just be explicit on what is the intended behavior and make it easy to read, even if that means splitting the code into more lines.

There were many refactoring steps between the example and the solution, but I assure you that both have the same behavior.

If a peer defends their clever code by saying that the solution is making the application become larger, that’s likely not true, most modern languages when compiled or minified will be smaller than any clever code created by a human.

This method has too many responsibilities. Whenever someone adds a new shape also a new if/else statement will need to be created. Also in this case the area calculations are one liners but if they become more complex, for example to validate the inputs, this method would become huge.

Separate them into strategies with their own method, this way if they grow in size they’ll be easier to maintain.
Code Smell 27 — Associative Arrays
By: Maximiliano Contieri
Tags: Code Smells, Arrays, Software Development, Clean Code, Programming

Code Smell 27 — Associative Arrays

Photo by Melissa Askew on Unsplash

Problems

Coupling

Information Hiding

Code Duplication

Fail Fast

Integrity

Solutions

Reify objects Create cohesive small objects Don’t leave them anemic, find their cohesive relations.

Sample Code

Wrong

Anemic

Validated

Right

Degrees deserves reification

Many people suffer from primitive obsession and believe this is over design. Designing software is about making decisions and comparing trade-offs. The performance argument is not valid nowadays since modern virtual machines can efficiently deal with small short-lived objects.

Detection

We cannot forbid Associative Arrays since they are very good as a first approach.

They will be fine for exporting data, serialization, persistence and other accidental implementation issues.

We should avoid them on our systems.

Tags

Primitive

Conclusion

When creating objects we must not think of them as data. This is a common misconception.

We should stay loyal to our Bijection and discover real world objects.

Most associative arrays have cohesion and represent real world entities, and we must treat them as first class objects.

Relations

There’s nothing more permanent than a temporary hack.

Kyle Simpson
Give a new lease of life to src/test/java
By: Puneet Wadhwa
Tags: Junit, Unittest, Clean Code, Assertj, Java

Before I start a quick question to all of you; So how many of you were excited to switch to new functional paradigm of programming in Java? I was very excited when I started learning the more declarative way of doing things. I liked the idea of telling what to do and not baby sit and tell how to do everything. I promised myself there is no going back to the old procedural style anymore. I was very happily replacing my old code with new found streams and lambdas. Until after writing all the new code and I sat to write test cases. That’s when euphoria faded away and I realised that I am back in the procedural world minutes after promising myself there is no going back.

My simple test case was I need to verify that my method under test is returning 3 persons and I need to verify their names, gender and age. With the tools in hand I only came up with following code:

List<Person> result = getPersons();

assertEquals(3, result.size());

for(Person person: result) {

If(person.getName().equals(“Harry Potter”)) {

// do 4 assertions for Harry Potter — Name, Gender, Age, hasMoney

}

If(person.getName().equals(“Ron Weasley”)) {

// do 4 assertions for Ron Weasley

}

If(person.getName().equals(“Hermione Granger”)) {

// do 4 assertions for Hermione Granger

}

}

Or I thought of using Streams and filters but then test case quickly became as complex as the code being tested.

And then I learned about AssertJ the fluent assertions library and boy I was impressed in first look. I can use fluent assertions to write my test code and no more procedural code. It was very easy to write the previous test in much better looking code with AssertJ.

List<Person> result = getPersons();

assertThat(result).isNotEmpty()

.hasSize(3)

.extracting(Person::getName, Person::getAge, Person::getGender)

.contains(

tuple(“Harry Potter”, 11, “Male”),

tuple(“Hermione Granger”, 12, “Female”),

tuple(“Ron Weasley”, 13, “Male”)

);

Clean, Precise and more importantly declarative. If you are still not impressed carry on reading.
Clean Code: Introduction
By: Ollie M
Tags: Development, Clean Code

Two years ago I have switched from Java/Kotlin Android development to JavaScript Full Stack web development. Because of that I have a lot of new insights that I want to share with the reader. One of the biggest realizations I have had is no matter what platform or language or framework you are using, the fundamental Clean Code principles DO NO CHANGE.

These series is dedicated to [re]discovering the Clean Code principles. Strongly influenced by “Clean Code” by Robert C. Martin, I will be covering the most important principles to writing clean, readable and maintainable code.

Good developers are modern craftsman. Knowing how to make your code do what you want it to do is easy. Making that code maintainable is the real challenge. As new abstract languages and frameworks are created, and as number of programmers doubles every 5 years, knowing how to write clean code is the most important challenge for any developer.

Good code matters!

Working mess is NOT better than nothing. It is actually worse. Bad code can bring a company down, it can bring a network down. Bad code costs money and if the code is mission critical, it can cost lives. Recent incidents with Boeing MAX has showed us the dangers of bad code.

Make it Right!

“Going back to clean up the code” usually means NEVER. How many times have you sworn to go back to clean up and refactor the code, to find yourself months later cursing the mess it has snowballed into. The messier the code the more productivity is lost while adding new features. Every developer spends extra time trying to works with messy code. It might take longer to write clean and thought out code from the start but in the long run its exponentially more productive for the future development on that code base. Messy code requires developers to understand the entire code before making any changes. Productivity pressure makes the developers make a bigger mess over time. So redesigning the code takes more time and effort than keeping it clean from the start.

Attitude is key!

Unprofessionalism leads to bad code. Managers obsess with schedule, good developer obsesses with good, quality code. The only way to consistently meet deadlines is to keep the code as clean as possible. Messy code will bring projects to a snail pace and cause developers to miss deadlines.

What should it look like?

Code has to be “elegant” or pleasing to look at.

Must do one thing well. Bad code tries to do too much.

Restricts to only one way of doing a thing rather than many.

Looks like it was written by someone who cares.

Small abstractions help move fast and change underlying implementation if needed.

Ratio of reading code to writing code should be actively lowered.

Code that is easy to read is easy to work with.

Hopefully this introduction convinced you of the importance of writing good code, and gave you some ideas to get your started. In the next post we will be covering specific techniques and rules to help you write clean code.
heuristics & software development
By: Sebastian Messier
Tags: Clean Code, Software Development, Software Architecture

Photo by Ben Pattinson on Unsplash

There are various heuristics we use to drive towards the north star of clean code. In this short essay I touch on a few heuristics, while trying to answer the question — why do these heuristics exist in the first place?

Some classic examples of clean code heuristics are :

Writing files with no more than n LOC

LOC One File per Class

Don’t Repeat Yourself

Build components that are self contained & independent

I recently had a debate with a friend who disagreed with these principles. It made me question the nature of these heuristics, and why they even exist in the first place. After working in the industry for a while now, I have a feel for why these conventions exist.

Photo by Javier Allegue Barros on Unsplash

Reason 1: It is much more efficient to tell someone what to do, than to have them go figure it out

It’s virtually useless to tell someone to “go and write clean code”. A sensible response to such a demand would be “What exactly do you mean by that?”. To aim for clean code is to aim for an abstract concept. These heuristics ground that aim in actionable tasks.

Take this for example — How can a file be cleaned? We can start by checking a couple of things:

is it a large file?

are these methods too alike?

is the language being used idiomatically?

Addressing these concerns will slowly chip away at complexity, and in their sum can tend to result in clean enough code. By following these simple rules of thumb, your code will on average be considered “clean” by some!

Photo by Brett Jordan on Unsplash

Reason 2: Reading complex code is mentally tolling

Complexity is reviled. Ask any developer, “ Would you rather work on a legacy spaghetti monolith, or a well oiled project? “. None will opt for the spaghetti monolith, because the well oiled project is easier to work with.

I’ve spent my fair share of time treading through the muck of legacy spaghetti code. Many of the issues I’ve come across can be addressed by a couple of these heuristics. DRY and Separations of Concerns alone would have saved me well over half of the headaches I’ve endured.
Code Smell 26 — Exceptions Polluting
By: Maximiliano Contieri
Tags: Programming Tips, Code Smells, Exception Handling, Clean Code, Software Development

It is very nice to have lots of different exceptions. Your code is declarative and robust. Or not?

Problems

Over Design

Namespace Pollution

Solutions

Avoid creating anemic exceptions as globals. Create exceptions only if they behave differently. Model exceptions with objects. Classes are handy for lazy programmers.

Sample Code

Wrong

Right

Detection

New exceptions should override behavior methods.

No. code, description, resumable, etc are not behavioral.

Tags

Abuser

Naming

Conclusion

You would not create different classes for every Person instance, so they return different names. Why would you do it with exceptions.

How often do you catch a specific exception?.

Go out and check your code.

Is it necessary to be a class?

You are already coupled to the class. Couple to the description instead.

Exception instances should NOT be Singletons.

Relations
ERP SOLUTION FOR NGO AND NON-PROFIT ORGANIZATION
By: Bargad Labs
Tags: Ngo, Erp, Organization, Solutions, Non Profit Organization

We at Bargad labs empower Non-profit organizations by providing Technical solutions with the lowest minimum cost.

Our ERP systems can bring an enormous amount of benefit to the non-profit organization. Faced with managing administrative systems, financial systems, and personnel (both employees and volunteers) across different countries and cultures, Nowadays diversity and multicultural transactions help NGOs to grow and sustain and keep their motive intact, NGOs depend on IT systems to keep their organization together and functioning. Add this need to a backdrop of stringent multinational regulations and transparency obligations (in both public audits and funding requests), and it’s clear that an ERP system might be just the thing to make the whole shebang run smoothly.

India has around 3.2 million registered non-government organizations, Approximately 1.5 million NGOs operating in the United States, In South Africa alone, there are more than 100,000 registered non-profit organizations and in Kenya, the number of NGOs grew by over 400% between 1997 and 2006. These organizations comprise churches, civic leagues, private foundations, public charities, and more. Every organization possesses an area of operational concerns. These are about ways of assembling resources and distributing them to everything that comes in between the process.

We offer :

Our NGO Software is developed to promote transparency and accountability in the NGO sector. It is FREE for smaller NGOs with less than 5 staff and not more than 5 payment transactions per month. For others, we have customized plans.

This solution includes the following :

Beautiful Informative Website for NGO. Month Free Digital Marketing Payment Gateway Integration ( Razorpay ) Complete Backend ERP system, Be it tracking members, donors, and volunteers or recording and receiving grant applications — Our Solution handles everything On-Demand Mobile apps for Volunteer, Doner, Administrator

Kindly review our Non Profit Product Presentation for better understanding.

The benefit of Using ERP In a non-profit organization

Listed below are a few more advantages of nonprofit ERP:

Creates transparent processes across the organization

Modernises back-end administrative processes through rule-based workflows

Offers secure back-end tracking, processing, and reporting of donations for audit and regulatory purposes

Improves decision making with quick, real-time financial information

Reduces data redundancy for more effective programs

Minimizes errors by automating processes

Contact for Consultation :

India: Shibam Goswami

Director of Marketing

Ph : +91 8017730566

shibam@banyanss.com

Skype : shibam555

US: Mr. MANISH VYAS

Director of Marketing

PH : +1 (289) 214–2507

manish.vyas@bargadss.com
You Plan and God Laughs get it together
By: Jaclyn Strauss
Tags: Preparation, Peace Of Mind, Organization, Solutions, Family Planning

I was literally caught like a deer in headlights on Friday, March 13, 2020. It was one of the worst feelings of my life given that I am a HUGE planner and like to believe that I can control everything that I touch.

Growing up my mother always said to me, “Jaclyn, you PLAN and God laughs.” I am not sure if I should have taken that advice as a gesture of tough love or a harsh wake-up call that my Type A personality needs to simply go with the flow. I like to plan, and I can’t apologize for it.

However, in 2020, I have been reminded that I can’t ALWAYS plan. I started to think about some other times in my life that I simply could not plan and had to just “go with it” and brace myself for the end result in hopes it was a positive one.

1. Thinking that my first love in high school was going to be my forever and one and only for the rest of my life — ya, NO he dumped me post-college and I was heartbroken!

2. Signing on for my first accounting job pre-graduation at Arthur Anderson the year Enron and the accounting firm fell — yep out of my first job before I could even start it.

3. Thinking I would practice accounting as my career and then stumbling on the book “Who Moved my Cheese” and completely changed career paths — Wow did my father not “approve.”

4. Having a perfectly prepared birth plan for my second baby and delivery ending in a post-delivery hemorrhage — this is where I flirted with a near-death experience.

5. And many more…

This reflection has been a good exercise for me in which I encourage anyone to do, especially your Type-A’s and one where I have concluded that yes I may not be able to perfectly PLAN but I can PREPARE to the best of my ability and hope the outcomes are more than desirable.

So what does a Type A personality, passionate, planner like myself do?!?

1. Take a step back and just breathe (I can’t even believe I am writing this but I swear it worked for me).

2. Begin to allow others to help you and stop turning down offers of assistance (Stop creating monsters in your life by just doing things for them because it’s more time-efficient if you did it yourself then stepping back and letting them do it themselves).

3. Find the right tools available to leverage to streamline your life and help prepare for any opportunities or challenges that may come your way (Yes I said OPPORTUNITIES — we always don’t need to approach things as doom and gloom).

4. Be willing to spend money where the benefit of what you are purchasing outweighs the headache of starting from scratch yourself. (Yes, I said it pay to play if it means peace-of-mind and less on your plate and for me, these are SERVICE-related purchases).

I vow to work to not be that deer in headlights again via better preparation as, to be honest, it was not a “cute” site for anyone’s eyes including my own, and certainly not for my two young children.
In a bubble of blissful ignorance
By: Maria De La Rosa Baumann
Tags: Sense Of Direction, Organization, Social Justice, Personal Development, Enjoying Life

Photo by Hiroshi Tsubono on Unsplash

I remember many years ago; I worked in sales in the flower distribution business. Things seemed to be normal — Some areas in the country struggled, and several companies had to close. Then there were other states which appeared to do very well (I remember Texas)

My life was busy with household, kids, etc., no time or interest to listen to the news. Customers were telling me it was slow — they always did — I strategized with them how to increase business. That year I had the best sales result ever! Then I heard on the news that the recession was officially over. WHAT??? Incredibly I never noticed that there was a recession. I learned an important lesson: We don’t have to know everything. Many times it is better to be ignorant.

Now during this Coronovirus 19 pandemic — I am fatigued — I am ready to create a bubble for myself. I no longer need or want to listen to the news. I listened to enough differing opinions to last me for the next few years. I reached the conclusion that the virus will not disappear. We need to learn to deal with it. Just like with any other virus. Using common-sense — if we can remember we have one — will go a long way. Taking personal responsibility and encouraging others to do the same.

Let’s go back to work, go back to school! I am in the high-risk category. I have traveled during this pandemic to different states — coming back to Miami and continue flying to Santiago, Dominican Republic. My kids were freaking out. But I and my husband are doing fine.

We have created our own routine and protocol which we can live with.

I am beginning to wonder as to how long we will be required to wear masks. It seems people are getting now so used to it that wearing a mask becomes a fashion statement like sunglasses. Well, I am fine with it. Wearing a mask doesn’t bother me since I don’t have to work. I keep my outings to a minimum. We go to restaurants which have plenty of outdoor space. The Dominican Republic is a great place for that. We avoid busy times.

Now back to my bubble. Elections !!! It is increasingly difficult to find out the facts. So much is dis-information — how to sift through it all? I have worked hard to find a few reliable sources of information. I dedicate at least an hour daily to learning new things; learning to understand different viewpoints.

It is so easy to follow opinions (because we like what we hear) However, we better get a grip on reality as it is not as we want it to be. I designate a certain amount of time to deal with this reality as best as I can. The rest I spend in my “Bubble”. These exercises have proved invaluable for my mental health. I encourage the reader to give it a try.

Maria De La Rosa Baumann

Entrepreneur, Advocate for Social Justice
Have a Central Place for Your Best Ideas
By: Josh Spilker
Tags: Writing, Motivation, Writing Tips, Organization, Creativity

Have a Central Place for Your Best Ideas

Photo by Юлія Вівчарик on Unsplash

You get an idea, and you have no place to write it down.

“I’ll remember it…” you tell yourself.

But you should know yourself by now, and you are a liar.

You won’t remember the idea.

1. You need to write down your ideas.

You want to quickly add them so they don’t escape your focus or attention.

Initially, use a piece of paper. Or your note-taking app.

That’s good. However…

2. Take it a step further and add it to your docs editor

You want to eliminate friction for your best ideas and keywords.

That involves getting your ideas to the place where you actually write and iterate on your ideas.

That could be your notebook. It could be Google Keep. More than likely, it’s Google Docs, a Word document, or in my case, I’m using Notion more and more to write.

It could also be your project management app, spreadsheet, Google drive, or company wiki.

3. Organize and set a calendar

After this, you’ll want to prioritize your ideas. Flag them, tag them, number them, color code them, whatever. As long as you have a system for knowing what’s priority number one and then moving on from there.

If you write on multiple topics for multiple blogs (like me!) you’ll need different work areas. If stuff is on deadline, integrate your publication calendars or set reminders for yourself.

On a personal blog? Do this anyway.

Some of you may think you’re still small time to organize your writing like this. Okay, that’s fine. Then I can tell you aren’t a serious writer.

Because serious writers know inspiration will run dry. And that they need a well of ideas. And it’s even better if those ideas are well-organized.

There are tons of free tools to do it.

What’s stopping you from organizing your research and content ideas?
Happy Hours with Boss
Tags: Writing, Motivation, Relationships, Boss, Organization

Happy Hours with Boss

Photo by Hannah Nicollet on Unsplash

Weird things about bosses that you cannot select your boss. You have to accept who they are. The employees do not stay in a company just because their bosses are good but because of their organization.

You may have two choices ‘A good boss in bad organization’ and ‘a bad boss in good organization’.

Now, why we are talking about bosses? This is definitely that we all are looking for happiest time everywhere and mostly at our workplace where we spend most of our time after our family.

A good boss always supports their juniors, colleagues and other staff members and try to make them happy and also encourage and motivate them so they can grow, learn and become leaders in future. They also know, why their colleagues should have a happier work environment.

Now we come too other parts. Sometimes we have to also deal with bad bosses. Bad boss may also teach a lot but it depends on us how to deal with them. Sometimes, you think that they are bad not but actually they not. They only don’t want to compromise on quality.

It is rare for employees to have a happy time with their bosses. But sometimes even bad bosses can surprise you by making you happy.

Can you think about tomorrow morning when you go to office with all planning to complete all your pending works, you have also meetings and also have report to your boss. You have a boss who doesn’t want to hear a ‘No’. But you are surprised because your boss has reached before you. You even can not remember when he came before you last time.

He gives you some chocolates, roses, gifts and ask if everything is okay. How is your family? What is the special way that you are celebrating Christmas and New Year.

Do you think an employee continues to work because of a good work environment or because of a good boss?

An employee values both work environment and a good boss. However, if he gets better opportunities, he will change and he will maintain the relationship with the boss even from the other job.

Relationships matters! Jobs also matter but family constraints and pay package matters also.

Major takeaways are that a bad boss may actually be good at heart but he forgets while he is working as he thinks only of benefiting his organization. An employee values him because he learns a lot from him. However, sweet words do matter and sometimes that is encouragement for employees. Moreover no organization is permanent. It is dynamic and change can be made for better opportunities.

Thank you Dr. Preeti Singh, Dr Mehmet Yildiz, Dr Michael Heng, Liam Ireland for all your support. I keep on reading your stories.
Chaos
By: Lucian Lucia
Tags: Butterfly Effect, Genesis, Quantum Physics, Organization, Chaos Theory

Even in “madness”, sanity lurks

Einstein complained that the advent of quantum theory posed an existential conundrum for science. How could a reasonable person reconcile a theory that invokes probability / stochastics to describe the complex and seemingly ordered nature of physical phenomena? However, even Einstein began to grudgingly acknowledge in the existence of “spooky” science. Spooky science is at a fundamental level a transition from a very logical paradigm that we can describe perfectly to one that beggars the imagination with its physical convolutions. We began to talk about “uncertainty” and the importance of the observer, i.e., their pivotal role in “influencing” a measurement. One mathematic platform that represents the
Great article!
By: Oleg Andreyev
Tags: Microfrontend, Organization, Vue, React

Great article! But even with MFE you are still limited with single framework, otherwise no reusable components, no reusable runtime, no communication between apps at runtime (unless you implement message bus at root app and implement corespondent for each framework). You can implement MFE using iframe, but need to understand performance penalties.
2020小组年会
Tags: Annual Meeting, Organization, Annual Report

Our Annual Meeting-2020

12/20/2020 SUN 10:30 (PST)

— — — — — — — — — — — — — —

【欢迎加入理性讨论小组】

*Welcome to Discussion et Rationalié*

理性讨论小组微信公众号· Our WeChat Platform: 搜索“理性讨论小组 ”（Le_Debat_Rationnel）

理性讨论小组Medium账号· Our Medium Account: https://medium.com/@taolunx

理性讨论小组YouTube账号· Our YouTube Account: https://www.youtube.com/channel/UCaK1iJJGeIKw-mZ7BLcO3ZQ

理性讨论小组新成员加入表格 · New Member Form: https://docs.google.com/forms/d/e/1FAIpQLSfSt3LESds93GBMCoKZ1RPARcXLxsr4rDmcdagHMV_TI0Y9Eg/viewform
Kyber Organization and Decentralized Trade
By: Priyanka Chopra
Tags: Organization, Kyber, Decentralized

There are more than 2,000 digital currencies in presence now and in all actuality huge numbers of these tasks will stop to exist in ten years. Indeed, some crypto ventures have fizzled and many will come up short. Then again, a portion of these blockchain ventures have additionally endure unfathomable chances and many have proceeded to hold a spot among the top-performing cryptographic forms of money in presence.

http://www.daikimaru.jp/fut/videos-Persepolis-v-Ulsan-Hyundai-Afc-jp01.html

http://www.daikimaru.jp/fut/videos-Persepolis-v-Ulsan-Hyundai-Afc-jp02.html

http://www.daikimaru.jp/fut/videos-Persepolis-v-Ulsan-Hyundai-Afc-jp03.html

http://www.daikimaru.jp/fut/videos-Persepolis-v-Ulsan-Hyundai-Afc-jp04.html

http://www.daikimaru.jp/fut/videos-Persepolis-v-Ulsan-Hyundai-Afc-jp05.html

https://phoenixvilleseniorcenter.org/kov/videos-Persepolis-v-Ulsan-Hyundai-Afc-jp01.html

https://phoenixvilleseniorcenter.org/kov/videos-Persepolis-v-Ulsan-Hyundai-Afc-jp02.html

https://phoenixvilleseniorcenter.org/kov/videos-Persepolis-v-Ulsan-Hyundai-Afc-jp03.html

https://phoenixvilleseniorcenter.org/kov/videos-Persepolis-v-Ulsan-Hyundai-Afc-jp04.html

https://phoenixvilleseniorcenter.org/kov/videos-Persepolis-v-Ulsan-Hyundai-Afc-jp05.html

https://phoenixvilleseniorcenter.org/kov/video-a-v-b-liv01.html

https://phoenixvilleseniorcenter.org/kov/video-a-v-b-liv02.html

https://phoenixvilleseniorcenter.org/kov/video-a-v-b-liv03.html

https://phoenixvilleseniorcenter.org/kov/video-a-v-b-liv04.html

https://phoenixvilleseniorcenter.org/kov/video-a-v-b-liv05.html

https://www.harmonyrelo.com/nuw/videos-Persepolis-v-Ulsan-Hyundai-Afc-jp01.html

https://www.harmonyrelo.com/nuw/videos-Persepolis-v-Ulsan-Hyundai-Afc-jp02.html

https://www.harmonyrelo.com/nuw/videos-Persepolis-v-Ulsan-Hyundai-Afc-jp03.html

https://www.harmonyrelo.com/nuw/videos-Persepolis-v-Ulsan-Hyundai-Afc-jp04.html

https://www.harmonyrelo.com/nuw/videos-Persepolis-v-Ulsan-Hyundai-Afc-jp05.html

https://www.harmonyrelo.com/nuw/video-a-v-b-liv01.html

https://www.harmonyrelo.com/nuw/video-a-v-b-liv02.html

https://www.harmonyrelo.com/nuw/video-a-v-b-liv03.html

https://www.harmonyrelo.com/nuw/video-a-v-b-liv04.html

https://www.harmonyrelo.com/nuw/video-a-v-b-liv05.html