Java++

I'm about to start a new project from scratch. We are required to use C++ for everything, but I really don't like how chaotic is and would've really preferred Java, but the client is key but he claims he wants C++, because he said and I quote:
"Minecraft Windows edition is sooo much faster than that Java crap, not having it".
I'm responsible for code quality so I came up with a plan to still create usable source code:

- Any data structure except classes and enums are banned
- Templates my only when absolutely necessary, to ensure quicker compile time
- No classic pointers, new keyword is banned
- Objects outside of 3rd party library may only be initialized using shared ptrs, weak ptrs, etc
- No static variables, context must be carried through objects

This list is for from complete, but what do you think about the idea of neutralizing C++ idiocy by basicly forcing developer to use it more like Java?

Attached: Magic.png (640x400, 195K)

Other urls found in this thread:

cython.org/
notes-on-cython.readthedocs.io/en/latest/std_dev.html
isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines
isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines
twitter.com/SFWRedditGifs

just use c# if it has to be windows you dumb fuck

C# is closer to java than to C++, stick to it

Needs to run on Mac, no way in hell I'm opening that can of worms

Maybe python that shit then :^)
Shit nigger, I dunno. If it's something that specific maybe just go C++ or work on trying to convince the client otherwise since you're the technical counterpart

I know you're kidding with the python thing but cython.org/
notes-on-cython.readthedocs.io/en/latest/std_dev.html

.NET Core and Mono exist

Problem most of use have limited C# experience. I have to choose between Java and C++ and Java is out.
No I have to figure out a way to create readable code with the most chaotic language that is still in use.
So I thought I just try to castrate C++ in order to neutralize some of the danger.
I'm just not sure if theres a problem with this that I'm not seeing

>java grub
>not using std structures
>therefore not using std algorithms
You're gonna reimplement fucking lists and sorts? How are those different than
List chuj = new ArrayList();
...
List dupa = chuj.sorted();
?

What the fuck is java grub?
And I mentioned that the rules on count for the internal structures, lists, vectors etc are fine.
Main reason I wan't internal objects to only be used as pointers is to ensure that copies are always explicit and that references are the default.

>Any data structure except classes and enums are banned
Neither of those are "data structures" in the traditional sense, what exactly do you have in mind?
>Templates my only when absolutely necessary, to ensure quicker compile time
They usually will, but they will usually save you a shitton of code duplication by hand, so you decide.
>No classic pointers, new keyword is banned
This has already been pretty much standard practice in C++ for a while now, not sure why you bring up that point as an example of "C++ idiocy".
>Objects outside of 3rd party library may only be initialized using shared ptrs, weak ptrs, etc
For what reason? You are needlessly crippling yourself, nothing else.
>No static variables, context must be carried through objects
Fair point. This is the only guideline that makes sense.

How about you actually *learn* C++ instead of trying to come up with some twisted, arbitrary rules?

no structs, typedefs or other nonsense to avoid confusion.
Basicly if starts with a lower case letter(int, std::string, int256, etc) its considered a primitve (even if thats not technically correct) and can be allocated and copied.
If it starts with a capital, it must be a class and it may only be used using a shared ptr.
Most c++ code is not very readable and most of our guys haven't used it that much. This seams like a recipe for disaster which I'm trying to prevent

Just to be more clear, I wan't the code to be readable in the sense that one doesn't have to look up 50 typedefs to understand how exactly it behaves.
This is big advantage of Java since you that for instance the = operator makes copies for primitives and makes references for objects, wish I think is desirable.
Also I still see the new keyword a lot in C++ projects, so it may be good practice, but it is far from standard.

Also I don't understand why c++ even has structs, since they are just inferior classes.

Structs in C++ are exactly the same thing as classes except for the default access scope and inheritance mode, which is public instead of private. I don't see how they could cause "confusion".
Maybe you're thinking about "pure data" classes? If so, how do they cause confusion?
I agree with not using typedefs, though.

>Basicly if starts with a lower case letter(int, std::string, int256, etc) its considered a primitve (even if thats not technically correct) and can be allocated and copied.
If it starts with a capital, it must be a class and it may only be used using a shared ptr.
What? Are you unironically going to program around a naming convention?
For what bizarre reason do you insist on using shared_ptr by default? It is often unnecessary, and introduces overhead, unlike unique_ptr.
How about just avoiding any kind of pointer in general except when you actually need it?
>Most c++ code is not very readable and most of our guys haven't used it that much. This seams like a recipe for disaster which I'm trying to prevent
True. But trying to apply arbitrary rules to turn C++ into Java is a recipe for an even bigger disaster.

>This is big advantage of Java since you that for instance the = operator makes copies for primitives and makes references for objects, wish I think is desirable.
Unless overridden or deleted, the = operator will copy in C++ via the copy constructor. If you want to avoid copies, use references, move semantics or unique_ptr.

>Also I don't understand why c++ even has structs, since they are just inferior classes.
Compatibility with C.

>Structs in C++ are exactly the same thing as classes except for the default access scope and inheritance mode, which is public instead of private. I don't see how they could cause "confusion".
then I see no reason to not just get rid of them. The possibility of later encapsulation or inheritance if necessary makes banning them worth it imo.
>For what bizarre reason do you insist on using shared_ptr by default? It is often unnecessary, and introduces overhead, unlike unique_ptr.
Mostly so objects behave smiliarly to java, which we do most of our shit in anyway.
>Unless overridden or deleted, the = operator will copy in C++ via the copy constructor. If you want to avoid copies, use references, move semantics or unique_ptr.
Copy a pointer and you have the same object. Copy an object and you have a clone.

Doesn't the windows version of minecraft also use java?

I think he meant bedrock

You're unbelievably stupid for thinking this is a good idea.

Yep.

Just use C++. Modern C++ is a great language.

Is there a PEP8 style guildline for "Modern C++" that I can hand out or is this just a general term for C++ that isn't shit?

Requirements seem pretty strict. Sounds more like a professor than "client."
Do your own homework zoomer!

Just learn c++ like your professor commands you troglodyte bitch. Java is for Pajeet

Don't write it like Java. Just write good C++.
isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines

No its a client

>using polish curse words as impromptu variable names
based

that actually seams usefull, thanks

no, it uses C++

based pierogi

Why not objective c?

What is this chaos you talk of? The STL and templates don't seem chaotic to me, nor does c++'s support for low level memory access. These are features of the language people use with varying skill. Like Linus said, c++ in itself isn't a terrible language, the problem is shitty programmers tend to (ab)use it.

Attached: 1523734518407.jpg (680x680, 66K)

Actually i take that back Linus did say it was a shitty language, but i like to think he meant what i said.

There's not much wrong with java. It's generally good enough especially if you're already knowledgeable with it.

C++ wants to be 100 things at once. that what makes a lot of the code shit

send an image of spec

What a fucking retard.

No, most programmers being shit is what makes a lot of the code shit.
Even C code is typically absolute crap.

isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines