Azure-Samples/MqttApplicationSamples

Directory structure does not scale to different languages due to directory fragmentation

ryanwinter opened this issue · 5 comments

Fragmenting language across multiple separated subdirectories, makes it difficult to easily share code across different application samples.

We should consider inverting the directory structure so that language is at the top level which allows each language to adhere to the requirements imposed by the language and its build environment.

For example:

-|- python/
 |  |- mqttclients/
 |  |- gsg.py
 |  |- command.py
 |- csharp/
 |  |- ...
 |- java/
 |  |- ...

Language

C, Go, Python, .NET

we talked about this issue at the beginning of this repo. We decided to go with this structure to enable reusing the required setup across languages.

makes it difficult to easily share code across different application samples.

why?

I agree, however as we progress through implementation we are seeing some issues with this layout and I though it would be good to revisit this given we have more knowledge to make sure this still makes the most sense.

Side effects I am seeing are that most languages dont like having their files not hosted in a the subdirectory tree. We see side effects of this with Go, C and Python (not sure about Rust). The workaround have been to pollute the languages agnostic directories with languages specific files.

I think it would be worth taking another look to confirm that we want to continue down this route.

which issues? we should have the common code in the mqttclients folder and reference those from the samples. Some times we might need to add something in the root folder to wrap both, such as go.mod, or the global CMake file.

@ryanwinter can you provide some suggestions to move forward on this issue?

I'll close this, not aware of any changes needed anymore.,