DEV Community

Discussion on: Minimizing Keystrokes, Maximizing Productivity  -  Bash Scripting

 
akshansh2000 profile image
Akshansh Bhanjana

Yep, i3wm is also all-keyboard workflow. Honestly, I didn't even know how much time I spent alt+tabbing and moving between windows using my mouse until I started using i3wm. I guess I'd have a similar experience once I switch from VSCode to vim :P

I've heard about Yabai. Probably somewhere in unixporn (SFW), people have some amazing rices there.

Ahh yess, not using a mouse certainly helps with a laptop. Out of curiosity, which laptop do you use? I particularly love MacBook's touchpads (sometimes preferable over a mouse for me).

Wow, your reverse-i-search looks beautiful. Comparing to the one-liner I get hahaha, I'd perhaps try out fzf soon.

I literally just Googled "zero-days" right now :P
Yes, the main problems lie in memory management and garbage collection of C++ (which I believe Rust improves upon?)

The lack of generics in Go really annoyed me, although (finally) they're coming in the next version, so it might be a really interesting time to improve our GoLang skills.

Again, out of curiosity, how long have you been working with C++?

Thread Thread
 
wulymammoth profile image
David • Edited

VSCode is so hard to switch from. I watch a lot of tech YouTubers and I'm like, "Wow! WTF! It's like a full-blown IDE!" I used to use SublimeText with its vim plugin before doing a complete switch after being comfortable with the keys and this was before there were so many super video tutorials from YouTubers, like The Primeagen's troll video before he created a six-part series on some basic and intermediate Vim: youtube.com/watch?v=1UXHsCT18wE. I hear that the vim plugin for VSC is pretty good, though!

LOL! I think you've just sold me on a tiling window manager. I'll probably install Yabai tomorrow if it's a light work day. I was not aware of that sub-Reddit either! Just joined. LOL.

I only have Macs -- my personal machine is a 2019 MacBook Air, but I started a new job in April and was provided a 15" MacBook Pro (late 2019). Yeah, the touchpad is nice, but still requires me to move off my keyboard. I even surf the web with Vim keybinding using the Vimium plugin in both Chrome and Firefox. I also have the keyboard shortcuts turned on in Gmail (which are also Vim keybinding). Vim-nut, I tell ya!

Here's a quick five minute video on the capabilities of fzf: youtube.com/watch?v=1a5NiMhqAR0. It is one of the most starred projects on GitHub for a reason and the Vim integration is phenomenal.

This was the Hacker News article discussion and article that was heavily upvoted a year ago - Serious Chrome zero-day. You'll see people ranting about the C++ right at the outset. Yeah, Rust has a very very strict compiler and introduces the "ownership" model along with semantics around it, dubbed "borrow-checking". The quality of the software, at least in open-source, in that community is pretty phenomenal. A few tools that I use are Rust-based now -- like my terminal emulator, Alacritty (perceptibly faster than iTerm2) and cross-platform (macOS and multiple Linux distros), ripgrep for searches (faster than ag and most certainly, grep).

Yeah, I saw a demo of generics in Go in the Golang sub-Reddit. I'm totally fine with or without it, because I don't envision writing more Go than I need to. It would be a welcome addition and reduce the SLOC in a big organization. However, I would much prefer to learn and work in Rust, as I find the language much more expressive (modern language features) even though there's a steep steep learning curve. My current company uses Go, but finds it difficult to get observability and runtime introspection without going whole hog into Google land with K8s and containers to layer over it.

Haha, funny that you ask. I've probably written no more than two programs in C++ (a small game and calculator). I've done some Leetcode problems in C++ and have read some C++ source code in open-source projects, but my entire career has been in the web-stack which I'm getting bored of, so I want to drop down lower fueling my intrigue with Rust :)

Thread Thread
 
akshansh2000 profile image
Akshansh Bhanjana • Edited

VSCode is literally an IDE in the package size of a big text editor :P
Moreover, its extension support is one of the major reasons people (including me) can't let go of VSCode.

Ahh, this series is nice. Thanks for sharing! This is a great way of moving to vim. The only thing I did before trying vim was vimtutor, which is nice, but still a little overwhelming for first time use. It'll grow on me slowly, I guess :)

Hahaha, so did you install Yabai? And yes, Macs are great. I just found out about the Vimium plugin and wow, you clearly do love vim :P

I use Gesturefy or CrxMouse to speed up my browsing, but that's about it. Gonna definitely try Vimium after learning vim haha.

Ahh, that definitely makes Rust something to try soon! Also, I saw Rust to be among the most loved languages on StackOverflow, so it definitely is a good sign for its future :)

I've been using alacritty for over 3 months now, and yes, it's really a no-nonsense and lightweight terminal. Moreover, I also use dmenu-rs which is a Rust-based dmenu, and functions just like the extremely amazing spotlight search of macOS.

I tried Competitive Coding with Go once, just for fun really (majorly to see performance differences compared to C++). The speed was amazing, but the code writing part was definitely a headache xD

That was majorly due to generics. Now, since their introduction, maybe I'd try it once again. I'm just looking for substitutes for Python (for CP). Basically, I mostly use C++ during CP, but when the question relies heavily on hashmaps and lists, I prefer Python (mostly due to its ease-of-implementation and O(1) key searching). However, Python sometimes exceeds the time limit due to being really, really slow. So, if GoLang can solve that for me, I'd happily use it.

Ohh, I really thought that you were into systems programming with C++ haha. That's nice. I'm just diving into kernel development now, so C/C++ are gonna be with me for a long time now :)

Thread Thread
 
akshansh2000 profile image
Akshansh Bhanjana

The "Two steps from VSCode to Vim" video, I'm literally laughing hahahah. Took me quite a while to understand the satire :P

This was a great video; thanks for sharing :D

Thread Thread
 
wulymammoth profile image
David • Edited

Enjoy! I've left a lot of questions and comments on those videos. Haha. He's pretty entertaining. I mean, Vi key-bindings are everywhere! Navigating man-pages and tons other Unix utils... I can't be the only one. Vimium really doesn't take much to learn aside from the movement keys hjkl, gg (top of page), <shift>-g (bottom of page), then f and it marks anything that's a link with a letter or a sequence of keys to press to visit the link or open the link in new tab/window. This trips me up each time I'm on someone else's machine. Gesturefy is neat! I didn't even know about this. I do love Firefox containers and tree-style tab plugins, though!

Oh! I was not familiar with dmenu, but that is pretty neat! I may give it a whirl -- so many things to try. LOL.

Didn't end up installing Yabai -- was chatting w/ a coworker using it and he's like, yeah -- you gotta configure the keys first and I'm like, "okay, guess I'll wait!" I end up installing Rust instead and reading the book 🤷‍♂️ #priorities

Yah! Rust has been atop or near the top of that list for the last two or three years. It's got a lot of traction in the San Francisco Bay Area tech scene.

I always admire folks that do competitive programming. I follow quite a few on YouTube that you may be familiar with Erichto, William Lin, and Rachit Jain. Does Go's standard library have the data structures that you need for most problems? And did you find problems where you could use goroutines? C++ is pretty much the only language that I see used in CP, but of course, back in the day, there was Pascal. How often do you reach for heaps?

I've never really used any of the other Python VMs, but I can't even imagine someone using Python for CP. It's the language I typically end up using for interviews, but it's not like my solution is being compared one implemented in another language -- just need to be able to bring down the algo complexities (not always easy for a non-competitive programmer)

Haha -- people at work ask me why, too. Just curiosity and the possibility of working on some hardware that I had no interest in years ago. I think reading about Discord's use of Elixir and Go, then switching from Go to Rust here, really sparked my interest. I also had a coworker at a previous company that was a huge Rust open source contributor before it was popular -- he wrote a bunch of device drivers and software for cameras and lights around his house and I found that really cool. It wasn't something I could particularly do.

Thread Thread
 
akshansh2000 profile image
Akshansh Bhanjana • Edited

So I ended up installing the Vimium extension, and, wow. I love it. You were right; it didn't take much time to get used to, but saves a whole lot of effort while browsing. Thanks for this!

Firefox's containers are indeed great. I never really used the tree style tabs, though, as I think I'd need a bigger screen (I pretty much always feel that my screen isn't big enough haha) and so I think I might try that later.

Hahaha, yes, Yabai, i3wm, dwm, and perhaps almost every tiling WM takes a lot of time setting up + getting used to. They do save a lot later, though. So, a worthy investment, I'd say.

You've sold me for Rust, really. Gotta start learning soon :P

I haven't heard about Erichto, but yes, William Lin and Rachit Jain are amazing. Go's standard library contains lists (obviously), trees, heaps, stacks and queues (easily implemented using slices), and some useful functions. It isn't as extensive as the C++ STL, but it still does a really good job.

About the goroutines, I never came around to using them, as I didn't even know that much programming when I used Go (I was in my freshman year :P)

Haha yes, Python for CP is usually frowned upon. Honestly, I figured that in competitions where the submission time matters (i.e. the time one took to solve the problem, and not the submission runtime), Python is really good!

When I became used to Python, I realized that I could sometimes solve a problem using Python in half the time it took to solve the same in C++. So, what I usually do is use Python for easy problems (so that I don't fall into TLE problems), and switch to C++ for the harder ones. I found this way to be really efficient! Moreover, when dealing with really large numbers, Python works like a charm.

Woah, Discord switching from Go to Rust is a really interesting step! Let's see how it fares in the future :D