TGViewer
C++ - Reddit C++ - Reddit @r_cpp · 229 subscribers
Post #24269 11
Am I using C++ the wrong way by making it feel TypeScript-like?

I’ve liked C++ since around 2014. I love that it’s compiled, object-oriented, doesn’t have garbage collection, and has clean, well-structured syntax.
But even though I’ve liked it for a long time, I never managed to get a job using it. I was still a newbie, and nobody really hires beginners in C++. So for work I moved to Node.js and PHP. I also enjoy JavaScript because it still feels somewhat similar to C-style languages.

Now, I finally have the freedom to choose my own tech stack again. I want to return to C++, but I’m having a hard time finding a simple, beginner-friendly C++ web framework. The closest thing that works for me is Boost.Beast, but it still feels very low-level.

Because of that, I ended up building my own small wrapper and started writing C++ in a more “TypeScript-ish” style. Now I’m wondering if I’m doing something wrong. Should I not shape C++ like that?

I’d appreciate any opinions or advice from you all.

Screenshot of my TypeScript-style C++ code: [https://imgur.com/a/MjxrzSJ](https://imgur.com/a/MjxrzSJ)
in case the imgur link down:

// ========================================
// AUTHENTICATION ROUTES
// ========================================
server->post(base_path + "/auth/register", auth_router.register_user);
server->post(base_path + "/auth/login", auth_router.login);
server->post(base_path + "/auth/logout", auth_router.logout);
server->get(base_path + "/auth/me", auth_router.get_current_user);
server->post(base_path + "/auth/refresh", auth_router.refresh_token);
server->post(base_path + "/auth/verify-email", auth_router.verify_email);
server->post(base_path + "/auth/forgot-password", auth_router.forgot_password);
server->post(base_path + "/auth/reset-password", auth_router.reset_password);
server->post(base_path + "/auth/change-password", auth_router.change_password);

// ========================================
// USER ROUTES
// ========================================
server->get(base_path + "/users", user_router.list);
server->post(base_path + "/users", user_router.create);
server->put(base_path + "/users/:id", user_router.update);

// ========================================
// STORE ROUTES
// ========================================
// Store management
server->get(base_path + "/stores", store_router.list);
server->get(base_path + "/stores/:id", store_router.get_by_id);
server->post(base_path + "/stores", store_router.create);
server->put(base_path + "/stores/:id", store_router.update);
server->del(base_path + "/stores/:id", store_router.remove);
server->put(base_path + "/stores/:id/owner", store_router.transfer_ownership);

// Store managers
server->get(base_path + "/stores/:id/managers", store_router.list_managers);
server->post(base_path + "/stores/:id/managers", store_router.add_manager);
server->del(base_path + "/stores/:id/managers/:userId", store_router.remove_manager);

// Store locations
server->get(base_path + "/stores/:id/locations", store_router.list_locations);
server->post(base_path + "/stores/:id/locations", store_router.add_location);
server->put(base_path + "/stores/:id/locations/:locationId", store_router.update_location);
server->del(base_path + "/stores/:id/locations/:locationId", store_router.delete_location);

// Working hours
server->get(base_path + "/stores/:id/working-hours", store_router.get_working_hours);
server->put(base_path + "/stores/:id/working-hours", store_router.update_working_hours);

// Store seats
server->get(base_path + "/stores/:id/seats", store_router.list_seats);
More from @r_cpp
  1. Oct 12, 2026cppreference-doc for Qt Creator Release cppreference C++ v2025.12.01 · cristianadam/cppref…
  2. Oct 12, 2026ACCU Overload Journal 195 - October 2026 https://accu.org/journals/overload/overload195 ht…
  3. Oct 12, 2026C++ Contracts C++ contracts are a good thing, why are people saying it's a bad thing? Anyb…
  4. Oct 11, 2026wxWidgets 3.2.12 and 3.3.4 Released https://wxwidgets.org/news/2026/10/wxwidgets-3.2.12-an…
  5. Oct 11, 2026VKRT NES Remaster — an open-source C++20 NES emulator with an observation-driven remasteri…
  6. Oct 11, 2026Right way to test async code https://redd.it/1x2wqgz @r_cpp
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →