Off Topic > Off Topic

Programming Megathread

Pages: << < (76/241) > >>

Tudoreleu:

woo i started a holy war

anyway i made a program a while ago in C++, maybe someone could take a look at it and tell me what i can do better (general practice-wise, not necessarily method-of-solving-the-problem wise)

http://dpaste.com/1M7Z5PB

edit: it's a program to solve http://www.infoarena.ro/problema/muzeu
works perfectly, i can translate the problem if you need it

Jairo:


--- Quote from: BluetoothBoy on January 25, 2016, 11:38:16 PM ---

--- End quote ---

--- Quote from: Foxscotch on January 26, 2016, 10:47:08 AM ---

--- End quote ---
you two are gods

thank you for the help

Foxscotch:

I can not believe that I just read this

"I would never hire such an open source freak, because i would fear he spents his work time on other things, and discloses company work outside or take company sources and starts an open-source-project with it. We want to live from our work, and get money for our hard work. I never understand these open-source people, why they give away hard work for nothing only to be famous to other nerds.
If you have to offer something valuable, you deserve money for it. If no one will pay, it's simply not worth your efforts.
They destroy markets without any sense, i will never assist such people. I should pay them money, and they spent it to kill markets - never ever. Go to north corea, they need such willingly morons"

Glass Joe:


--- Quote from: Tudoreleu on January 26, 2016, 12:57:02 PM ---woo i started a holy war

anyway i made a program a while ago in C++, maybe someone could take a look at it and tell me what i can do better (general practice-wise, not necessarily method-of-solving-the-problem wise)

--- End quote ---
in general, you should actually avoid using the "using namespace std" or "using namespace" entirely, for that matter. if you use a function that happens to have the same name as one in std (such as list, string, etc.) then the compiler takes the std version of that function first, leading to very hard to find bugs. it's safer to just prefix all functions in std with "std::"

ZSNO:


--- Quote from: Foxscotch on January 26, 2016, 12:49:00 PM ---there are 100 reasons this is completely ridiculous, but most importantly is the fact that command prompt/terminal/console/whatever you wanna call it windows are usually 80 characters wide. I don't know why, but that's how it is, and to my knowledge most people keep it that way. with spaces you can make sure they'll be able to see all of your code without moving to their mouse to resize the window or scroll right. with tabs, you can not

--- End quote ---
Yes, because everyone uses the console window to code.
Name 10 out of your 100 reasons as to why we should still be capped at 80 width.
(Hardmode: no reverse compatibility reasons)

You seem to be completely ignoring the reason for tabs. The point is that you can customize the displayed width of them in the editor you use.

Pages: << < (76/241) > >>

Go to full version