Feeling like your coworkers don’t want to communicate??

Hey everyone,

Short post, but ever come across people that you feel are toxic? Especially with those who think they are right almost all of the time?

Yes, there are such people who we sometimes will have to deal with. The big egos are what gets others feeling left out, and yet it’s hard to communicate with. They’ll tell one thing, and then in the next hour or 2 they will say something else.

Yes, we should always strive for the simplest solution, but sometimes what we perceive as simplest is not enough.

Sometimes it is best just to suck it up, try and do what they want, and then move on.

Of course, do what they want in the simplest solution. I wouldn’t worry too much about it since designs can usually change anyway, as there is always going to be something that they won’t like.

Just make sure that you are working on yourself since the value of who you are should be to make sure that everybody is happy with what you’re doing. Pushing forward is the best thing for yourself no matter the situation. Just remember to program happily and live well!

That’ all I have, so until next time!

Brian.

My code is… hard to understand???

Hey everyone,

Ever had this one time when a person comes on a project and merges in your code, but at the same time he or she doesn’t exactly understand why something is written that way?

For example, you’re preserving a variable to use it in other methods since only one method gives you some parameter that you can use?

To an extent, we all do it all the time. However, it has to be done with good purpose. Otherwise if there’s no point, then don’t do something that’s extra and unnecessary.

It’s fine to make quick fixes, but at the same time minimize with diverging what an API gives you out of the box.

Therefore, being smart about doing something is not enough to go about solving problems. If there’s a way to do it via an API, then it should be done that way.

I’ve been told times that things should be done the way they need to be done, and the constraint should follow with the system.

Another example: there’s an Android design that you’ve been given, however it is not something viable via the Material Design guidelines.

Just like Apple, Google will frown upon doing something entirely outside of the specs given. Therefore, if you want your app to be featured, then make sure it is strictly within specs.

People who have iOS experience strictly enforce the rule of following the specs, and therefore coming to Android they’ll follow what is given in its API at the same time.

This makes sense for the next developer to also follow along with your code so that everybody can be productive at the same time.

I’m not saying don’t make the app outside of the specs if there’s some difference of about 15%. There are exceptions to this rule, but if you’re out of bounds, then it’s best to start rethinking how you’re writing your app.

That’s all I have and I hope this helped you to write something better. Leave comments below for questions or suggestions.

Until next time!

Brian.

Be the best that you can be!

Hi guys!

Today is mostly just to express my thoughts out loud.

I was invited to a late night party last night with a friend of mine who also happens to be a software developer. The party consisted along with his relatives. We work in the same building, but just in different companies.

I joined in and had a pretty good time. That was how I felt to myself. We played pool, both my girlfriend and I did our best to socialize, but most of all I just wanted to relax and think about how work is pretty awesome.

One of his younger cousins also introduced himself to me. He seemed quite friendly, quite active, quite loud, and for sure is very talkative. He thought something was amiss that I didn’t have a good time because I wasn’t smiling.

Maybe it was because that was his first impression of me and just thought of it that way.

I was thinking that it could possibly be due to how scientists and engineers usually like to think about problems, whether they will be about work or about something else. My friend really had a good time! He had to ask about how I was doing as well, and truthfully I couldn’t complain about anything.

I guess thinking more logically, I think that smiling should come along with a purpose. He gave me his cousin’s thoughts.

There were plenty of reasons that I couldn’t smile enough. First, I was thinking about work. Second, I had not slept late in a long time. Third, I of course was tired and couldn’t socialize at my maximum.

This got me thinking that developing good habits are important to a person’s health. Now that I’m an early bird, it probably helps me develop my thinking into a specific pattern and reorganizes myself. However, different people have different perspectives to good and/or bad habits. But the good habits for me helps with efficiency.

That’s all I have for today. Leave some thoughts in the comments below and share them as well.

Until next time!

Brian.

An introduction to LINQ

Hello there!

Once upon a time, somebody told me the notion which “LINQ can do anything!”

For those who have not yet used LINQ, the basis of it is to transform a collection (e.g. arrays, lists) into another form of collection, or filter out from a collection.

So what needs to be done in order to use it? I will have faith in which almost everybody knows how to use SQL. We don’t need to do anything complicated, just on a very base level of knowledge will be fine. Keywords that should be familiar are from, where, select.

Let’s jump to it. Say that we have a list of strings with such names:
Hugh, Lisa, Shawn, Pamela, Anthony

Now let’s say we want to filter out Pamela. For most Java only thinkers who would probably write a method to do that (I used to be such a person myself), which looks like


public List FilterFromNames(List originalList, string filterName)
{
var list = new List();
foreach (var name in originalList)
{
if (name != filterName)
{
list.Add(name);
}
}
return list;
}

We will be returned a new collection modified from the original list that we have passed in, and say we called var modifiedList = FilterFromNames(myList, "Pamela");. However in any production-code, we’ll want to try and avoid something like the above since if we’re just going to make a function for one thing, then it should be something viable like passing in a username and password field for different applications.

Instead, we can use LINQ for pretty much the same purpose. Let’s do that and try and get an understanding of an under layer of how it works. There are two types of LINQ: method and comprehension.

In method syntax, we’ll rewrite the above like so:
var modifiedList = myList.Where(name => name != "Pamela").Select(name => name).ToList();

Let’s look at what’s happening here. Since LINQ supports any collection and using any of its methods will return an IEnumerable collection type, our modifiedList is just that as we are calling Where(). Within our function argument, we have a lambda with a variable which we call “name”, and we’ve also explicitly said it is not the same as “Pamela”. From here, we’ve done a selection by calling Select(), also returning an IEnumerable. We also have a lambda with a variable called “name” here, and we return everything that we need as the selection is run.

Really, we don’t care what variable is named in our lambda functions, but I purposely made it readable for viewers. However, we can write it like this and still yield the same result:
var modifiedList = myList.Where(x => x != "Pamela").Select(y => y).ToList();

Or, if any reason it is preferred to write comprehensively, this will yield the same result:
var modifiedList = from x in myList where x != "Pamela" select x;

And there you have LINQ in a nutshell! 🙂

Until next time!
Brian.