Over the years I have tinkered with Windows shell scripts, Bash, Python, C, C++, Java, JSFX, never doing much with any of them, just seeing if any of them were something I might want to pursue further.
It’s been a good while since I have tinkered with anything to do with programming, and I want to set aside some limited daily time and pick back up Bash, Python, or some other language for general purpose use without jumping in too deep this time around. What I found previously in my learning/tinkering is that good and interesting learning resources make all the difference, not so much the language. And for that reason alone, I had the best learning experiences with C and C++, having found good educational quality beginner books for each. But I might like to jump back in at the shallower end. There is so much existing cool software out there such as Sox and MLT that can be leveraged using scripts without having to get too deep. Python has graphics/gui stuff going for it, so maybe that would be a good route to pursue. But I never found a good beginner book on it for myself and later for a nephew who was interested in it.
I’ve dabbled in a bunch of languages - once you know a couple you have a jump start with learning new ones. At least you know what you need to do and what they should be able to do, so it’s ‘just’ the syntax from there.
I like knowing some C and C++ because the world, including Python and web languages, is built with them. It’s turtles all the way down to assembly so it’s nice being at the penultimate turtle level rather than on top of an unwieldy stack of aquatic reptiles with no idea of how tall it is.
Speaking of the turtles, I’ve been noodling with some bare metal x86 stuff recently. It’s a good feeling sticking a USB stick into any computer and having only your own code running on it with no OS.
I naively attempted that once long ago before I knew anything about anything (I still don’t know much about anything ). I forget now the name of the assembly book I was working through, but I remember having difficulty finding any books worth reading.
Just a terrible adventure game in assembly language for noodling with 16 bit Real Mode and another project bootstrapping into C++ in 32 bit Protected Mode to mess around with a mini OS. I’ve got C++ going with no threading or exceptions but with heap memory that appears to be working. I want to get LuaJIT working on it too but it don’t know what I need to implement to make that happen.
Awesome bro
We should setup a pm to swap settings, solutions and shit
I started from scratch again last month or so
Got distracted over the holidays setting up tools on my new pc
Taking a quick unix refresher before I start up again on c++
What editor and terminal are you using?
I’m using vs code and windows terminal
On ubuntu 20.04 via wsl2
Snooks is the resident c++ yoda here
He put me on to the xmake build system which is really intuitive, I highly recommend it
I believe he has neovim and zsh chops also
Not touching vim or emacs atm in case it sidetracks me from programming
I don’t like wasting time on tools when I could be programming
@Bevo : Erm, I’m more like a baby Yoda that has been dropped on his head compared to the true Yodas out there!
One thing I’d recommend is typing out and playing with code/examples in books or online instead of reading them and moving on when you understand it. Because you won’t remember it in a couple of weeks/months, unless you are indeed a verified Yoda. Your future self will thank you for it.
Also break things, break lots of things. Break things some more!
Finally, C++ and other systems programming languages are nice and they let us do nice things but they are kind of strict, which is also nice because lots of stupid typo mistakes are caught. But that kind of strictness gets in the way of experimenting and going with the flow sometimes so using a scripting language as well as the lower level stuff is good too.
Finally #2. Getting hit with bugs caused by a lack of static/strong/strict typing or breaking things by using raw loops and raw pointers is all good imo. It let’s us know why the abstractions exist on an emotional, experiential level - which is a much better lesson than reading “use smart pointers” or whatever.
I always fall to the default gui text editor and vim (when on a bash terminal) on linux and compile with gcc on bash (default shell on most major linux distros), which is simple enough. That is the same as I ended up doing on windows long ago after not liking some bloated IDE’s, just a text editor (notepad++ and vim) and gcc on cmd.exe.
Compiling with gcc on a bash terminal can be as simple as, g++ hello_world.cpp , which will give a default named executable file a.out in the current directory, or to provide your own name, g++ -o hello hello_world.cpp. And as simple as entering ./a.out or ./hello for example, to run the executable. Here ./ just gives the current directory. I’m pretty sure this is basic stuff you already know, but I’d rather risk being pedantic than cryptic.
Vim can be simple enough to use too, but if you don’t want to screw with it, nano is usually available as default on a bash terminal.
I haven’t used a pm thing in such a long time, I wouldn’t even know what to use. Maybe Snookio can recommend something. The time zone thing would probably be an issue though. I intend to spend 2-3 hours each morning and more on days off on C++ so as to still be able to get meatworld things done. Maybe a thread here would be more practical.
I most likely remember previously learned syntax and constructs because I did as you mentioned here, typing everything out manually. I recognized that I should do that to remember that stuff, where lots of online recommendations were to use an IDE for auto this and that. And as things became just tedious to type out and I was sure that I didn’t need to anymore, I used minimal templates to jump off from.
And half my time was spent experimenting with what I had learned up to that point, trying to make some use of it before moving on.
I think the last gcc version I used might have been 5 or 6, and it’s up to 10 now. Just giving a quick look at 10 (installed by default on Manjaro), it seems like debug output has improved.
My issues were never with the language or any of the tools (same with C), but rather, with arriving at solutions to problems (spending quite a few hours on paper). And my issues there were challenging in a good way, not insurmountable. I think the examples in Bjarnes book are excellent, by the way. Very satisfying and challenging enough to be interesting. I only dropped off from that book because of meatworld catastrophes at the time. If Bevo hasn’t settled on a book, I would highly recommend Programming Principles and Practice using C++ second edition. It’s probably the best instructional book I have read (albeit partly here) on any topic. Very well done. At least what I had worked through of it in the past was very good. One thing that may look off-putting is the size of the book, but I found the writing and content to be interesting and not a chore to read at all. If he decides to go that way, just make sure to grab the recommended header file from Bjarnes site before diving in: https://www.stroustrup.com/Programming/std_lib_facilities.h That file should be placed into each working directory or linked to. Of course, this is pointed out in the book. Also, as the title says, this a book about learning programming principles and good programming practices, not just a language book with superficial examples and problems. I think that is why I like the book so much. Bjarne points out that his intent with the book is to teach real world programming to beginners who might aspire to become professionals.
I use YouCompleteMe with neovim, I’m not that hardcore that I don’t use autocomplete. I don’t think it gets in the way of remembering, the muscle memory and mental model of creating is mostly the same. From what I gather most people forget the minutia after a time not using a language, so it’s just the general patterns we’re trying to burn into our brains.
I know it was like I’d never used Python when I went back to it after a year or two. But it’s hours or a few days to get back into the swing of things.
I think you misunderstood me bro, I literally use nano everyday to modify my dotfiles… I don’t think there’s an editor I haven’t tried. I did my time punching holes into stone tablets and compiling to machine granite,
I don’t think my muscle memory could ever forget the syntax.
Anyhoot that gets old pretty fast. You can actually compile and run within vim itself, definitely neovim but vim 8 also IIRC. I had a really schmick neovim setup on my old pc that died along with some gold code I need to salvage, I had compilation running inside vim for c++ and python.
Or get into the future with vs code and windows terminal
they be lightweight, cross platform and open source. Unbelievable it came out of windows I know.
Then you can install Powershell Core and really desecrate your distro…
I think you could always pretty much run most any shell commands within vim via a bang, e.g.:
:!g++ -o hello hello_world.cpp
Personally, my biggest slow down is in solving problems (by orders of magnitude), and so I haven’t found all the tool efficiency minutiae all that helpful. But maybe I like the punishment of typing or something.
Every speed increase counts for me.
I like writing code but I hate typing boilerplate or long repetitive commands
So I generally write vs code snippets and bash aliases to get around that.
Yeah I know about the bang commands in vim
There was a better way after vim 8
Terminal emulator or something? I forget the name, but you could compile and run the visible file from a shortcut, including arguments. Was pretty sweet.
Edit: it was the AsyncRun plugin which displays the result in a quickfix window
You should def check out xmake. Every c++ dev uses a build system once they include multiple files. Snooks was on point how easy it is to use, it uses lua syntax, much easier to write than cmake.