Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 36 additions & 34 deletions _posts/2021-10-25-two-years-in-linux.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ redirect_from:
## Interactions with other operating systems

Since my childhood, I used many versions of Microsoft Windows. When I went to
college I didn't have much money, so I bought a cheap windows laptop which did
college I didn't have much money, so I bought a cheap Windows laptop which did
the job. I have screwed it up by spilling beer on it, which resulted in a fried
logicboard and me nearly losing my college assignment work. This was a great
logic board and me nearly losing my college assignment work. This was a great
opportunity to build a much better spec PC, so I bought all the components and
built my first computer, which in theory was able to run macOS (and become a
hackintosh) - though that happened much later. I installed Windows 10 on it and
Expand All @@ -25,25 +25,25 @@ concerns expressed by other people on the Internet around the time when Windows

Around that time I also bought my first iPhone and I immediately fell in love
with it. I decided to try out one of the iMacs in the university library and I
decided to give a hackintosh route a try. Somehow I managed to get it installed
and I could tell that macOS was much more polished that Windows, which made me
not want to touch Windows ever again. I also bought a MacBook which I still
regard as a great machine.
decided to give the hackintosh route a try. Somehow I managed to get it
installed and I could tell that macOS was much more polished than Windows, which
made me not want to touch Windows ever again. I also bought a MacBook which I
still regard as a great machine.

### My gripes with macOS

I think macOS is a great OS for an *average* user. It gets unnecessarily
complicated any time you want more control, or you want to do something your way
instead of the Apple way of doing things. Because macOS doesn't come with any
package manager, you need to rely on very slow [homebrew][1] package manager.
Everything you download and want to install needs to be approved time after
time. There is also no easy way to bootstrap your development environment easily
package manager, you need to rely on the very slow [Homebrew][1] package
manager. Everything you download and want to install needs to be approved time
after time. There is also no easy way to bootstrap your development environment
(tweaking system settings on a new machine etc.). To give an example, one week
ago my girlfriend asked me to help her install LaTex on her macbook. I thought
installing it via hombrew will all that's needed. Turns out that once you
ago my girlfriend asked me to help her install LaTeX on her MacBook. I thought
installing it via Homebrew would be all that's needed. Turns out that once you
install it, you need to add it to path manually, which didn't work in my case,
and I had to install it by downloading MiKTeX distribution from a website, which
solved a problem. And of course any installed that you download form the
and I had to install it by downloading the MiKTeX distribution from a website,
which solved the problem. And of course any installer that you download from the
internet is treated as if it was a high security risk that requires you to
confirm that you want to open that file.

Expand All @@ -53,23 +53,24 @@ I think I started getting more and more intrigued by using Linux when I picked
up web development. I decided to look at different distributions and pick one to
run on my old laptop; I remember trying out [Ubuntu][2], but I really didn't
like GNOME desktop environment, so I decided to give [Linux Mint][3] a try.
Although my laptop was fairly old and it only had 4GB RAM, it works surprisingly
fast. All the tools I needed worked like on any other OS, so I decided to start
install it on my hackintosh and dualboot alongside macOS. For that task I picked
up [Majaro][4] with [KDE desktop environment][5]. I liked it so much so that
each time I had to choose between macOS and Linux, I'd go for the latter. About
a year ago I build a new PC exclusively for Linux so I can do all data science
projects I want on it. Right now I'm running [Arch Linux][6], which is a very
minimalist distribution. I will discuss my choice in future posts. After using
it full-time for about a year here's what I do and don't like about.
Although my laptop was fairly old and it only had 4GB RAM, it worked
surprisingly fast. All the tools I needed worked like on any other OS, so I
decided to start install it on my hackintosh and dualboot alongside macOS. For
that task I picked up [Manjaro][4] with [KDE desktop environment][5]. I liked it
so much that each time I had to choose between macOS and Linux, I'd go for the
latter. About a year ago I built a new PC exclusively for Linux so I can do all
data science projects I want on it. Right now I'm running [Arch Linux][6], which
is a very minimalist distribution. I will discuss my choice in future posts.
After using it full-time for about a year here's what I do and don't like about
it.

## The good

Linux is the best operating machine for software development. Due to having a
Linux is the best operating system for software development. Due to having a
robust package manager built into a distribution, you can easily get the
software you need and manage your updates. Some of the best development tools
were written with UNIX machines in mind, so programs like Emacs work much better
that they do on Windows or macOS. Some other applications like Docker were
than they do on Windows or macOS. Some other applications like Docker were
written on and for Linux specifically, so everything works much better here.

I like the fact that there is so much variety when it comes to different desktop
Expand All @@ -86,18 +87,19 @@ whatever you like with your system. Linux won't start calling home all of a
sudden and even if it did, people would be able to notice this and remove that
part when compiling a kernel.

Lastly, Linux doesn't suffer from all malware and viruses that are created for
Windows, so your environment is much safer.
Lastly, Linux doesn't suffer from all the malware and viruses that are created
for Windows, so your environment is much safer.

## The bad

The only drawback that I experienced from using Linux day-to-day is the fact
that big proprietary applications such as MS Office and Adobe aren't available.
This is not an issue with the operating system itself but people and many
industries are used to certain type of workflows. My dayjob relies heavily on
MS365 and it would be difficult to do some of that work on Linux. There are free
an open source alternatives, but it takes time and effort to sway large
organizations to start using these, especially if all they know is Windows.
industries are used to certain type of workflows. My day job relies heavily on
Microsoft 365 and it would be difficult to do some of that work on Linux. There
are free and open source alternatives, but it takes time and effort to sway
large organizations to start using these, especially if all they know is
Windows.

I also realize that although some distributions are very easy to use as someone
who knows nothing about computers, it still might be difficult to solve some
Expand All @@ -111,21 +113,21 @@ on Linux, or issues with it. Because most distributions rely on Xorg, a very old
display server created a long time before 4K monitors were commonplace, it's
difficult to implement HiDPI scaling correctly. This is also exacerbated by the
fact that there are 2 types of GUI applications on Linux: Qt and GTK and both
work slightly different, so some applications require some tweaking to get them
to scale. Xorg also doesn't allow different scaling factors on multiple
work slightly differently, so some applications require some tweaking to get
them to scale. Xorg also doesn't allow different scaling factors on multiple
displays, so you need to either go full in with multiple HiDPI displays or stay
with standard monitors. To combat these issues, an alternative and potential
successor is being developed, but that also doesn't solve fractional scaling
problems among other things.

## Epilogue

Concluding, I'm very happy that I made a switch to Linux. I can definitely say
Concluding, I'm very happy that I made the switch to Linux. I can definitely say
that my productivity as a developer increased and I feel that my privacy is
being respected. Even though it isn't perfect, I think that everything in life
is a matter of compromise. On this occasion, I'm ready to compromise the visual
prettiness and access to proprietary software in favor of a highly functioning
operating system that makes my life easier. In the future blogpost I will
operating system that makes my life easier. In a future blog post I will
outline my desk setup and specific software I use, so stay tuned for that one.

[1]: <https://brew.sh/>
Expand Down
18 changes: 9 additions & 9 deletions _posts/2022-04-23-r-native-placeholder.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ redirect_from:
- /general/2022/04/23/r-native-placeholder.html
---

Yesterday (that is on April 22, 2022) R 4.2.0 was released and among
Yesterday (that is, on April 22, 2022) R 4.2.0 was released and among
other things, this release brought major improvements when using the
native pipe operator (`|>`).

Expand All @@ -18,11 +18,11 @@ You might be wondering: what is the native pipe anyways? Well, it's the
base equivalent of `%>%` pipe from the `magrittr` package, heavily
endorsed and used across `tidyverse` packages. It pipes a value forward
into an expression or function call. This practice is common in other
programming bd languages like F# or Elixir. Using pipes compared to
programming languages like F# or Elixir. Using pipes compared to
regular nesting of functions within each other allows for more readable
code, since each step is presented in chronological order. Nested
functions need to be read from the inside out to figure out what was the
fist function used. Consider this example:
first function used. Consider this example:

``` r
library(tidyverse, warn.conflicts = FALSE)
Expand All @@ -44,8 +44,8 @@ Hornet Sportabout 19 8 360 175
Valiant 18 6 225 105
```

By only using three functions it's not easy to find go from the inside
out to find out where you started and where are you going with functions
By only using three functions it's not easy to go from the inside
out to find where you started and where you are going with functions
applied. Pipes make it much easier.

``` r
Expand Down Expand Up @@ -112,26 +112,26 @@ mtcars |> lm(mpg ~ cyl, data = .)
Error in is.data.frame(data) : object '.' not found
```

One way to go around this problem was to write an anonymous function
One way to get around this problem was to write an anonymous function.

``` r
mtcars |> {\(df) lm(mpg ~ cyl, data = df)}()
```

You can see that this is not as elegant or easy when compared to a
simple `.`. This is why this release of R introduces the `_` placeholder
for handle with this problem.
to handle this problem.

``` r
mtcars |> lm(mpg ~ cyl, data = _)
```

One thing that is different than the `.` placeholder is the fact that
One thing that is different from the `.` placeholder is the fact that
you need to pass the name of the argument that will receive the `_`
placeholder, therefore syntax like `mtcars |> lm(mpg ~ cyl, _)` won't be
valid.

I really like the new `_` placeholder and I will continue using the
native pipe. I hope that some tidyverse functions will adapt to this so
there's no need to return to margittr pipe in situations where base pipe
there's no need to return to magrittr pipe in situations where base pipe
and `_` placeholder don't work.
Loading
Loading