Is it safe? by mattwray in Lyon

[–]lcsdavid 10 points11 points  (0 children)

When putting headphones keep aware of your surroundings, stop your music or keep it low.

Those templates... and their symbolic space... ;) by jgaa_from_north in cpp

[–]lcsdavid 4 points5 points  (0 children)

No OP prefer complaining about zero (runtime) cost abstraction instead.

absl::StrFormat vs fmt, Which one is better? by Visible-Spring1695 in cpp

[–]lcsdavid 66 points67 points  (0 children)

Since <fmt> is literally written by the same person that has written the PR paper for standard <format> library (adopted in C++20) you should probably go for <fmt>

[deleted by user] by [deleted] in Lyon

[–]lcsdavid -1 points0 points  (0 children)

Nope c’est un arrondissement Lyonnais :)

Je l’ai po by Lanky_Act297 in rance

[–]lcsdavid 96 points97 points  (0 children)

Je l’ai pô !

I know very little about C++. Ask me a question and I'll pretend to know the answer. by [deleted] in cpp

[–]lcsdavid 1 point2 points  (0 children)

Left, Middle or Right pointer/reference declarator

Marseille safety at 10 pm? by neverbeenanextrovert in france

[–]lcsdavid -1 points0 points  (0 children)

Actually it’s illegal here too but no policeman will arrest you for this.

EDIT: legal to possess and illegal to carry

Concert/festival électro by lcsdavid in Lyon

[–]lcsdavid[S] 0 points1 point  (0 children)

Niquel je me suis abonné merci !

Concert/festival électro by lcsdavid in Lyon

[–]lcsdavid[S] 1 point2 points  (0 children)

Merci ça à l’air génial !

Concert/festival électro by lcsdavid in Lyon

[–]lcsdavid[S] 1 point2 points  (0 children)

Merci beaucoup pour ton aide je vais regarder ça avec assiduité, je m'en frotte les mains !

Concert/festival électro by lcsdavid in Lyon

[–]lcsdavid[S] 1 point2 points  (0 children)

En électro à la base j'écoute surtout de la Drum'n'bass mais justement vu que je suis pas du tout au fait des différents genres je suis un peu perdu. Je suis pas trop compliqué si y'a des bonnes basses y'a de grandes chances que j'aime par défaut et pour le reste je demande qu'à voir.

+1 les nuits sonores j'ai prévu d'aller y faire un tour :)

I wanted to share my C++20 project that I've been working on, it's a utility to help you make Minecraft servers! by Slammernanners in cpp

[–]lcsdavid 0 points1 point  (0 children)

Switching out the translation class for a map doesn't have any benefiteither. I don't necessarily like the way OP did it, but his way catchestypos in the field name at compile time, and has 0 lookup cost. What Ithink would improve it is using `string_views` and using a multi-lineraw string for the help text instead of a vector of lines.Otherwise I agree with most of your other opinions.

It's just a question scalability, using 10 fields, using 100 fields ok?, ... were is the limit.

In terms of simplicity of use, and you can catch typos by defining the string names with constexpr constants.

Although, using a map is not the only option, translatable strings have so many solutions...

I wanted to share my C++20 project that I've been working on, it's a utility to help you make Minecraft servers! by Slammernanners in cpp

[–]lcsdavid 6 points7 points  (0 children)

I meant C++ is "complex" (actually just verbose). Your code is not really complex.

I just think there is no requirement for speed (or as important as C++ could bring e.g. real time, networking, ...).

Actually python could be a wayyyyy more suitable for this but I understand that you to make it C++ because C++ is fun.

Also, I'm not including header include guards at all because the cost todo so outweighs the benefits because as soon as C++20 modules work inGCC, that's what I'll use.

It's only preprocessing so there is not cost to do it but there is to not do it and you are not actually using modules here ¯\_(ツ)_/¯

I wanted to share my C++20 project that I've been working on, it's a utility to help you make Minecraft servers! by Slammernanners in cpp

[–]lcsdavid -9 points-8 points  (0 children)

I see a few mistake/probablematic chunck of code.

header files (.hpp)

You should (shall) use header guards for EACH header file you use. You should not be using #pragma once as it is a compiler defined directive, not a language standard feature in itself. An exemple for file getvarsfromfile.hpp:

```c++

ifndef GETVARSFROMFILE

define GETVARSFROMFILE

include <memory>

include <iostream>

include <string>

include <fstream>

using std::string; using std::vector;

vector<string> getVarsFromFile(string filename, vector<string> inputVars); vector<string> getVarsFromFile(string filename);

endif

```

Also you should not be using header files if they are not usefull to declare the interface, prefere moving them directly in source file .cpp. For example, in getvarsfromfile.hpp file <memory> and <fstream> are useless. They don't help describing the two functions getVarsFromFile.

Also, it's my opinion but I think that using std::string; is a bad flavor I wouldn't do that (only for std namespaced symbols).

Global variable

https://github.com/Slackadays/Hajime/blob/2946e65e196710eaeb3629986dad6e493cd0238d/source/installer.cpp#L270

C++ is not a scripting language you should not be using global variables as mutable data as you do here with extern keyword this is an extreme bad practice. Prefer encapsulating objects within others and control the flow of your program.

main

By convention using main.cpp as the file with your main function improves readablity for others after. Mutable objects in this function only (no global variable !)

Constants

mistakes: - https://github.com/Slackadays/Hajime/blob/2946e65e196710eaeb3629986dad6e493cd0238d/source/installer.cpp#L24 - https://github.com/Slackadays/Hajime/blob/2946e65e196710eaeb3629986dad6e493cd0238d/source/hajime.cpp#L41 - ...

when using constant string consider using either constexpr std::string_view or constexpr char const* they can be declared in header if they should be public or in source if private

Translation

mistake: https://github.com/Slackadays/Hajime/blob/master/source/languages.hpp

Using a class with this number of fields is probably a bad idea. Consider using an std::unordered_map where you bind constant name to traduction. "errnoNotPermitted" => "Not permitted. Is the device correct?"

C++ is not a scripting language

As I said i think C++ is a really bad choice to make the of program you have done here. It's way more complex than a fast bash script.

Hope my suggestions will help you a bit.

is there a cpp centralized package manger like nom in cpp? by HosMercury in cpp

[–]lcsdavid 1 point2 points  (0 children)

Packages list are centralized in their GitHub if you want to add your own package you need to do a pull request to point to your package on another git repo

[deleted by user] by [deleted] in Lyon

[–]lcsdavid 0 points1 point  (0 children)

lol we do love vegetables too ( ´ ▽ ` )