#Let me know if the code works on your machine

16 messages · Page 1 of 1 (latest)

odd orchid
bronze hedge
#

Im so confused by this repo?

  • Why is build/ in there
  • Why does Camera.h not just contain declarations (in fact all header files)
  • Why is the executable file in the repo
  • Using the namespace std in a header is HUGE codesmell
  • The repo structure is not optimal
odd orchid
#

it's one of my first repos, I'm at the begging, I don't really know how it should be 😅

outer hill
odd orchid
#

It does, but I want to show other people my repo if they ask me if i made a project and wanna make sure it's good on other devices

atomic marsh
#

From the previous repos, there’s a huge difference too

#

Granted the last repo is 4 months ago

odd orchid
#

Yeah, well I tried to structure the whole repo, making it better, but I am having trouble at the installation steps, because I don't really know why, but the executable is still there, and when I tried to compile the code on another machine, the brew gave me an error and i don't really can solve this by my own, that's why I asked if it runs on other machines by following the steps that i included in the readme

odd orchid
outer hill
# odd orchid I made a project for a hotel system in c++ and i am wondering if someone is will...
  • Why do you have a src/Camera.h and a include/Camera.h that both do entirely different things?
  • NEVER put an executable together with the source code. If you want to upload precompiled stuff, then make it a GitHub release.
  • I would suggest you use #pragma once as an include guard. Yes, it isn't standard C++, but I don't know of any compiler that doesn't support it.
  • It's good that you use CMake, but you use it incorrectly. You want to have one CMakeLists.txt file per folder, and in the outer CMakeLists.txt you do add_subdirectory("<name_of_inner_folder>"), so that each CMakeLists.txt is only responsible for it's own folder.
  • In your README you don't need to explain how to clone a project, especially since most people probably prefer to clone via SSH.
  • Your addRoom and deleteRoom in src/RoomManager.cpp are very inefficient as you need to perform a linear search each time. Possibly consider using a std::unordered_map or a std::map
  • Some functions like include/Reservation.h/modifyReservation are way too complicated. If I just look at how nested it is, then at the most nested point we have, in this order: for-if-for-if-for-if-if. That's seven indentations. That's WAY too much. Try to aim to never have more than 3 indentations.
  • goto has its valid uses, how you use it in include/Reservation.h/addReservation is not one of them. You can simply replace this goto with a loop.
  • You write like a C programmer. You don't really use classes. Like, for example the fact that you need to ALWAYS pass [const] std::vector<Camera>[&] to ALL functions in include/Camera.h just screams at me that there should be some sort of wrapper class.
    The few times that you "use" classes, you abuse them as just arrangements of data, like it's the case in C.
  • You have WAAAY too many string literals in your code. I would definetly extract stuff like \033[1;90m or \033[0m
  • I just saw your main function. WTF?! A main function should be like 1-3 lines.
odd orchid
#

I fel like i need to apologies 😭😭

#

It’s my first project that I really worked on, I don’t have that much time to dedicate myself to programming cuz I got exams going on rn and my time is limited, but I try to get my way around

#

Thank you for the explaining, appreciate it :))

outer hill
glass verge
#

constructive criticism 👌

clear pasture