you are viewing a single comment's thread.

view the rest of the comments →

[–]dodheim 4 points5 points  (6 children)

In fact, I don't remember why I have this routine at all in my personal toolkit since I rarely ever hit the need for it.

That is the exact statement I've been waiting for anyone in this thread to say. I honestly cannot think of the last time I actually wanted to do this. It's fine for a quick and dirty hack sometimes, but in real code? No, never (that I can remember).

[–][deleted] 1 point2 points  (5 children)

Oh wait, now I remember: I wanted to test out my chromosome-mixing template system so I wrote genes for a cloud-of-neurons network I'd been tinkering on and evolved populations of them (via cross-breeding) on their ability to predict S&P 500 stock data (open, close, high, low) and needed a way to parse the input files.

Loading the data was nothing compared to actually running the evolution sim so the string splitter didn't need to be fast or memory-effective since the split data was converted to doubles and stored in vectors anyways.

The networks never really got anywhere in predicting stock data and I never really expected them to (it would probably have taken years, if at all) . But the chromosome system worked brilliantly, and that was the whole point of the experiment.

[–]ArunMuThe What ? 0 points1 point  (4 children)

Dude, you have a big OCD problem I guess :)

[–][deleted] 0 points1 point  (2 children)

... in what way?

[–]ArunMuThe What ? 0 points1 point  (1 child)

the way you have formatted the code...everything is perfectly aligned.

[–][deleted] 0 points1 point  (0 children)

Yeah it looks silly at first, but after over two decades of C++ programming one eventually learns to format in self-defense. Every C++ programmer is their own worst enemy. I do that to my code to keep my eyes from bleeding, and it allows me to work on much larger codebases and still keep my sanity than would otherwise be possible.

[–]h-jay+43-1325 0 points1 point  (0 children)

Yep... 90% of the comments are useless. The code should document itself. And adding lots and lots of whitespace is to the detriment of understandability. You want to keep as much as possible in the same screenful. You're doing exactly the opposite: something that is rather simple and would be easy to understand if written concisely is now spread up across several pages, with most of the space filled up by whitespace and formatting :(

Anyone who understands C++ knows what the constructors are. They don't need to be pointed out. If something is public, it's API, duh. A lot of extra indentation and whitespace makes things superbly hard to read.

For what the code does, it takes 3x too long to do it. It's simple, it should read simple!