• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EST 21:18
CET 03:18
KST 11:18
  • Home
  • Forum
  • Calendar
  • Streams
  • Liquipedia
  • Features
  • Store
  • EPT
  • TL+
  • StarCraft 2
  • Brood War
  • Smash
  • Heroes
  • Counter-Strike
  • Overwatch
  • Liquibet
  • Fantasy StarCraft
  • TLPD
  • StarCraft 2
  • Brood War
  • Blogs
Forum Sidebar
Events/Features
News
Featured News
SC2 All-Star Invitational: Tournament Preview5RSL Revival - 2025 Season Finals Preview8RSL Season 3 - Playoffs Preview0RSL Season 3 - RO16 Groups C & D Preview0RSL Season 3 - RO16 Groups A & B Preview2
Community News
Weekly Cups (Jan 12-18): herO, MaxPax, Solar win0BSL Season 2025 - Full Overview and Conclusion6Weekly Cups (Jan 5-11): Clem wins big offline, Trigger upsets4$21,000 Rongyi Cup Season 3 announced (Jan 22-Feb 7)16Weekly Cups (Dec 29-Jan 4): Protoss rolls, 2v2 returns7
StarCraft 2
General
When will we find out if there are more tournament PhD study /w SC2 - help with a survey! Weekly Cups (Jan 12-18): herO, MaxPax, Solar win I am looking for StarCraft 2 Beta Patch files Stellar Fest "01" Jersey Charity Auction
Tourneys
$70 Prize Pool Ladder Legends Academy Weekly Open! SC2 All-Star Invitational: Jan 17-18 Sparkling Tuna Cup - Weekly Open Tournament SC2 AI Tournament 2026 $21,000 Rongyi Cup Season 3 announced (Jan 22-Feb 7)
Strategy
Simple Questions Simple Answers
Custom Maps
Map Editor closed ?
External Content
Mutation # 509 Doomsday Report Mutation # 508 Violent Night Mutation # 507 Well Trained Mutation # 506 Warp Zone
Brood War
General
Gypsy to Korea [ASL21] Potential Map Candidates Video Footage from 2005: The Birth of G2 in Spain BW General Discussion BGH Auto Balance -> http://bghmmr.eu/
Tourneys
[Megathread] Daily Proleagues [BSL21] Non-Korean Championship - Starts Jan 10 Small VOD Thread 2.0 Azhi's Colosseum - Season 2
Strategy
Simple Questions, Simple Answers Soma's 9 hatch build from ASL Game 2 Game Theory for Starcraft Current Meta
Other Games
General Games
Nintendo Switch Thread Battle Aces/David Kim RTS Megathread Stormgate/Frost Giant Megathread Beyond All Reason Awesome Games Done Quick 2026!
Dota 2
Official 'what is Dota anymore' discussion
League of Legends
Heroes of the Storm
Simple Questions, Simple Answers Heroes of the Storm 2.0
Hearthstone
Deck construction bug Heroes of StarCraft mini-set
TL Mafia
Vanilla Mini Mafia Mafia Game Mode Feedback/Ideas
Community
General
US Politics Mega-thread Russo-Ukrainian War Thread NASA and the Private Sector Things Aren’t Peaceful in Palestine Canadian Politics Mega-thread
Fan Clubs
The herO Fan Club! The IdrA Fan Club
Media & Entertainment
Anime Discussion Thread [Manga] One Piece
Sports
2024 - 2026 Football Thread
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread
TL Community
The Automated Ban List
Blogs
Navigating the Risks and Rew…
TrAiDoS
My 2025 Magic: The Gathering…
DARKING
Life Update and thoughts.
FuDDx
How do archons sleep?
8882
James Bond movies ranking - pa…
Topin
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1179 users

The Big Programming Thread - Page 962

Forum Index > General Forum
Post a Reply
Prev 1 960 961 962 963 964 1032 Next
Thread Rules
1. This is not a "do my homework for me" thread. If you have specific questions, ask, but don't post an assignment or homework problem and expect an exact solution.
2. No recruiting for your cockamamie projects (you won't replace facebook with 3 dudes you found on the internet and $20)
3. If you can't articulate why a language is bad, don't start slinging shit about it. Just remember that nothing is worse than making CSS IE6 compatible.
4. Use [code] tags to format code blocks.
Hanh
Profile Joined June 2016
146 Posts
May 26 2018 06:33 GMT
#19221
On May 26 2018 12:28 Liquid`Jinro wrote:
Show nested quote +
Python is often the first (and only) language a lot of people learn when they're really educated in something else (Like Maths or Physics) but need to make a program to do calculations for them. They often have a poor or no concept of good practices, optimisation, or how half the things they're doing even works. For instance: Deep Learning is, at the moment, almost exclusively done in Python. Not because C++ wouldn't be vastly superior for it, but simply because half the people working on it have no idea how to program when they start out, and they're just grabbing the easiest tool they can learn in the shortest amount of time.

so tl;dr: Yes.

For the people not actively developing new algorithms, what would the benefit be to working in C++ instead of Python? From what I can recall, the performance of most of the computational python libraries are basically c/c++ levels of performance (since they are just calling c/c++ anyway), and can in some cases even be improved with something like cython.

(I don't work in this field, just learning because I'm interested - I'm basically what you describe: only know python... and a little bit of R)


EDIT: I guess basically what bo1b said already.


To be clear, the scientific python libraries have good performance since they wrap highly optimized numeric C code but it doesn't mean that a python program using them will be fast. It depends on how much work will be executed by the libraries, how much data must be transferred back/forth from python to C memory space, how much vectorization could be used and many other factors.
For a different approach, have you tried Julia?
bo1b
Profile Blog Joined August 2012
Australia12814 Posts
Last Edited: 2018-05-26 08:17:43
May 26 2018 08:14 GMT
#19222
On May 26 2018 12:28 Liquid`Jinro wrote:
Show nested quote +
Python is often the first (and only) language a lot of people learn when they're really educated in something else (Like Maths or Physics) but need to make a program to do calculations for them. They often have a poor or no concept of good practices, optimisation, or how half the things they're doing even works. For instance: Deep Learning is, at the moment, almost exclusively done in Python. Not because C++ wouldn't be vastly superior for it, but simply because half the people working on it have no idea how to program when they start out, and they're just grabbing the easiest tool they can learn in the shortest amount of time.

so tl;dr: Yes.

For the people not actively developing new algorithms, what would the benefit be to working in C++ instead of Python? From what I can recall, the performance of most of the computational python libraries are basically c/c++ levels of performance (since they are just calling c/c++ anyway), and can in some cases even be improved with something like cython.

(I don't work in this field, just learning because I'm interested - I'm basically what you describe: only know python... and a little bit of R)


EDIT: I guess basically what bo1b said already.

The benefits of memory optimisation are hard to overstate, putting aside machine learning and other forms of scientific computing (which is still done in c/c++ btw, tensorflow is written in c++, even if it has an api in python), pretty much everything that is performance orientated is written in c/c++, or has an api which calls to c/c++. Any language at all which doesn't allow (and expect!) you to manually manage the memory is doing it for you, and as machine learning hasn't yet hit garbage collectors the performance losses are obscene. Take this with an enourmous grain of salt, every single one of these programs has had the books cooked:

https://benchmarksgame-team.pages.debian.net/benchmarksgame/faster/python3-gpp.html

Worth noting that for somethings memory management is not optional, I'm not sure if your learning at a university or not, but if you are, and the university is worth it's salt you'll do some operating system development, and see some practical examples of just how important memory really is.

On the other hand, there is very little benefit aside from performance that I can think of. Python is safer, faster and easier to get a program up and running then c/c++.

As an aside in theory c should compile down to a smaller faster executable than c++, yet I've noticed as the program gets more and more abstract, c++ gets comparatively faster.

As another aside, Rust is amazing, more people should use it.
Silvanel
Profile Blog Joined March 2003
Poland4742 Posts
Last Edited: 2018-05-26 08:37:47
May 26 2018 08:35 GMT
#19223
Well, if memory optimalization is important Python most likely isnt You desired solution.That should be obvious to anyone who knows how it works. However if speed of deployment is essential Python is the way to go. Thats why its so widely used for tests.

An example:
Since we work embedded most of our code is in C++ and most of our tests are in Python (even though we dont have standards for testing lanagauge and every team can chose what they want they mostly have chosen Python). So we have neatly optimazed code running on embedded product in C++ and quickly deployable tests run on PC where we dont need to worry about lack of resources. Chosing right tool for a job is important.
Pathetic Greta hater.
bo1b
Profile Blog Joined August 2012
Australia12814 Posts
May 26 2018 08:36 GMT
#19224
I think it's time the front page was updated tbh, is there someone I can pm with some useful resources to those thinking of studying cs?
Khalum
Profile Joined September 2010
Austria831 Posts
May 26 2018 08:55 GMT
#19225
On May 26 2018 09:05 nunez wrote:
[..] i really dislike the built-in "shared-pointer copy semantics" of openCV.


You mean that you explicitly have to ask for deep copies of matrices? I think that's pretty brilliant since memory operations are minimized but at the same time it's one hell of a trap if someone doesn't really know what they're doing.
Manit0u
Profile Blog Joined August 2004
Poland17612 Posts
Last Edited: 2018-05-26 09:16:07
May 26 2018 09:09 GMT
#19226
tofu is still active so hit him I guess.

Also, on the note of performance and all, it really depends on what you're working with. If you need to work with distributed systems and a lot of parallelism then it's hard to beat Erlang for example.

And I have no idea why they won't simply release a brand new C and C++ but with more friendly syntax. I mean, what matters is what it compiles down to right? Languages like Python and Ruby are also popular because they're simply a joy to write code with as you don't have to deal with metric tons of syntactic sugar and can focus on what you want to accomplish rather than how to write it properly.

The same thing in C:

int compare_int(const void* a, const void* b)
{
if (*(int*)a == *(int*)b)
{
return 0;
}

return *(int*)a < *(int*)b ? -1 : 1;
}

const size_t num_elem = 10;
int elements[num_elem] = { 3, 6, 1, 9, 8, 2, 0, 5, 7, 4 };
qsort(elements, num_elem, sizeof(int), compare_int);


Ruby:

ary = [3, 6, 1, 9, 8, 2, 0, 5, 7, 4]
ary.sort


Python:

nums = [3, 6, 1, 9, 8, 2, 0, 5, 7, 4]
nums.sort()


I know this is a really bad example...

I'm by no means an expert in C but I think it could really use some library manager (like Rust's Cargo) and a good batch of standard libraries that would implement stuff that people might want to use commonly (like arrays that contain values of different types and hash tables for example).
Time is precious. Waste it wisely.
emperorchampion
Profile Blog Joined December 2008
Canada9496 Posts
May 26 2018 09:22 GMT
#19227
That’s why you use C++
TRUEESPORTS || your days as a respected member of team liquid are over
Liquid`Jinro
Profile Blog Joined September 2002
Sweden33719 Posts
Last Edited: 2018-05-26 10:00:12
May 26 2018 09:53 GMT
#19228
On May 26 2018 17:14 bo1b wrote:
Show nested quote +
On May 26 2018 12:28 Liquid`Jinro wrote:
Python is often the first (and only) language a lot of people learn when they're really educated in something else (Like Maths or Physics) but need to make a program to do calculations for them. They often have a poor or no concept of good practices, optimisation, or how half the things they're doing even works. For instance: Deep Learning is, at the moment, almost exclusively done in Python. Not because C++ wouldn't be vastly superior for it, but simply because half the people working on it have no idea how to program when they start out, and they're just grabbing the easiest tool they can learn in the shortest amount of time.

so tl;dr: Yes.

For the people not actively developing new algorithms, what would the benefit be to working in C++ instead of Python? From what I can recall, the performance of most of the computational python libraries are basically c/c++ levels of performance (since they are just calling c/c++ anyway), and can in some cases even be improved with something like cython.

(I don't work in this field, just learning because I'm interested - I'm basically what you describe: only know python... and a little bit of R)


EDIT: I guess basically what bo1b said already.

The benefits of memory optimisation are hard to overstate, putting aside machine learning and other forms of scientific computing (which is still done in c/c++ btw, tensorflow is written in c++, even if it has an api in python), pretty much everything that is performance orientated is written in c/c++, or has an api which calls to c/c++. Any language at all which doesn't allow (and expect!) you to manually manage the memory is doing it for you, and as machine learning hasn't yet hit garbage collectors the performance losses are obscene. Take this with an enourmous grain of salt, every single one of these programs has had the books cooked:

https://benchmarksgame-team.pages.debian.net/benchmarksgame/faster/python3-gpp.html

Worth noting that for somethings memory management is not optional, I'm not sure if your learning at a university or not, but if you are, and the university is worth it's salt you'll do some operating system development, and see some practical examples of just how important memory really is.

On the other hand, there is very little benefit aside from performance that I can think of. Python is safer, faster and easier to get a program up and running then c/c++.

As an aside in theory c should compile down to a smaller faster executable than c++, yet I've noticed as the program gets more and more abstract, c++ gets comparatively faster.

As another aside, Rust is amazing, more people should use it.

Yeah I know the underlying stuff is in c/c++, I just mean't that a user of them don't need to know c/c++, since it has the nice and friendly python api available.

Thanks for the thorough answer, I'm just learning on my own, I still play poker full time but have taken a bunch of intro CS/data science courses because they are interesting, and python is quite handy when you want to analyze massive amounts of data which modern poker tends to generate.
Moderatortell the guy that interplanatar interaction is pivotal to terrans variety of optionitudals in the pre-midgame preperatories as well as the protosstinal deterriggation of elite zergling strikes - Stimey n | Formerly FrozenArbiter
Manit0u
Profile Blog Joined August 2004
Poland17612 Posts
May 26 2018 10:46 GMT
#19229
On May 26 2018 18:22 emperorchampion wrote:
That’s why you use C++


C++ is atrocious though
Time is precious. Waste it wisely.
bo1b
Profile Blog Joined August 2012
Australia12814 Posts
Last Edited: 2018-05-26 10:54:53
May 26 2018 10:54 GMT
#19230
The modern version of c tbh is rust, in a large number of ways. Unfortunately, I don't think it's possible to tidy up all the syntax without removing functionality an awful lot of people rely on. c++ is ridiculous a lot of the time, but a large part of the appeal is having all the functionality of any language you can think of (except modules of course) + the kitchen sink. I don't think you can have both that and simple syntax. Might want to look into std::sort as well, you can achieve a sorted array quite nicely without 10 lines of code in c++ something like this:

std::vector<int> sortThis = {3, 6, 1, 9, 8, 2, 0, 5, 7, 4};
std::sort(sortThis.begin(),sortThis.end());

The other reality is that an awful lot of people quite like the strict syntax, it's a feature to me not a pain.

Jinro unfortunately not everything is written in c/c++ with a python library attached, and for those many cases getting dirty with a lower level language is sometimes unavoidable. I also disagree to a certain degree about not needing to know the underlying library, if only because an awful lot of it is years or decades old and may not interface well with the newest version or w/e language you're running.

On May 26 2018 19:46 Manit0u wrote:
Show nested quote +
On May 26 2018 18:22 emperorchampion wrote:
That’s why you use C++


C++ is atrocious though


lol, I love and hate c++, simultaneously.
sc-darkness
Profile Joined August 2017
856 Posts
Last Edited: 2018-05-26 10:58:35
May 26 2018 10:58 GMT
#19231
On May 26 2018 19:46 Manit0u wrote:
Show nested quote +
On May 26 2018 18:22 emperorchampion wrote:
That’s why you use C++


C++ is atrocious though


That's because you don't understand its beauty. I think you prefer C, and I'll be glad if I never have to depend on your code simply because of inherently easy memory leaks there. Just use RAII and <memory> and forget about 99% of memory leaks.
bo1b
Profile Blog Joined August 2012
Australia12814 Posts
May 26 2018 11:00 GMT
#19232
C++ is a lot of things, but safe is a word I'd avoid.
sc-darkness
Profile Joined August 2017
856 Posts
May 26 2018 11:01 GMT
#19233
It's safer than C for sure. There's no discussion about it.
bo1b
Profile Blog Joined August 2012
Australia12814 Posts
May 26 2018 11:03 GMT
#19234
For every tool c++ gives you to be safe, it gives another weapon to shoot yourself in the foot with. There are many reasons os development is done with c, not c++.
sc-darkness
Profile Joined August 2017
856 Posts
Last Edited: 2018-05-26 11:08:00
May 26 2018 11:05 GMT
#19235
I don't do OS development, but I'm pretty sure C was chosen at the time for performance reasons. C, at least at the time, was still faster than C++. Now things are a bit different, sometimes C++ abstractions are as fast as C functions or sometimes slightly faster.

Edit: Also C is smaller in size.
bo1b
Profile Blog Joined August 2012
Australia12814 Posts
May 26 2018 11:10 GMT
#19236
With gratuitous template usage you can make c++ faster then c, at least when the problem crosses a certain threshold of complexity. There are many reasons c++ is used pretty much universally where time matters the most, more then anything. And then there are reasons why it's not used in operating system development, many to do with run time size and how it compiles, believe it or not c++ and c do not compile to the same machine code.

Again, c++ is only as safe as you allow yourself to be, as soon as you start using templates you'll start enjoying that "safety"
sc-darkness
Profile Joined August 2017
856 Posts
May 26 2018 11:13 GMT
#19237
What operating systems have been developed since C++ became popular though?
bo1b
Profile Blog Joined August 2012
Australia12814 Posts
Last Edited: 2018-05-26 11:29:13
May 26 2018 11:25 GMT
#19238
I'm not sure if it counts, as I'm not entirely sure on the time frame your talking here, but modern windows I think is the most likely, and it's kernel was written in c. Android is based on linux with c++ on top, but again it's kernel is in c, I'm not sure about ios and how much was based on osx, but it's written in c as well for the kernel.

I guess in terms of brand new Redox is probably the closest, written in the language I honestly expect to replace c/c++ in the coming decades.
Excludos
Profile Blog Joined April 2010
Norway8231 Posts
Last Edited: 2018-05-26 11:34:47
May 26 2018 11:26 GMT
#19239
On May 26 2018 08:53 nunez wrote:
@excludos
qt should be quarantined to the code that deals with the gui, and even there it should be used as sparingly as possible. for that it's an ok option, but for anything else there are better alternatives. if someone suggested that we use qt for signals / slots at work, he / she would also be quarantined to code that deals with gui.

some never get comfortable with the complexity of c++, and seek refuge in the abstract comfort of Qt or C# or python or whatever. parading this retreat as ersatz critique seems common.


What do you base your answer on here? Qt has loads of plugins and tools for back end purposes and is made to work equally well for that as front end. I wouldn't suggest you use it just because of signals and slots, but because it literally has an answer for all of your problems (Hyperbole of course. There's loads of things it doesn't do as well. Like heavy calculations or image operations). A lot of those problems can be solved with a external library each..or you can just remove all of them and use Qt instead. I'm also not saying it's the only tool for the job or something you must use in all situations, just that it's very good for a lot of them, and not something you should just dismiss based on..whatever you think you're basing it on. I don't know what kind of misconceptions you have about it, but I'd love to know
nunez
Profile Blog Joined February 2011
Norway4003 Posts
May 26 2018 11:40 GMT
#19240
On May 26 2018 17:55 Khalum wrote:
Show nested quote +
On May 26 2018 09:05 nunez wrote:
[..] i really dislike the built-in "shared-pointer copy semantics" of openCV.


You mean that you explicitly have to ask for deep copies of matrices? I think that's pretty brilliant since memory operations are minimized but at the same time it's one hell of a trap if someone doesn't really know what they're doing.


'memory operations' are minimized? i am not suggesting making extra copies, but there are oh so many tools ready at hand for "avoiding copies" (references, an arsenal of pointer-types, containers, statics even). in most scenario's you easily get away by using the most trivial of tools (f.ex. a reference).

one only needs thread-safe reference-counting for the most complex of scenarios, and then std::shared_ptr / std::weak_ptr is ready at hand, which works for _any_ type.

types with baked-in reference-counting is haram. 'cloning' and 'deep-copy' is alien terminology.
conspired against by a confederacy of dunces.
Prev 1 960 961 962 963 964 1032 Next
Please log in or register to reply.
Live Events Refresh
Next event in 8h 42m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
PiGStarcraft519
Nathanias 91
StarCraft: Brood War
GuemChi 1141
Sharp 230
Shuttle 96
HiyA 84
Stormgate
Artosis846
Dota 2
monkeys_forever208
febbydoto15
NeuroSwarm5
League of Legends
C9.Mang0533
Counter-Strike
fl0m1325
taco 349
m0e_tv211
Foxcn186
Coldzera 6
Other Games
summit1g6027
JimRising 513
XaKoH 331
Day[9].tv243
Maynarde157
minikerr28
ZombieGrub24
Liquid`Ken5
Organizations
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 17 non-featured ]
StarCraft 2
• Hupsaiya 93
• HeavenSC 28
• AfreecaTV YouTube
• sooper7s
• intothetv
• Kozan
• Migwel
• IndyKCrew
• LaughNgamezSOOP
• Laughngamez YouTube
StarCraft: Brood War
• Mapu6
• STPLYoutube
• ZZZeroYoutube
• BSLYoutube
Dota 2
• masondota21418
League of Legends
• Scarra2052
Other Games
• Day9tv243
Upcoming Events
OSC
8h 42m
Shameless vs MaNa
Nicoract vs Percival
Krystianer vs TBD
Cure vs SHIN
PiGosaur Monday
22h 42m
The PondCast
1d 7h
OSC
1d 8h
Big Brain Bouts
3 days
Serral vs TBD
BSL 21
4 days
BSL 21
5 days
Wardi Open
6 days
Monday Night Weeklies
6 days
Liquipedia Results

Completed

IPSL Winter 2025-26
SC2 All-Star Inv. 2025
NA Kuram Kup

Ongoing

C-Race Season 1
BSL 21 Non-Korean Championship
CSL 2025 WINTER (S19)
KCM Race Survival 2026 Season 1
OSC Championship Season 13
Underdog Cup #3
BLAST Bounty Winter Qual
eXTREMESLAND 2025
SL Budapest Major 2025
ESL Impact League Season 8
BLAST Rivals Fall 2025
IEM Chengdu 2025

Upcoming

Escore Tournament S1: W5
Acropolis #4
IPSL Spring 2026
Bellum Gens Elite Stara Zagora 2026
HSC XXVIII
Rongyi Cup S3
Nations Cup 2026
PGL Bucharest 2026
Stake Ranked Episode 1
BLAST Open Spring 2026
ESL Pro League Season 23
ESL Pro League Season 23
PGL Cluj-Napoca 2026
IEM Kraków 2026
BLAST Bounty Winter 2026
TLPD

1. ByuN
2. TY
3. Dark
4. Solar
5. Stats
6. Nerchio
7. sOs
8. soO
9. INnoVation
10. Elazer
1. Rain
2. Flash
3. EffOrt
4. Last
5. Bisu
6. Soulkey
7. Mini
8. Sharp
Sidebar Settings...

Advertising | Privacy Policy | Terms Of Use | Contact Us

Original banner artwork: Jim Warren
The contents of this webpage are copyright © 2026 TLnet. All Rights Reserved.