Click here to Skip to main content
15,881,089 members

The Weird and The Wonderful

   

The Weird and The Wonderful forum is a place to post Coding Horrors, Worst Practices, and the occasional flash of brilliance.

We all come across code that simply boggles the mind. Lazy kludges, embarrassing mistakes, horrid workarounds and developers just not quite getting it. And then somedays we come across - or write - the truly sublime.

Post your Best, your worst, and your most interesting. But please - no programming questions . This forum is purely for amusement and discussions on code snippets. All actual programming questions will be removed.

 
AnswerRe: What's the Most Concise, Human-Understandable Practical Language? Pin
Fred283417-May-20 20:51
Fred283417-May-20 20:51 
GeneralRe: What's the Most Concise, Human-Understandable Practical Language? Pin
johnywhy8-Dec-22 20:29
johnywhy8-Dec-22 20:29 
AnswerRe: What's the Most Concise, Human-Understandable Practical Language? Pin
lopatir17-May-20 20:52
lopatir17-May-20 20:52 
GeneralRe: What's the Most Concise, Human-Understandable Practical Language? Pin
johnywhy22-Oct-21 7:57
johnywhy22-Oct-21 7:57 
GeneralRe: What's the Most Concise, Human-Understandable Practical Language? Pin
Lorenzo Bertolino17-May-20 20:59
professionalLorenzo Bertolino17-May-20 20:59 
AnswerRe: What's the Most Concise, Human-Understandable Practical Language? Pin
Richard Deeming18-May-20 1:28
mveRichard Deeming18-May-20 1:28 
AnswerRe: What's the Most Concise, Human-Understandable Practical Language? Pin
KateAshman17-May-20 21:57
KateAshman17-May-20 21:57 
GeneralRe: What's the Most Concise, Human-Understandable Practical Language? Pin
kalberts17-May-20 22:48
kalberts17-May-20 22:48 
I was doing Windows programming in C++ for several years before switching to C#, learning many of its small advantages over C++ as I went along.

After a number of years with C#, I was going to pick up an old private hobby project in C++, and learned one huge advantage of C# over C++ that I had never realized before: The amount of red tape in C++! You spend an unbelievable amount of code lines on setting up and and initializing things, header files, declarations of all sorts. Module interfaces are handled by VS in a "database" (I grew up with ACID, so I put the term in quotes Smile | :) ) rather than header files. Sure, if you go behind the curtain, you will see that VS and WPF do very similar things, but they do it for you!

A number of small things are done for you as well, such as heap management. I started using VS when switching to C#; my old C++ project was sprinkled with lint directives (i.e. lint comments) all over, cluttering up the source files. With VS and C# I never missed Lint, there was no need for it. So I could drop lint from my C++ code as well, couldn't I? But VS Intellisense doesn't work half as well with C++ as with C#, much due to the far less controlled use of pointers in C++.

So rather than fixing up and completing my old C++ code, I deleted several hundreds of lines, a good bunch of header files, brushed out the heap management code and adapted the remaining code to C# standards. I never looked back.

With C++, so much of my attention, and so many source lines, are wasted on things that are not solving the real problem; it is just red tape to facilitate the problem solution part. For C#, this is far less prominent.

Certainly, C# has inherited from C/C++ a number of elements I wish it had not. (An example: Why do we have to announce in advance with a "try" that the block has an exception handler? The handler is there, that should be enough!) Some of it may be ascribed to the old single-pass parsing ideals, but today there is no reason to accept such limitation. I can live with it, but it is ugly. But if I have the choice, I will not live with all that other required C++ blurb that really does nothing towards solving the problem at hand.
GeneralRe: What's the Most Concise, Human-Understandable Practical Language? Pin
Richard Deeming18-May-20 1:33
mveRichard Deeming18-May-20 1:33 
GeneralRe: What's the Most Concise, Human-Understandable Practical Language? Pin
kalberts18-May-20 4:30
kalberts18-May-20 4:30 
GeneralRe: What's the Most Concise, Human-Understandable Practical Language? Pin
Richard Deeming18-May-20 4:39
mveRichard Deeming18-May-20 4:39 
GeneralRe: What's the Most Concise, Human-Understandable Practical Language? Pin
kalberts18-May-20 20:59
kalberts18-May-20 20:59 
GeneralRe: What's the Most Concise, Human-Understandable Practical Language? Pin
Richard Deeming18-May-20 23:40
mveRichard Deeming18-May-20 23:40 
GeneralRe: What's the Most Concise, Human-Understandable Practical Language? Pin
kalberts19-May-20 6:55
kalberts19-May-20 6:55 
GeneralRe: What's the Most Concise, Human-Understandable Practical Language? Pin
Richard Deeming19-May-20 7:31
mveRichard Deeming19-May-20 7:31 
AnswerRe: What's the Most Concise, Human-Understandable Practical Language? Pin
Stuart Dootson18-May-20 0:59
professionalStuart Dootson18-May-20 0:59 
AnswerRe: What's the Most Concise, Human-Understandable Practical Language? Pin
BryanFazekas18-May-20 2:21
BryanFazekas18-May-20 2:21 
AnswerRe: What's the Most Concise, Human-Understandable Practical Language? Pin
W Balboos, GHB18-May-20 2:35
W Balboos, GHB18-May-20 2:35 
AnswerRe: What's the Most Concise, Human-Understandable Practical Language? Pin
Member 1181677618-May-20 3:47
Member 1181677618-May-20 3:47 
AnswerRe: What's the Most Concise, Human-Understandable Practical Language? Pin
sasadler18-May-20 8:51
sasadler18-May-20 8:51 
AnswerRe: What's the Most Concise, Human-Understandable Practical Language? Pin
nedzadarek18-May-20 10:25
nedzadarek18-May-20 10:25 
AnswerRe: What's the Most Concise, Human-Understandable Practical Language? Pin
B Alex Robinson18-May-20 13:45
B Alex Robinson18-May-20 13:45 
GeneralRe: What's the Most Concise, Human-Understandable Practical Language? Pin
Vikram A Punathambekar26-Jun-20 2:57
Vikram A Punathambekar26-Jun-20 2:57 
AnswerRe: What's the Most Concise, Human-Understandable Practical Language? Pin
Kirk 1038982118-May-20 14:56
Kirk 1038982118-May-20 14:56 
GeneralRe: What's the Most Concise, Human-Understandable Practical Language? Pin
nedzadarek19-May-20 3:55
nedzadarek19-May-20 3:55 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.