Advertisement

What practically annoys you on a regular basis in programming languages?

Started by August 12, 2019 10:23 AM
70 comments, last by Dawoodoz 4 years, 10 months ago

Why are you using multiple inheritance? I've been programming for over three decades now, and I still haven't found a situation where I want to use multiple inheritance.

I don't think the a<b<c change is going to do anyone any favors: If someone doesn't understand the language enough to not write such bugs, the situation is not going to improve by making the language more complicated, and accommodating this chaining will definitely go in that direction. Wouldn't it be better to make the compiler complain if a bool is used with an arithmetic comparator, unless it's explicitly cast to bool or something? So if you really want the current behavior of a<b<c you would have to write static_cast<bool>(a<b)<c, or the compiler would warn. Just an idea.

I work fine in C++, mostly staying away from clever compile-time template magic. The language is certainly too complicated, but you don't need to understand every dark corner of the language to use it productively.

 

Something that I wish most languages had was a way to define and use a domain-specific language within the primary language itself.  For example, I have a C# project with a GLR-based natural language parser.  Writing the grammar productions could be done as plaintext data, but if I define them in C# I get benefits from the compiler and IDE: I can find-all-references to specific terminals and non-terminals I've defined, I can extend the productions with C# lambda expressions to perform reductions, etc.

The downside is that since I have to call functions to set everything up, defining the grammar is extremely verbose.  What I really want is a way to extend the C# language with my own DSL.

Advertisement
6 hours ago, alvaro said:

Why are you using multiple inheritance?

I have my drawable objects inherit their simple life cycle (setup, prepareframe, render, endframe, cleanup) from a drawable base class, and for those objects among them that need to react to user input, they also inherit from an event handler base class and override mouse- and keyboard methods. The solution is just from laziness, i am sure there are alternatives.

When i look back at the last 30 years i get a smile on my face. I am doing this now since 2 years and of course comparably amateurish, i don't have any illusions there. You guys are awesome and able to produce a program in hours where i would need weeks. I want need a little gain in productiveness and hope i con do so with a simpler language ... call it cheating ?

I had a look into c#. It was actually the first language i looked into when starting this. The game that cost me so much time at that time had Unity underlying. But i couldn't get monodevelop to run on my Linux and so turned to C and C++. All the apis i use are written in C anyway.

I am right in the middle of assimilating D right now, i can keep everything i use there, others have already ported most of it and C functions can just be called. Only concern is execution speed, but this never was a problem until now, even a drop of 50% wouldn't shift bottle necks to the CPU. Also i hope that D, properly(tm) programmed isn't slower than C# and i can introduce some parallelism without spending months on learning how (or how not) ...

The world was never simple ...

7 hours ago, Nypyren said:

What I really want is a way to extend the C# language with my own DSL.

You'll love this proposal in front of the C++ standards committee.  Why use a DSL when you can just customize the language itself?

Stephen M. Webb
Professional Free Software Developer

C#:

I use C# at work every day and sure there is a few things to complain about:

- new() allocates always on the heap and i havent found a way to allocate on the stack yet

- Making a memory arena and just use memory like a stack is impossible, due to the lack of memory access

- NuGet is a mess when you need them to make (Configuration, Creation, Publishing, Debugging).

- Unit-Tests execution are extraordinary slow

- Without unsafe you cannot define a "fixed" length-array -> int[1024] myArray; // Not possible

- The industry standard of documenting C# code is really bad (Initializes a new instance of the <see cref="TheClassName"/> class, Gets or sets the value) etc.

 

C++ (I have too much to complain, so i do the opposite: Writing down the stuff that i actually like in C++ instead):

- I like operator overloading, so i can use vector/matrix stuff with normal math syntax

- I like method overloading, because it can be useful sometimes

- Structs and Unions without the need of writing "typedef X" all the time

- I like enum class with support for changing the integral type (S8/U8, S16/U16, S32/U32, S64/U64)

- I partly like nullptr, because defining something to null explicitly is more safe than just setting it to a zero as a number -> even if the meaning i basically the same

- Everything else in C++, i dont like

 

Visual Studio (C# and C++):

- The built-in profiler in visual studio 2017/2019 is pretty much useless, because of its horrible not intuitive UI. Also there is no way add manual timining instructions for the profiler yourself.

- Unit-Test exporer takes ages to update, after a rebuild

- XAML text/visual editor is unstable/slow like hell

 

Java:

- Getters or setters are so annoying

- Adapting tech from C# into java in the worst possible way

4 hours ago, Finalspace said:

- Everything else in C++, i dont like

Wow, that's harsh. The list of things I like about C++ also includes at least these:

  • std::string,
  • standard containers,
  • "you only pay for what you use",
  • [and my favorite:] destructors ("RAII").

 

Advertisement
On 9/10/2019 at 5:53 PM, alvaro said:

Wow, that's harsh. The list of things I like about C++ also includes at least these:

  • std::string,
  • standard containers,
  • "you only pay for what you use",
  • [and my favorite:] destructors ("RAII").

 

Standard algorithms are great too, but too many people don't use them for no good reason (probably lack of understanding). And destructors are by far the most important and best C++ feature.

What I like the least about C++: Non-destructive moves require almost anything that requires a limited resource to be "nullable". Followed by the signed/unsigned conversion rules. Also that std::endl doesn't do what it says it does (well, it does, but it also does something unexpected by 90%+ of C++ programmers).

I don't use C++ enough to be able complain intelligently about it, but python I might be able to (preface, i love nope rope):

  • For/Else (Why isn't the else called NoBreak?)
  • The syntactical subtleties between class variables/instance variables. Extraordinarily easy for most developers coming from Java, C#, or C++ to fall into the trap of not expecting variables declared outside of instance methods to be shared by all instances of the class. Of course, once you have a surface level understanding of the class definition semantics, very easy to avoid.
  • Explicit this(self) pointer required to be passed to all instance methods for a class definition.
  • I've never been a fan of, "We are all adults here" in the context of private/protected attributes, and encapsulation. I understand the reciprocal may not be entirely possible due to the dynamic nature of the language, but, hey, these are just pet-peeves ?

While using Javascript. 

1) It's an interpreted language so it is slow. 

2) It's still not safe even after 1997 passed. I can't for the life of me figure out why it's still supposed to be the "glue" of the internet.

3) Forgot a semi-colon somewhere? Well screw you, you will never know where. The console won't tell you anyway.

4) Sometimes Chinese-like syntax for a C++ programmer like me.

So after messing around with it and having become fed up, I have decided to use UE4 for the DOOM challenge since it runs fine on my laptop. I'm not sure I will have time to complete it though as I have other things to do.

12 hours ago, markypooch said:

Explicit this(self) pointer required to be passed to all instance methods for a class definition.

Funny, I wish C++ had an explicit this/self like Python or Rust!

This topic is closed to new replies.

Advertisement