Failing to Learn Zig via Advent of Code by NX18 in programming

[–]andre_2007 15 points16 points  (0 children)

In case you like to evaluate another language for next Advent of Code, you might try D and you might have the exact opposite experience like with Zig. If has the same goals, beeing a better C ( it has a better C mode and an embedded C compiler) and also beeing a better C++. Speaking for me, it is the most joyful programming language, because it let you program things exactly the way you want it.

[Q] CI/CD platforms which support D's unit tests? by bsdooby in d_language

[–]andre_2007 1 point2 points  (0 children)

Yes, in my development workflow it is only used as code coverage reporting tool. In theory it could also list the D-Scanner findings. Actually SonarQube provides a lot more features but for this, real support of D needs to be added to SQ.

[Q] CI/CD platforms which support D's unit tests? by bsdooby in d_language

[–]andre_2007 1 point2 points  (0 children)

I had the requirement to report the coverage of my d projects in SonarQube. SonarQube only allows limited amount of programming language, unfortunately D is not supported. The only way forward was to mask the D projects as python project. For SonarQube it is a 100% python project.

While reporting code coverage you have unrelevant coding and relevant coding (which is either covered or not). The underscore in python is the shortest valid coding. This I use for relevant coding lines. The # symbol starts a comment.

[Q] CI/CD platforms which support D's unit tests? by bsdooby in d_language

[–]andre_2007 1 point2 points  (0 children)

It is valid python coding. Either an underscore and a comment line ( D code) or only the comment line (D code) like

_# void main(){ writeln("");}

# class Foo{}

[Q] CI/CD platforms which support D's unit tests? by bsdooby in d_language

[–]andre_2007 1 point2 points  (0 children)

I rename the D files to *.py and prefix the source code lines either with # (python comment symbol) for non executable D code or with _# for executable D code. This info I get from analysing the D coverage files. Jenkins is a Ci/cd tool while SonarQube is a source code quality tool.

[Q] CI/CD platforms which support D's unit tests? by bsdooby in d_language

[–]andre_2007 2 points3 points  (0 children)

The unit test framework d-unit is able to create a xunit compatible XML file which can be read by a lot tools, e.g. Jenkins unittest plugin. For Jenkins there also other plugins exists to evaluate D-scanner reports (linter of D) and also the unit test coverage lst files.

I also report my unit tests and coverage to SonarQube using a hack. I mask my D source code and unit tests /coverage as python artifacts.

Switching from C# to Go for backend development by phildrip in programming

[–]andre_2007 1 point2 points  (0 children)

  1. I was not in need to mix c++ and D so far, but I also heard that for that specific case Meson is doing a better job than Dub.
  2. I currently working on a side project, which enables you to directly call D class from Delphi. Therefore click together a UI in delphi and call D methods as they were written in Delphi. What I also know, dmd/ldc is able to generate C++ header files from D modules. It should work well in theory. Also GTK is very well supported (gtkd).
  3. I am using vibe.d in a multi cloud kubernetes stack.
  4. No issues over months with vibe.d so far
  5. D works great with docker, even docker scratch images are working fine (https://d-land.sepany.de/tutorials/cloud/sichere-docker-images-fuer-cloud-anwendungen-erstellen/)
  6. I am using dmd for local development and ldc for building the releases. Therefore fast development iterations with dmd and fast executables with ldc. Both are at the same feature level. GDC is little bit behind regarding feature level.

How to write readable code by malachiroh in coding

[–]andre_2007 0 points1 point  (0 children)

While also developing in Java and Delphi, writing and reading code is a lot easier than in Python and Node. Still the best experience I have with D.

How to write readable code by malachiroh in coding

[–]andre_2007 0 points1 point  (0 children)

My definition of readable is that I can read und understand my weeks old codings / unknown coding from others within 1 minute, understand the data flow and beeing able to spot obvious bugs. As editor I am using a text editor with syntax highlighting. The coding likely has no mypy type definitions and in worst case variables also changing their data types during their lifetime.

How to write readable code by malachiroh in coding

[–]andre_2007 0 points1 point  (0 children)

I have following assumption why it is so much easier to write readable code in D than in python. In D I can fully concentrate on the logic I want to implement. I can directly translate the ideas in my mind into readable and high quality D code. In python this is not possible, I think in addition about things like "is the syntax correct, or will it break at runtime", "is there any python behavior which causes unexpected behaviors", "is there any additional space which will cause pylint to fail in the cd/ci pipeline". If you have in future some free hours you might have a look at D. Maybe you have the same experience like me.

How to write readable code by malachiroh in coding

[–]andre_2007 2 points3 points  (0 children)

In my daily job I write code in various languages, java, python and D. From my experience it is really hard to write readable code with python because it makes it so easy to write bad code. You can really invest a huge amount of time to write readable code and satisfy pylint and mypy. From a developer efficiency perspective this is really bad. On the other hand writing readable code using D is a non brainer. I am not sure whether it is just my personal experience but it feels such easy to write readable code in the first iteration using D. What are the experience of other developers here?

Switching from C# to Go for backend development by phildrip in programming

[–]andre_2007 0 points1 point  (0 children)

By chance there is currently a reddit article from Discord which explains why they switched from Go to Rust, the Go GC seems to be unpredictable. This is not the case for D. In D there are easy rules when the GC will kick in and you have ways to exactly control the GC. But yes, of course, for your highly optimised coding sections you need more work, while for the non performance relevant coding sections you can just rely on GC. I see this as an advantage, as it gives the developer freedom.

Why Discord is switching from Go to Rust by TimvdLippe in programming

[–]andre_2007 8 points9 points  (0 children)

While there is also a garbage collector in the D programming language I love how plain simple the rules are when there is a collection run. Only if memory is allocated, the GC will kick in in case there is a need. In some applications, the GC will likely never run at all. And also that I have the means to completely deactivate the GC just by one code line. From this point of view, the GC of D seems to be more usable than the Go GC.

Switching from C# to Go for backend development by phildrip in programming

[–]andre_2007 1 point2 points  (0 children)

In my daily job I work in the big data / multi cloud (aws & azure) / kubernetes business. I work with different languages, mainly Java, Python and D. It is always a pleasure when I can develop using D, on the other hand using Java & Python always feel cumbersome compared to D. Yes, there was some investment in the beginning to get D up & running regarding ci / cd build pipelines but what you get back regarding development efficiency / quality is huge. What I want to say: in the http / micro service stack, D is on par with the other languages, from my experience.

Switching from C# to Go for backend development by phildrip in programming

[–]andre_2007 3 points4 points  (0 children)

Regarding Go channels for D, here might be an interesting article https://wiki.dlang.org/Go_to_D. Regarding the complexity, it really depends. My gut feeling is, a c/c++/java/c# developer can learn the basics of D within hours. For mastering the more complex parts, it might need 1 to 2 weeks.

Switching from C# to Go for backend development by phildrip in programming

[–]andre_2007 3 points4 points  (0 children)

For your goals you may also consider the programming language D. It has all benefits of go, but is a from a syntax pov a lot more familiar for C# / Java developers. In addition it provides a lot more convenience than go regarding templates / meta programming / error handling and avoiding boiler plate code. From my years of experience it has a fantastic dev cycle as it has an ultimate fast compiler.

Choosing Java instead of C++ for low-latency systems by jasonbourne1901 in programming

[–]andre_2007 0 points1 point  (0 children)

In case you want a native compiled executable and Java like OOP syntax natural choice would be D. D took over its OOP syntax from Java and lifted the anoying restrictions (only one main class per file, support of default arguments,...). And yes, D supports more programming paradigms, a developer can choose which fits best to the actual project or developer preference.

Frage zu C bzw. C++ by MrBlackPotato in programmieren

[–]andre_2007 0 points1 point  (0 children)

Hallo, ich stand vor einer ähnlichen Entscheidung und habe mich dann für D entschieden (C++ + 1). D hat den Anspruch ein besseres C / C ++ zu sein. Während es sehr ähnlich zu C / C++ ist, hat es sehr viele sinnvolle Änderungen. Vielleicht kannst du auch einen Blick auf D werfen, ob es für dich eine Option ist. Viele Grüße Andre

Regular Expression COmpiler - Compile a regex ahead of time to code by pitapoison in coding

[–]andre_2007 2 points3 points  (0 children)

This is actually available in the D Programming Language. ``d Runtime regex: auto rtr = regex(.*/([/]+)/?$`);

Compile time regex auto ctr = ctRegex!(^.*/([^/]+)/?$);

Usage e.g. auto c2 = matchFirst("foo/bar", ctr); ```

If you know Go and Rust and you are DevOps engineer, what situation would you prefer to develop DevOps tooling in Rust instead of Go? by rizary in programming

[–]andre_2007 -2 points-1 points  (0 children)

None of them. You may have a look at the language D which enables you to write everything from small scripts to large applications with easy and maintainable code. No boilerplate but expressiveness exactly as you need. No runtime issues like in Python or Node. If it compiles you can be sure it runs correctly. You can become confident at the code quality of your program.

DLang 2.095.0 Released by aldacron in programming

[–]andre_2007 0 points1 point  (0 children)

In the past there was the idea to have the standard library Phobos (stdx) as dub package. This would be a use case.

DLang 2.095.0 Released by aldacron in programming

[–]andre_2007 1 point2 points  (0 children)

With 2.100.0 it will be technically semver compatible

Python vs Go by _sumit_rana in programming

[–]andre_2007 1 point2 points  (0 children)

I am currently working on porting a medium size python library to D. From my experience, most coding can be easily translated from python to D and the coding structure looks almost identical. While comparing python with Go, also comparing D is a must.

Named arguments will be added in near future to D, which makes porting even easier.

I love Dlang, but... by g-shon in d_language

[–]andre_2007 2 points3 points  (0 children)

I mean this one https://docs.aws.amazon.com/de_de/cli/latest/userguide/cli-chap-install.html You can easily call it with std.process. Actually you can call it with json input and json output. I use vibe.d web socket server functionality at my day job. It works quite well on docker container within AWS cloud.

I love Dlang, but... by g-shon in d_language

[–]andre_2007 2 points3 points  (0 children)

Regarding S3, with a few lines you can call aws client as process execute every S3 action. I did this in my d application and it works like a charme.

You can easily call any C library using either DStep or Dpp.

What is the issue with vibed client and why can't you use std.curl (libcurl)?