Skip to content

Rewrite the very real enterprise project of totally not a satire project to C++ (real)#694

Open
GEOEGII555 wants to merge 42 commits into
EnterpriseQualityCoding:uinversefrom
GEOEGII555:uinverse
Open

Rewrite the very real enterprise project of totally not a satire project to C++ (real)#694
GEOEGII555 wants to merge 42 commits into
EnterpriseQualityCoding:uinversefrom
GEOEGII555:uinverse

Conversation

@GEOEGII555

@GEOEGII555 GEOEGII555 commented Jul 8, 2024

Copy link
Copy Markdown

Hello,

At enterprise quality programming Co. LTD, performance is one of the top priorities that a company would have. The slower the performance is, the less clients a company would have. It's one of our top goals to maximize the performance.

That being said, while Java is a great programming language, it can't beat the speed of C and C++.

So, in order to maximize the performance of the fizz buzz: enterprise edition, and to beat the competitors, we need to rewrite Fizz Buzz: Enterprise Edition in C++.

While it's possible to write assembly code that has better performance than C++, it would cost too much. Most C++ compilers, such as the Microsoft MSVC compiler, generate very fast executables, where optimizing it further is not worth it.

Since we are on C++, our very serious enterprise project only supports the very serious enterprise platform called "Windows NT", we can leverage:

The native Windows API. Java has a translator which translates the instructions for a specific operating system. However, since we're only on Windows NT, we can avoid doing such conversions and instead directly use the Windows API.

We also don't have to worry about destroying the performance and significantly increasing the dependency count when leveraging:

The C++ standard library. It has a lot of useful things which don't destroy the performance, unlike Java. It also doesn't require a lot of dependencies (just an 11 gigibyte installation of Visual Studio) to run quickly and without performance issues.
I haven't listed all of the upsides of rewriting our very serious enterprise project to C++.

The only downside of this is that we will be using the Windows API, which means that if some company ever decides to use Linukz as their operating system, even though it's not a serious business environment, they won't be able to use our project, which will lead to revenue loss.

This pull request closes #693.

There's one question: do we add tests?

@Capital-Asterisk Capital-Asterisk left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few things. would be cool to have CMake support and C++23 too.

Comment thread argparser.cpp Outdated
Comment thread argparser.cpp Outdated
Comment thread argparser.hpp Outdated
Comment thread console.cpp Outdated
Comment thread fizz_buzz.hpp
Comment thread output_writer.cpp Outdated
Comment thread fizz_buzz.hpp Outdated
Comment thread console.cpp
@GEOEGII555

GEOEGII555 commented Jul 15, 2024

Copy link
Copy Markdown
Author

A few things. would be cool to have CMake support and C++23 too.

We upgraded the project standard to C++23.

Thanks for the suggestion about using CMake, however, our very serious totally not satire company only uses serious business tools, such as Microsoft Visual Studio 2022, and not Linukz KitWare CMake.

Copied the code, but forgot to update the error message. Now it's fixed.
@plasticchris

plasticchris commented Jan 25, 2025

Copy link
Copy Markdown

I'm seeing a lot of if statements without explicit curly brace blocks. This is confusing and I'm sure it's disallowed by our c++ style guide which I'm sure we have (and is aligned perfectly with my own internal, shifting preferences. If not I'm happy to ninja edit it after any disagreements once I find it).

@GEOEGII555

GEOEGII555 commented Jan 25, 2025

Copy link
Copy Markdown
Author

I'm seeing a lot of if statements without explicit curly brace blocks. This is confusing to people who cannot read and I'm sure it's disallowed by our c++ style guide which I'm sure we have (and is aligned perfectly with my own internal, shifting preferences. If not I'm happy to ninja edit it after any disagreements once I find it).

If a person can't read, how will he understand that a { is a { and a } is a }?

@BrownNPC

BrownNPC commented Feb 5, 2025

Copy link
Copy Markdown

Is there an ETA for this being merged? We need the C++ port so we can make a python wrapper for this library.

Thanks.

@BrownNPC

BrownNPC commented Feb 5, 2025

Copy link
Copy Markdown

Since we are already on the subject of switching to a compiled language, perhaps we should shoot 2 pedestrians with 1 airstrike, and pick a memory safe compiled language.

There are multiple options.
Firstly there is Rust. As user @PurHur mentioned, Rust compiles slow. And it is dominantly used by the furry community, hence it diverges away from our core values and code of conduct of not judging something based on peoples interests.

There is also Zig, but it is not mature enough. Hence it is also ruled out, as we do not allow minors in our company.

Then there is Go
Go provides type safety and memory safety with a garbage collector. It is compiled and although it does have a garbage collector, in most benchmarks it is almost the same speed as Rust, speaking of which; the code compiles in less than 1 minute, compared to 30 minutes on Rust.

@BrownNPC

BrownNPC commented Feb 5, 2025

Copy link
Copy Markdown

Please read my previous post highlighting the selling points of Go. We might want to deprecate the C++ version and rewrite our project in Go for memory safety, speed, fast compilation times, cross platform-ness, and Simplicity of our business logic.

Go is already used within the industry, mostly in small businesses like Shopify, Google, Netflix, Meta, X, and such.

@GEOEGII555

Copy link
Copy Markdown
Author

Since we are already on the subject of switching to a compiled language, perhaps we should shoot 2 pedestrians with 1 airstrike, and pick a memory safe compiled language.

My program is memory safe. At least I believe that it is. The things that are not memory safe in C++ are mostly C remnants. In C++ variables get deallocated automatically when they are no longer required, you have lists of different types that get deallocated automatically, you have std::shared_ptr and std::unique_ptr that will automatically deallocate pointers, etc.

@0x43eba 0x43eba left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not quite over the line yet, but if we circle back I think we can really get this whipped into shape. Some action points for our standup tomorrow, so we'll circle the wagons and take a brainstorming session before we wrap up.

Comment thread fizz_buzz.cpp
Comment thread fizz_buzz.cpp
Comment thread fizz_buzz.cpp
Comment thread fizz_buzz.cpp Outdated
Comment thread fizz_buzz_persistent_cache.cpp
Comment thread fizz_buzz.cpp
Comment thread fizz_buzz.cpp
Comment thread fizz_buzz_persistent_cache.cpp Outdated
Comment thread fizz_buzz_persistent_cache.cpp
Comment thread fizz_buzz_persistent_cache.cpp Outdated
@GEOEGII555 GEOEGII555 mentioned this pull request Feb 13, 2025

@Hoyoll Hoyoll left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@BrownNPC

BrownNPC commented Apr 3, 2025

Copy link
Copy Markdown

Hi, I think it would be great to have some benchmarks and tests against the old java version to see how big of an improvement we got after rewriting in Cpp

@ngan1328 ngan1328 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the most elegant code I've ever seen

@Danmyrer

Danmyrer commented Jul 6, 2025

Copy link
Copy Markdown

Did not read but lgtm

@kytpbs kytpbs left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@tj-commits

Copy link
Copy Markdown

PLEASE MERGE THIS @emiln or @Mikkeren LOOK HOW MUCH WORK THIS GUY PUT INTO THIS

@kytpbs

kytpbs commented Dec 21, 2025

Copy link
Copy Markdown

PLEASE MERGE THIS @emiln or @Mikkeren LOOK HOW MUCH WORK THIS GUY PUT INTO THIS

@tj-commits Addressing members on GitHub personally and in an unprofessional manner is contrary to our enterprise company guidelines. HR will be reaching out to discuss this matter further. Thank you for your attention to this issue.

@tj-commits

Copy link
Copy Markdown

PLEASE MERGE THIS @emiln or @Mikkeren LOOK HOW MUCH WORK THIS GUY PUT INTO THIS

@tj-commits Addressing members on GitHub personally and in an unprofessional manner is contrary to our enterprise company guidelines. HR will be reaching out to discuss this matter further. Thank you for your attention to this issue.

who cares i'm not professional

@TheBlckbird

Copy link
Copy Markdown

I think this change adds a lot of value to this project, especially regarding its performance. But don't you think switching to a not-so-much enterprise language is good? Java is way more enterprise oriented (especially if you use the Oracle version) than C++

(But in all seriousness: lol, why did you put so much work into this?)

@GEOEGII555

GEOEGII555 commented Apr 7, 2026

Copy link
Copy Markdown
Author

I think this change adds a lot of value to this project, especially regarding its performance. But don't you think switching to a not-so-much enterprise language is good? Java is way more enterprise oriented (especially if you use the Oracle version) than C++

Oracle licensing is costly and I've heard that their lawyers are very aggressive

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Achieve better performance by rewriting to C++