Better Enumerations in Python

When dealing with more than one language, we look for similar approaches across languages. In Rust, there’s a keyword called enum to define and use enumerations. It’s easy to use, let’s look at this example from the official document: enum IpAddrKind { V4, V6, } struct IpAddr { kind: IpAddrKind, address: String, } let home = IpAddr { kind: IpAddrKind::V4, address: String::from("127.0.0.1"), }; let loopback = IpAddr { kind: IpAddrKind::V6, address: String::from("::1"), }; Rust ...

December 8, 2024 · 5 min

Syntax Errors in Logical Operators

Python favours letters and meaningful keywords for the logical operators, and all of them return a value depending on the conditions: not: The opposite of a condition, the reverse of the logical state of its operand. If the condition is True, it returns False, or vice versa. and: It needs to compare two operands, It returns True if both operands are True. or: It’s similar to and, but it returns True if at least one of the operands is True. ...

November 29, 2024 · 3 min

The Future of Mobility

I wanted to repost the part about the mobility of an article I wrote in Turkish for 2024 Trends in the Software World on my blog. The topic of mobility is still in my focus and I am still following the developments closely. … Now I will end my article with a topic I haven’t mentioned before: Electric vehicles, or in general terms, automobiles. We have entered a strange period that will closely concern the software industry. It is like the Quartz revolution in watches (or the Quartz crisis if we look at it from the Swiss perspective). ...

September 1, 2024 · 2 min

Configuration Updates With Emacs 29

As I mentioned in my last post, I started using VSCode to see what I’m missing and I thought that it’s a good time to take all the risks and break my Emacs configuration. In the last changes, I tried to use the built-in alternatives of the packages like eglot instead of lsp-mode. Now I’ve made the decision to update Emacs to version 29. When I first switched to Emacs 28, all my performance problems were solved thanks to native compilation support. Most of these problems were caused by LSP1 and it was very annoying to wait even half a second to see syntax errors in the code. Now I don’t close Emacs on the server for months. This was the most significant change to Emacs 28 that I can’t forget. ...

May 7, 2023 · 3 min

Status Update on Emacs

I’ve used Emacs for years, and it’s not easy to get rid of this archaic (what?) editor. Although it helped me do my job better, my setup was not as stable as in the editor. When I started working as a web developer, I was installing all the project requirements on the local machine, even though I was not using virtual environments. Emacs was good enough to make development possible. ...

April 10, 2023 · 3 min

Rust Essentials

Mostly I do not prefer to read the books written for teaching a programming language. Because a good language community already places the importance on their websites to promote the programming language beautifully as in Python and Rust. In these websites, you can find documentation, tutorials, even a free ebook that allows you to read from the website directly, and they’re mostly up-to-date. As you know, Rust is not an easy-to-learn programming language. So I frequently look at the official documentation of Rust, and sometimes I choose a random topic and read them again and again. Before starting to read this book, I took a look at the pages and saw some details that I still missed on the Rust documentation. Then I read the entire book thoroughly. ...

February 2, 2020 · 2 min

Being a Polyglot Developer

My objective for the year 2019 was joining one more programming language community after Python and Lisp. I followed .NET Core in my first six months and did some projects using C# and F#. But then, I decided that learning Rust is a better idea. Some of the Python and Django developers I’ve followed have had a significant impact on my decision. Python is a programming language that easy to learn, it has a significant and active community, and I believe that it will keep its popularity for a longer time. Therefore, when choosing another programming language, I make sure that it has different features and priorities. I’m not sure, but I think that that’s why I couldn’t continue with .NET community. I already produce microservices, REST API, gRPC server, or even classifying things using machine learning libraries in Python. But I would not have preferred Python if I want to make a mobile application, that would not make sense. Or I would use Rust for embedded or blockchain projects; I would code data or text mining tools in Lisp, for example. ...

December 31, 2019 · 2 min

My First Wrong After The Vacation

At the end of my three-week vacation, I was asked for a seemingly easy task. We were going to release the new version of the project we developed: Is today is the last working of the week? No. Is there any problem with the unit tests? No. Are all changes confirmed by the product manager, in the staging server? Yes. I always note everything, and so I write this article to remind this experience. My other habit is to define dosh sub-commands to access frequently used commands in my whole projects. It doesn’t matter if the project is written in .NET Core or used Django; ...

June 20, 2019 · 2 min

Configure Windows for Development

Environment Variables I still use some development tools that are used by most Linux users and these tools need some environment variables like LC_ALL, HOME, etc. When I have a new PC with Windows 10, I start to use with defining these variables. Take a look at this post for more detail. PowerShell Core It’s possible to use BASH on Windows indeed, but I think PowerShell Core is a good alternative. Git integration is working well, defining aliases and functions is easy: ...

March 16, 2019 · 2 min

String quotes in PEP8

I use PEP8 in my Python projects except for a few rules. I think ‘single-quote’ and “double-quote” characters should NOT be the same. It could be better if these two characters had different counterparts in the Python language parser system. So we could use one of them for the template-strings (or f-strings). It doesn’t provide readability, causes inconsistency instead. Until now, I used string-quotes for the variable definitions and double-quotes for the visible texts. But now, I plan to use always double-quote as in many other programming languages. ...

January 12, 2019 · 1 min

How do I publish my articles?

With just a command: # terminal $ ENV=PROD ./do.sh deploy I have many projects using my script named DOSH and the parameters are mostly in common; deploy, start, stop, runtests, etc. It can be a .NET Core or a Django project, or just a website using any static site generator like this one but I run all the projects with the same command: dosh start. In Windows, the command may be a bit longer than in the other operating systems. So it’s a good idea to shorten the command using some aliases, the default environment is DEV: ...

December 30, 2018 · 4 min

Important Windows Environment Variables

PowerShell and Git encoding problems To make git log command output properly display on Windows, we need to set a variable named LC_ALL: LC_ALL="C.UTF-8" Incorrect home folder in Emacs This problem is not only about Emacs. If you try to find a file from HOME variable, you may need to define the variable first: HOME="%USERPROFILE%" ;; place all backup files in one directory (setq backup-directory-alist `((".*" . ,temporary-file-directory))) (setq auto-save-file-name-transforms `((".*" ,temporary-file-directory t))) (setq default-directory (concat (getenv "HOME") "/Workspace")) More.. Take a look at the other posts about my Windows development environment. ...

December 25, 2018 · 1 min