Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
The Four Worst Programming Languages Today (freelancer.com)
1 point by iKenshu on Oct 10, 2017 | hide | past | favorite | 4 comments



I'm a long time c++ programmer. I can't understand why people thinks c is better than c++.

At work I deal with a large project of mixed c and c++ (few million lines of code), with legacy code written in c and newer code in c++.

My experience of dealing with those c code is very painful. 2 concrete examples:

1. people say they hate c++ but like c. but they still embrace the concept of OOP in the c code. they use c struct to fake what c++ class does (and make every member variable a public one). in C++ when you set and get a member variable, you often use a getter and a setter. this makes it easy to find out where a variable has been accessed and changed (set a break point in the setter or getter). but in c code, since all members of a struct are referenced via pointers, it's very painful to debug when and where a member is changed. I have to use memory break point. Even setting memory break point in c++ is easier, as I have the constructor function to break into, to find out where an object is allocated, but in c code, it could be everywhere, my only hope is using the grep tool.

And I'm talking about debugging and maintaining undocumented large code base written in c by other people.

2. C++ class encourages programmers to partition and organize their code more reasonably. usually a class represents a single module of functionality. and usually a class is written in a header and a cpp file. You know you should look at the header for its interface, and you know to find its cpp for implementation.

but in the c code I'm dealing with, there is no such partition. several interfaces could be groups into a single header, and the implementation of those interfaces could be scattered across several c files or mixed into a single c file. This is just painful to look at.


My language of choice is Lisp. I'm also comfortable programming in C and Java, though I'm not really a fan of either of those languages.

C is a simple language, and I prefer simple languages to complex ones, as in my experience most complexity in computing is accidental, rather than essential. As a low level, portable, assembly language substitute, C is a reasonably good choice. As a high-level language, it leaves a lot to be desired: its lack of a garbage collector, weak type system, lack of safety, numerous gotchas, etc.

You cannot make a good language by starting with a bad one and just adding features. You first have to remove the features which made the language bad.

C++ is a derivative of C, and began life by adding object orientation. Then it continued to add features (references, templates, operator overloading, lambdas, etc.) without any attempt at cleaning up the language. So it's now an extremely complicated language, used for high-level programming, based on (and for the most part backwards compatible with) a language (C) unsuited for high-level programming for the reasons I just mentioned.

A better approach was taken with Java. The language is simple (albeit slowly becoming less so), strongly typed, and safe. The approach seems to have been to remove all the things that make C unsuitable as a high-level language, add a garbage collector, add a simple OO variant (Smalltalk--), and stop there. Complexity is buried inside libraries. Java also enforces the link between classes and files, so you know where to find stuff.


I was hoping JS would be listed. I wasn't disappointed!

Let the hate flow through you. Then hire me.


My understanding is that JavaScript began with good intentions: Brendan Eich wanted it to be more like Scheme, but was given a ludicrously short deadline (10 days) and told it had to look like Java.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: