News for hackers. Stuff that matters.
Re:Ask HN: Self-taught webdev with lots of free time. What s... by qzw on Wednesday August 12, 2020 @06:36AM (#24130475)
Learn C. Then maybe one of the newer systems languages like rust, zig, D, nim, etc. If you’re bored with CRUD, there’s a whole other (bigger) world to explore when you get a little closer to the metal. It’s tremendously empowering and fun as hell to get you’re hands dirty a bit, so to speak. You’ll also become a better and more employable programmer as a nice side effect.
Re:Ask HN: Self-taught webdev with lots of free time. What s... by nlh on Wednesday August 12, 2020 @11:23AM (#24132966)
Second this. I used C for the first few exercises of the 2019 Advent of Code and it was SUPER fun. Granted, things that could been a single line of Ruby or Crystal took a few hours for me to cobble together in C, but my level and depth of understanding went WAY up. Totally worthwhile.
Re:Ask HN: Self-taught webdev with lots of free time. What s... by thatcodingdude on Wednesday August 12, 2020 @06:36AM (#24130481)
C or C++ ? Thought about it, at the very least it would make me a bit more well-rounded.
Re:Ask HN: Self-taught webdev with lots of free time. What s... by speedgoose on Wednesday August 12, 2020 @06:42AM (#24130515)
You should learn C. Life is too short to struggle with C++ now that we have better alternatives such as Rust.

You can also ignore the people who ignore the complexity of web apps. Classic C programs are very often much simpler than full web apps IMHO.

Re:Ask HN: Self-taught webdev with lots of free time. What s... by thatcodingdude on Wednesday August 12, 2020 @06:52AM (#24130604)
C it is then. Thanks for your input.
Re:Ask HN: Self-taught webdev with lots of free time. What s... by mucholove on Wednesday August 12, 2020 @09:09AM (#24131677)
Happy you chose to learn C. That's exactly what I would recommend.

If you are so inclined, I'd look into how to write your own home-grown version of Objective-C—given that valid C is valid Objective-C.

Because then you would learn Smalltalk and the whole ladder of it all! Smalltalk is far and away one of the greatest joys on programming. :) http://objective.st

The "Gang of Four" explains the patterns in Smalltalk and in terms of entrepreneurship—Patrick Collison's first startup was written in Smalltalk and I think early introduction to it leads to the clean design and success you see coming from Stripe.

Re:Ask HN: Self-taught webdev with lots of free time. What s... by thatcodingdude on Wednesday August 12, 2020 @09:25AM (#24131822)
Building a language would certainly be a crowning achievement. Thanks !
Re:Ask HN: Self-taught webdev with lots of free time. What s... by criddell on Wednesday August 12, 2020 @09:29AM (#24131865)
You might find it interesting to write some native macOS or Windows software (ie using the native GUI library). If you've mostly focused on web software you might find the different strengths and constraints of truly native code inspiring.
Re:Ask HN: Self-taught webdev with lots of free time. What s... by lenkite on Wednesday August 12, 2020 @08:46AM (#24131474)
Modern C++ is fairly easy to learn. At-least easier than either Rust or C.
Re:Ask HN: Self-taught webdev with lots of free time. What s... by XCSme on Wednesday August 12, 2020 @09:35AM (#24131924)
I personally don't think this is true. I worked a lot with C++ before and I'm still confused by the syntax and logic behind some concepts like (just randomly selecting some links from the dynamic memory group).

https://en.cppreference.com/w/cpp/types/remove_extent https://en.cppreference.com/w/cpp/memory/shared_ptr https://en.cppreference.com/w/cpp/memory/polymorphic_allocat...

I think the basics that are similar to other languages (data types, basic pointers, basic references, classes and OOP) are indeed easy to learn as they are basically the same in most programming languages, but the more specific memory management and weird syntax around some standard libraries make it harder to learn, use and read. Let's be hoest, correct C++ code usually looks ugly and verbose.

Re:Ask HN: Self-taught webdev with lots of free time. What s... by lenkite on Wednesday August 12, 2020 @10:30AM (#24132364)
shared_ptr is fairly understandable at-least from an application developers usage point of view.

std::remove_extent is only used for template metaprogramming and generally in linear algebra libraries. polymorphic_allocator is an expert facility.

Apart from shared_ptr, the other two are for very specialised purposes - 99.9999% of all C++ code ever written will never have them. But if you need them, you can leverage them.

I came from high level languages (JS/Java) and I found modern C++ pretty good - wow I can code native!. I found writing in plain C very difficult and laborious. I found Rust conceptually far more difficult than C++. Also you can't take your traditional data structures and write them in Rust. You have to do it the special Rust way, which makes it a plain when you are just trying to follow the code/pseudocode in a paper.

Admittedly, the Rust compiler catches pretty much everything you do wrong. But I code C++ with all warnings treated as errors along with static code analysers and they catch all my mistakes too.

Re:Ask HN: Self-taught webdev with lots of free time. What s... by AlexCoventry on Wednesday August 12, 2020 @09:54AM (#24132081)
I've written 5-line C++ programs which have stumped experts for hours. There's a trilogy of books about all its edge cases and best practices for working around them... C++ still has a place, but not as a beginning systems language.
Re:Ask HN: Self-taught webdev with lots of free time. What s... by lenkite on Wednesday August 12, 2020 @10:37AM (#24132443)
I hope we never judge how easy is it to learn and use a programming language by obfuscated code contests. All languages will fail by that measure in their lifetime as they accumulate cruft.
Re:Ask HN: Self-taught webdev with lots of free time. What s... by AlexCoventry on Sunday August 16, 2020 @03:08AM (#24175875)
This wasn't obfuscated code. This was a MWE, where I was trying to understand why it wasn't working as expected.
Re:Ask HN: Self-taught webdev with lots of free time. What s... by Kuraj on Wednesday August 12, 2020 @06:21PM (#24137719)
This language is so extensive and seemingly has so many dialects that I find it really hard to make sure that what I'm learning is modern C++.

Can you recommend any literature?

Re:Ask HN: Self-taught webdev with lots of free time. What s... by dnautics on Wednesday August 12, 2020 @11:29AM (#24133027)
zig is a fantastic alternative to C. The community is mostly C programmers who are sick and tired of undefined behaviour and #includes in C, but if you let them know you're a webdev looking to learn zig as a first low-level language I think you will find a relatively welcoming community.

Undefined Behaviour: Stuff like this - https://twitter.com/jfbastien/status/1280709082626666498

Re:Ask HN: Self-taught webdev with lots of free time. What s... by fouc on Wednesday August 12, 2020 @06:39AM (#24130504)
C is probably better, less abstractions.
Re:Ask HN: Self-taught webdev with lots of free time. What s... by C1sc0cat on Wednesday August 12, 2020 @06:38AM (#24130489)
I would add SQL to the list
Re:Ask HN: Self-taught webdev with lots of free time. What s... by thatcodingdude on Wednesday August 12, 2020 @06:38AM (#24130496)
Good point. I'm relying on ORMs too much.