Advertisement

What don't you like about your programming language?

Started by February 19, 2014 10:38 AM
48 comments, last by ChaosEngine 10 years, 8 months ago


it would be nice to have one language that has everything right. Ease of use, general purpose precision etc. But i'm guessing nothing can be 100%.
Some things in c++ make me wonder why i would want to use them or why they are there.

Not really possible to have one language that has everything. Some things are mutually exclusive (or, at least, impractical enough within a single language to effectively make them so). E.G. static typing versus dynamic typing. Garbage Collection vs. Explicit Memory Management. Interpreted vs Compiled. Depending on what I'm doing, I may prefer one environment over another. Different tools suited for different jobs. Just like Mechanics, Electricians, Plumbers, etc. all have a variety of tools in their toolboxes to accomplish a variety of tasks, Software Developers have a variety of tools in their toolboxes. The biggest difference being that it's much easier for a programmer to use the wrong tool (or perhaps just the less ideal tool) for the job than most other professions.

I wish classes were easier to make in Objective-C.

I wish JS had standardized classes. One of biggest issues with the language is having like two ways do things. Two ways to do getters/setters and many ways to do inheritance with mixins and other tricks. ECMAscript 6/7 is taking a while to be finalized. (Should add operator overloading, SIMD, and tons of value types). One of the biggest issues still is the lack of optional strong typing. The language has been slowly incorporating systems for working with binary data and the typed array spec is verbose.

My gripe in C# is not being able to use lambda expressions in attributes.

[Converter((x) => x * x)]
public Foo { get; set; }

There's a submitted suggestion for it, but it's so low priority it'll never get added.

In C++ the compilation system needs to be redesigned. The source/header system just doesn't work well. Having a multipass compiler that doesn't require forward declarations would greatly simplify the language making it modern. That and having an optional reflection system would be useful.

it would be nice to have one language that has everything right. Ease of use, general purpose precision etc. But i'm guessing nothing can be 100%.

Nothing really stops a language from implementing every feature. One just hasn't been implemented. One of the big issues is a lot of features need to be optionally defined as they have performance implications. Reflection for instance is nice, but would need to be optional in C++ for performance. Basically the compiler needs to be able to optimize freely to produce the output required without restrictions. Having things be optional throughout the language greatly complicates the language. C# I believe is really close, but even that is missing SIMD support taking itself out of some specialized applications.

Not really possible to have one language that has everything. Some things are mutually exclusive (or, at least, impractical enough within a single language to effectively make them so). E.G. static typing versus dynamic typing. Garbage Collection vs. Explicit Memory Management. Interpreted vs Compiled.

C# has both static and dynamic typing via the dynamic keyword. Interpreted vs compiled has kind of been superceded by JIT kind of. You can use say C# as a scripting language within itself for instance. Regarding garbage collection and explicit memory management there's nothing that stops a language from offering both. Modern C++ with smart pointers for instance is reference counting garbage collection. It's a core part of the standard library and used heavily by C++ programmers. It's not exactly a global mark and sweep algorithm, but it can show how a language can have both features at the same time.

Advertisement

it would be nice to have one language that has everything right. Ease of use, general purpose precision etc. But i'm guessing nothing can be 100%.
Some things in c++ make me wonder why i would want to use them or why they are there.

Nah, they're just designed for different things.

Say you are writing a build script utility. There are good reasons to chose between Python, Perl, C#, and C++. Depending on the needs I might pick any one of the languages.

Just because C++ isn't a perfect fit for simple string processing as seen in a build script, that doesn't mean I dislike how C++ handles strings. I'm not going to blame Java for not being able to pull items from collections as easily as I can join tables in SQL. I don't care that C is not the best match if I'm building a web page, nor will I complain that I cannot directly embed Pascal into HTML scripts. If I'm doing extensive regex processing I don't care that hand-coded assembly is a less than ideal fit, or conversely complain about how Perl is less than ideal when I'm trying to count individual CPU instructions. None of those are flaws in the languages.

Basically I have a toolbox with hammers, screwdrivers, wrenches, drills, saws, sanders, and much more. I'm not going to say I dislike a screwdriver just because it doesn't cut wood very well.

Perl and PHP: The damned dollar sign! I get why its there, and I've written parsers that depend on it being there. But I've also fingured out how to deal with it not being there in my own parsers, and it wasn't that hard. And I'm talking about a recursive-descent parser with a simple hashmap for a symbol table, not a bison, yacc, or other animal-generated automata.

C: An operation I do sometimes, is given a pointer, take the address of a member. So if I want a pointer to foo's X member, its to_x = &(foo->x). If you expand out the arrow shorthand, its really saying to_x = &( (*foo) . x ) ; It's dereference, and then take a pointer to a member. We all know what its really doing. It will compile to just an ADD instruction adding some constant offset to my foo pointer. It seems like something that should be able to be expressed a little easier. My proposal would be to expand the use of 'dot'. We all know that if bar is a struct, then bar.x returns the value of x. If foo is a pointer, foo.x should return the pointer to x. At least I think it would be cleaner.

BASIC: Yes, this, I mention it because this is where I learned programming. 'DIM' needs to die. DIM x as integer. x as integer is sufficient. pascal-style x: integer. integer x. Anything is better than DIM. Some variants (like basic stamp or PIC micro basic, use a var syntax. Like var int x. That's not too bad.)

C and C++: I hate the preprocessor and compilation model. I hate ABI incompatibilities.

Most dynamically typed languages: I hate not being able to quickly and consistently discover what types are involved when looking at other people's code.

BASIC: Yes, this, I mention it because this is where I learned programming. 'DIM' needs to die. DIM x as integer. x as integer is sufficient. pascal-style x: integer. integer x. Anything is better than DIM. Some variants (like basic stamp or PIC micro basic, use a var syntax. Like var int x. That's not too bad.)

I prefer to avoid Basic and it's variants where possible, but when I do have to use it (normally some VBScript) I find that not being able to initialize a variable on declaration is a far greater evil. Not being able to say "dim x as integer = 47" just seems insane, one of those "WTF were they thinking?" moments. As annoying as the Dim syntax is, it's not as annoying as this. It may be fixed in more modern versions, of course.

Direct3D has need of instancing, but we do not. We have plenty of glVertexAttrib calls.

Advertisement

C#:

I have an irrational hatred of the "var" keyword. This is more of a style thing as it has its uses, but I've worked with people that use it everywhere.

I hated it at first. Now I'm pretty much replacing everything with it, especially where I previously had to write the type twice (Dictionary<TypeNameA, TypeNameB> myDictionary = new Dictionary<TypeNameA, TypeNameB>()).

Perl and PHP: The damned dollar sign! . . .
. . . 'DIM' needs to die. DIM x as integer. x as integer is sufficient. pascal-style x: integer. integer x. Anything is better than DIM. Some variants (like basic stamp or PIC micro basic, use a var syntax. Like var int x. That's not too bad.)

i seriously hate dim and that dollar sign. Dim made me leave vb. As for the dollar sign, though i've not seen it in c++, it has no place in a programming language's keyword.
Another i don't like is var. I don't like seeing it in code examples.

UNREAL ENGINE 4:
Total LOC: ~3M Lines
Total Languages: ~32

--
GREAT QUOTES:
I can do ALL things through Christ - Jesus Christ
--
Logic will get you from A-Z, imagination gets you everywhere - Albert Einstein
--
The problems of the world cannot be solved by skeptics or cynics whose horizons are limited by the obvious realities. - John F. Kennedy

Java

Type erasure: It gets in the way sometimes. Specially if you have to deal with primitives or generic array creation. Also in overloading, you can't overload a method that has a generic like List<Stuff> with another method that receives List<OtherStuff> because type erasure makes the two Lists equal, so no way to know which method you meant to call.

No array slicing: You can't slice a regular array, you have to use Buffer objects for that. And its annoying.

K&R for Java Class Library: I'd prefer allman.

Java 8 specific: No @FunctionalInterface for abstract classes with a single abstract method (it must be an 'interface' always).

JavaFX specific: Looks like there is no way to hook up your own drawing loop. So if you want to render the widgets yourself, you have to hijack them, draw them to a BufferedImage (and I hear even that one is difficult), then upload it to OpenGL separatedly. If this process was less retarded, it would make a sweet game UI lib with a few OpenGL hooks.

Java users and library developers: Java 5 came 10 years ago, drop it already!

"I AM ZE EMPRAH OPENGL 3.3 THE CORE, I DEMAND FROM THEE ZE SHADERZ AND MATRIXEZ"

My journals: dustArtemis ECS framework and Making a Terrain Generator

In general, I really don't like the text file style of editing things, where functions have some sort of ordering relative to each other. I sort of understand the utility of having a text file as an intermediate form to simplify compiler authorship, sort of, but the idea that I would need to scroll through 500 lines of stuff to find a specific function just seems obstructive. Not quite sure why we're still stick with that in most languages, when there are so many more intuitive ways of navigating through information.

My biggest wish-list item for C# would be extension interfaces or implicit interfaces. This would make working with primitive types inside custom data structures a lot more simple. For example, if I wanted to represent a vector of type T, I should be able to specify T as satisfying certain constraints, so I could implement "Add" and "Multiply" on T. I would then be able to apply a new interface to integers and doubles, and get my vector code able to work over those types.

Biggest wish-list item for C++ would be the existence of some sort of auxiliary standard that would fill in all the "undefined behavior", with something that is diagnostically useful. Perhaps "Release" mode compilers would not adhere to this added standard, but "Debug" mode would, or some such. Just something that a compiler author can claim compliance to, so as to eliminate a lot of the guess-work associated with debugging complex code.

Java could totally use operator overloading.

This topic is closed to new replies.

Advertisement