• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EST 10:29
CET 16:29
KST 00:29
  • 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
TL.net Map Contest #21: Winners11Intel X Team Liquid Seoul event: Showmatches and Meet the Pros10[ASL20] Finals Preview: Arrival13TL.net Map Contest #21: Voting12[ASL20] Ro4 Preview: Descent11
Community News
[TLMC] Fall/Winter 2025 Ladder Map Rotation6Weekly Cups (Nov 3-9): Clem Conquers in Canada4SC: Evo Complete - Ranked Ladder OPEN ALPHA8StarCraft, SC2, HotS, WC3, Returning to Blizzcon!45$5,000+ WardiTV 2025 Championship7
StarCraft 2
General
[TLMC] Fall/Winter 2025 Ladder Map Rotation Mech is the composition that needs teleportation t Weekly Cups (Nov 3-9): Clem Conquers in Canada Craziest Micro Moments Of All Time? SC: Evo Complete - Ranked Ladder OPEN ALPHA
Tourneys
Constellation Cup - Main Event - Stellar Fest Tenacious Turtle Tussle Sparkling Tuna Cup - Weekly Open Tournament $5,000+ WardiTV 2025 Championship Merivale 8 Open - LAN - Stellar Fest
Strategy
Custom Maps
Map Editor closed ?
External Content
Mutation # 499 Chilling Adaptation Mutation # 498 Wheel of Misfortune|Cradle of Death Mutation # 497 Battle Haredened Mutation # 496 Endless Infection
Brood War
General
BW General Discussion FlaSh on: Biggest Problem With SnOw's Playstyle Terran 1:35 12 Gas Optimization BGH Auto Balance -> http://bghmmr.eu/ [ASL20] Ask the mapmakers — Drop your questions
Tourneys
[BSL21] RO32 Group D - Sunday 21:00 CET [BSL21] RO32 Group C - Saturday 21:00 CET [ASL20] Grand Finals [Megathread] Daily Proleagues
Strategy
Current Meta PvZ map balance How to stay on top of macro? Soma's 9 hatch build from ASL Game 2
Other Games
General Games
EVE Corporation Nintendo Switch Thread Stormgate/Frost Giant Megathread Should offensive tower rushing be viable in RTS games? Path of Exile
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
TL Mafia Community Thread SPIRED by.ASL Mafia {211640}
Community
General
US Politics Mega-thread Russo-Ukrainian War Thread Things Aren’t Peaceful in Palestine Canadian Politics Mega-thread The Games Industry And ATVI
Fan Clubs
White-Ra Fan Club The herO Fan Club!
Media & Entertainment
[Manga] One Piece Anime Discussion Thread Movie Discussion! Korean Music Discussion Series you have seen recently...
Sports
2024 - 2026 Football Thread Formula 1 Discussion NBA General Discussion MLB/Baseball 2023 TeamLiquid Health and Fitness Initiative For 2023
World Cup 2022
Tech Support
SC2 Client Relocalization [Change SC2 Language] Linksys AE2500 USB WIFI keeps disconnecting Computer Build, Upgrade & Buying Resource Thread
TL Community
The Automated Ban List
Blogs
Dyadica Gospel – a Pulp No…
Hildegard
Coffee x Performance in Espo…
TrAiDoS
Saturation point
Uldridge
DnB/metal remix FFO Mick Go…
ImbaTosS
Reality "theory" prov…
perfectspheres
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1235 users

The Big Programming Thread - Page 829

Forum Index > General Forum
Post a Reply
Prev 1 827 828 829 830 831 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
January 19 2017 02:10 GMT
#16561
Virtual dispatch is slower in many cases. Consider that an indirect call cannot be predicted nor inlined. Some benchmarks have found a difference of 7 x in favor of static calls.
Nesserev
Profile Blog Joined January 2011
Belgium2760 Posts
January 19 2017 03:29 GMT
#16562
--- Nuked ---
Svazila
Profile Joined January 2017
1 Post
January 19 2017 05:21 GMT
#16563
--- Nuked ---
Blisse
Profile Blog Joined July 2010
Canada3710 Posts
Last Edited: 2017-01-19 07:34:07
January 19 2017 07:30 GMT
#16564
On January 19 2017 12:29 Nesserev wrote:
Started reading the 'Modern C' book that was linked by Biolunar + Show Spoiler [a few pages back] +
On January 03 2017 20:37 Biolunar wrote:
Show nested quote +
On January 03 2017 00:20 Silvanel wrote:
What resources would You guys recommend to someone trying to learn C ?

This might be too hard if you have no programming experience, but if you do, use this:
http://icube-icps.unistra.fr/index.php/File:ModernC.pdf
This book focuses on how to avoid many of C’s pitfalls and teaches many good habits that are not possible in older versions of the language.

.
What's your opinion on using the 'array notation' for passing arrays as arguments to functions in C/C++?

On page 13-14, the book recommends the array notation, naming readability and (what comes down to) documentation as reasons. On the other hand, it obfuscates what's really going on (it's just a pointer in the end, and you probably need to pass an extra size_t anyway), and seems to lead to obscure/hard-to-find bugs.

Anything I missed?


Not always right to quote Linus but here's his thoughts.

https://lkml.org/lkml/2015/9/3/428


static bool rate_control_cap_mask(struct ieee80211_sub_if_data *sdata,
struct ieee80211_supported_band *sband,
struct ieee80211_sta *sta, u32 *mask,
u8 mcs_mask[IEEE80211_HT_MCS_MASK_LEN])

...

for (i = 0; i < sizeof(mcs_mask); i++)

the "sizeof(mcs_mask)" is _shit_. Since array arguments don't actually
exist in C, it is the size of the pointer, not the array. The first
mistake makes the bug look like reasonable code.

...

I realy want people to take a really hard look at functions that use
arrays as arguments. It really is very misleading, even if it can look
"prettier", and some people will argue that it's "documentation" about
how the pointer is a particular size. But it's neither. It's basically
just lying about what is going on, and the only thing it documents is
"I don't know how to C". Misleading documentation isn't documentation,
it's a mistake.


I've never seen the array notation in production code so I'd never use it. My coding conventions and/or abstractions make it clear enough what's going on, i.e. arr and arrLength as param names, or passing structs with size members.
There is no one like you in the universe.
Biolunar
Profile Joined February 2012
Germany224 Posts
Last Edited: 2017-01-19 11:32:50
January 19 2017 11:30 GMT
#16565
On January 19 2017 12:29 Nesserev wrote:
Started reading the 'Modern C' book that was linked by Biolunar + Show Spoiler [a few pages back] +
On January 03 2017 20:37 Biolunar wrote:
Show nested quote +
On January 03 2017 00:20 Silvanel wrote:
What resources would You guys recommend to someone trying to learn C ?

This might be too hard if you have no programming experience, but if you do, use this:
http://icube-icps.unistra.fr/index.php/File:ModernC.pdf
This book focuses on how to avoid many of C’s pitfalls and teaches many good habits that are not possible in older versions of the language.

.
What's your opinion on using the 'array notation' for passing arrays as arguments to functions in C/C++?

On page 13-14, the book recommends the array notation, naming readability and (what comes down to) documentation as reasons. On the other hand, it obfuscates what's really going on (it's just a pointer in the end, and you probably need to pass an extra size_t anyway), and seems to lead to obscure/hard-to-find bugs.

Anything I missed?

Every C programmer should know what array to pointer decay is. Array notations in function declarations are just eye candy. Just follow your own intuition.

I am starting to use the following convention:
  • void foo(T param[static 1]); for functions that take exactly one parameter as a pointer
  • void foo(T* param); for functions that take exactly one parameter as a pointer or a null pointer
  • void foo(T param[static N], size_t count); for functions that take at least N parameters, where N is an integral constant expression

That book also uses VLAs for array parameters which I don’t use. Ever.
What is best? To crush the Zerg, see them driven before you, and hear the lamentations of the Protoss.
spinesheath
Profile Blog Joined June 2009
Germany8679 Posts
January 19 2017 18:31 GMT
#16566
On January 19 2017 11:10 Hanh wrote:
Virtual dispatch is slower in many cases. Consider that an indirect call cannot be predicted nor inlined. Some benchmarks have found a difference of 7 x in favor of static calls.

Of course a virtual dispatch is slower than a static call. But virtual dispatch is not necessarily slower than a conditional. Especially if there are many branches or the comparision is complex, like a string comparision.
If you have a good reason to disagree with the above, please tell me. Thank you.
Hanh
Profile Joined June 2016
146 Posts
January 20 2017 00:30 GMT
#16567
I was not talking about a dumb static call but static dispatch. Some compilers actually implement 'devirtualization' for this reason.
Blisse
Profile Blog Joined July 2010
Canada3710 Posts
Last Edited: 2017-01-20 04:03:42
January 20 2017 00:43 GMT
#16568
On January 19 2017 20:30 Biolunar wrote:
Show nested quote +
On January 19 2017 12:29 Nesserev wrote:
Started reading the 'Modern C' book that was linked by Biolunar + Show Spoiler [a few pages back] +
On January 03 2017 20:37 Biolunar wrote:
Show nested quote +
On January 03 2017 00:20 Silvanel wrote:
What resources would You guys recommend to someone trying to learn C ?

This might be too hard if you have no programming experience, but if you do, use this:
http://icube-icps.unistra.fr/index.php/File:ModernC.pdf
This book focuses on how to avoid many of C’s pitfalls and teaches many good habits that are not possible in older versions of the language.

.
What's your opinion on using the 'array notation' for passing arrays as arguments to functions in C/C++?

On page 13-14, the book recommends the array notation, naming readability and (what comes down to) documentation as reasons. On the other hand, it obfuscates what's really going on (it's just a pointer in the end, and you probably need to pass an extra size_t anyway), and seems to lead to obscure/hard-to-find bugs.

Anything I missed?

Every C programmer should know what array to pointer decay is. Array notations in function declarations are just eye candy. Just follow your own intuition.

I am starting to use the following convention:
  • void foo(T param[static 1]); for functions that take exactly one parameter as a pointer
  • void foo(T* param); for functions that take exactly one parameter as a pointer or a null pointer
  • void foo(T param[static N], size_t count); for functions that take at least N parameters, where N is an integral constant expression

That book also uses VLAs for array parameters which I don’t use. Ever.


The problem with the static keyword and the array notation is it still looks like sizeof(param) will return N instead of sizeof(T*), even if you're familiar with the array decay. In C I think it's super important to practice defensive programming, which is to avoid situations like this, as per the Linus example I linked previously.

Or I may be misreading your convention, in which case why use a param array instead of the param directly? I've never seen a param array like that. That looks like a typecasting error prone nightmare?
There is no one like you in the universe.
BlueRoyaL
Profile Blog Joined February 2006
United States2493 Posts
January 20 2017 05:57 GMT
#16569
Hey guys, I have a (semi) silly question, just want to get your opinions.

I've been thinking of starting to blog again about programming stuff. I had set one up a couple years ago that's titled "Finally Working", with the sub text "thank god it compiled".

At the time I thought it was funny, and i wouldnt mind continuing to use it. But from your professional standpoint, does it seem a little weird or offsetting? As in, if you were some recruiter and happened to be on the page, would it bother you that the creator used the line "thank god it compiled", possibly indicating some level of ineptitude in programming?

I might just be overthinking this, any thoughts?
WHAT'S HAPPENIN
Blisse
Profile Blog Joined July 2010
Canada3710 Posts
January 20 2017 07:22 GMT
#16570
On January 20 2017 14:57 BlueRoyaL wrote:
Hey guys, I have a (semi) silly question, just want to get your opinions.

I've been thinking of starting to blog again about programming stuff. I had set one up a couple years ago that's titled "Finally Working", with the sub text "thank god it compiled".

At the time I thought it was funny, and i wouldnt mind continuing to use it. But from your professional standpoint, does it seem a little weird or offsetting? As in, if you were some recruiter and happened to be on the page, would it bother you that the creator used the line "thank god it compiled", possibly indicating some level of ineptitude in programming?

I might just be overthinking this, any thoughts?


In my opinion no one would care if you had more than 3 non-insignificant blog posts.
There is no one like you in the universe.
RoomOfMush
Profile Joined March 2015
1296 Posts
January 20 2017 10:26 GMT
#16571
On January 20 2017 14:57 BlueRoyaL wrote:
Hey guys, I have a (semi) silly question, just want to get your opinions.

I've been thinking of starting to blog again about programming stuff. I had set one up a couple years ago that's titled "Finally Working", with the sub text "thank god it compiled".

At the time I thought it was funny, and i wouldnt mind continuing to use it. But from your professional standpoint, does it seem a little weird or offsetting? As in, if you were some recruiter and happened to be on the page, would it bother you that the creator used the line "thank god it compiled", possibly indicating some level of ineptitude in programming?

I might just be overthinking this, any thoughts?

I wouldnt care. But how useful this information is to you I dont know.
Acrofales
Profile Joined August 2010
Spain18114 Posts
January 20 2017 10:39 GMT
#16572
On January 20 2017 14:57 BlueRoyaL wrote:
Hey guys, I have a (semi) silly question, just want to get your opinions.

I've been thinking of starting to blog again about programming stuff. I had set one up a couple years ago that's titled "Finally Working", with the sub text "thank god it compiled".

At the time I thought it was funny, and i wouldnt mind continuing to use it. But from your professional standpoint, does it seem a little weird or offsetting? As in, if you were some recruiter and happened to be on the page, would it bother you that the creator used the line "thank god it compiled", possibly indicating some level of ineptitude in programming?

I might just be overthinking this, any thoughts?

If your blog is useful, the title doesn't matter. If your blog is useless/bad, the least you have to worry about is choosing a funny title.

In other words, if your blog sucks, don't show it to your future employer. If it is good, add it to your CV. In either case, don't worry about the title.
Djagulingu
Profile Blog Joined December 2010
Germany3605 Posts
Last Edited: 2017-01-20 12:47:09
January 20 2017 12:46 GMT
#16573
On January 20 2017 14:57 BlueRoyaL wrote:
Hey guys, I have a (semi) silly question, just want to get your opinions.

I've been thinking of starting to blog again about programming stuff. I had set one up a couple years ago that's titled "Finally Working", with the sub text "thank god it compiled".

At the time I thought it was funny, and i wouldnt mind continuing to use it. But from your professional standpoint, does it seem a little weird or offsetting? As in, if you were some recruiter and happened to be on the page, would it bother you that the creator used the line "thank god it compiled", possibly indicating some level of ineptitude in programming?

I might just be overthinking this, any thoughts?

Yes you're overthinking. As long as your content is halfway decent, the single worst thing the recruiter could think about that title is "Good thing this dude is not a comedian or some shit".
"windows bash is a steaming heap of shit" tofucake
Manit0u
Profile Blog Joined August 2004
Poland17429 Posts
January 20 2017 13:08 GMT
#16574
Will this blog be only about compiled languages?
Time is precious. Waste it wisely.
BlueRoyaL
Profile Blog Joined February 2006
United States2493 Posts
January 20 2017 16:00 GMT
#16575
On January 20 2017 22:08 Manit0u wrote:
Will this blog be only about compiled languages?


Not necessarily. I was mainly a sysadmin back when i created it, but since then i've pivoted and work as a dev on the full stack. There might occasionally be something about frontend stuff as well.
WHAT'S HAPPENIN
phar
Profile Joined August 2011
United States1080 Posts
January 20 2017 17:00 GMT
#16576
Is the title sort of sarcastically pointing out that cowboy coding and shipping shit as soon as it compiles causes people problems down the road (e.g. the poor saps on call)? If so I think it's a genius title if you can pull in some horror stories from sysadmin days when you got burned by that sort of thing.
Who after all is today speaking about the destruction of the Armenians?
Manit0u
Profile Blog Joined August 2004
Poland17429 Posts
January 24 2017 12:25 GMT
#16577
https://aturon.github.io/blog/2016/08/11/futures/

[image loading]

User was warned for this post
Time is precious. Waste it wisely.
Hanh
Profile Joined June 2016
146 Posts
January 25 2017 02:18 GMT
#16578
Yeah, it's amazing that someone can take something that was available for years and present it as new.
Deleted User 101379
Profile Blog Joined August 2010
4849 Posts
January 25 2017 11:45 GMT
#16579
On January 25 2017 11:18 Hanh wrote:
Yeah, it's amazing that someone can take something that was available for years and present it as new.


The whole programming sector ist moving in circles. Every few years a "new thing" appears, gets replaced by something better which gets replaced by something more advanced which then gets replaced by another "new Thing" - which is pretty much the same thing everything started with, just with a fancier name.

Programmers are experts in reinventing wheels and calling them "best new things that change everything".
Manit0u
Profile Blog Joined August 2004
Poland17429 Posts
January 25 2017 12:47 GMT
#16580
How can people work with white background in their IDE is beyond me...
Time is precious. Waste it wisely.
Prev 1 827 828 829 830 831 1032 Next
Please log in or register to reply.
Live Events Refresh
OSC
11:30
Mid Season Playoffs
Krystianer vs PercivalLIVE!
WardiTV1063
TKL 199
Liquipedia
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
TKL 199
SteadfastSC 109
Rex 91
StarCraft: Brood War
Calm 3367
Bisu 2918
Rain 2430
Hyuk 1473
Horang2 984
Flash 514
Soma 498
Stork 393
Rush 303
Soulkey 121
[ Show more ]
Backho 114
Barracks 58
sas.Sziky 46
hero 38
Aegong 27
zelot 22
sSak 21
Terrorterran 20
Rock 19
Killer 16
Dota 2
Gorgc3152
qojqva2018
Dendi1105
BananaSlamJamma123
XcaliburYe100
Other Games
hiko638
Sick526
DeMusliM442
Hui .346
Fuzer 199
Mew2King94
QueenE50
Organizations
StarCraft: Brood War
Kim Chul Min (afreeca) 9
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 16 non-featured ]
StarCraft 2
• poizon28 22
• intothetv
• AfreecaTV YouTube
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• HerbMon 10
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Dota 2
• C_a_k_e 3021
• WagamamaTV453
League of Legends
• Nemesis4037
• TFBlade977
Upcoming Events
Tenacious Turtle Tussle
7h 31m
The PondCast
18h 31m
RSL Revival
18h 31m
Solar vs Zoun
MaxPax vs Bunny
Kung Fu Cup
20h 31m
WardiTV Korean Royale
20h 31m
PiGosaur Monday
1d 9h
RSL Revival
1d 18h
Classic vs Creator
Cure vs TriGGeR
Kung Fu Cup
1d 20h
CranKy Ducklings
2 days
RSL Revival
2 days
herO vs Gerald
ByuN vs SHIN
[ Show More ]
Kung Fu Cup
2 days
IPSL
3 days
ZZZero vs rasowy
Napoleon vs KameZerg
BSL 21
3 days
Tarson vs Julia
Doodle vs OldBoy
eOnzErG vs WolFix
StRyKeR vs Aeternum
Sparkling Tuna Cup
3 days
RSL Revival
3 days
Reynor vs sOs
Maru vs Ryung
Kung Fu Cup
3 days
WardiTV Korean Royale
3 days
BSL 21
4 days
JDConan vs Semih
Dragon vs Dienmax
Tech vs NewOcean
TerrOr vs Artosis
IPSL
4 days
Dewalt vs WolFix
eOnzErG vs Bonyth
Wardi Open
4 days
Monday Night Weeklies
5 days
WardiTV Korean Royale
5 days
The PondCast
6 days
Liquipedia Results

Completed

Proleague 2025-11-07
Stellar Fest: Constellation Cup
Eternal Conflict S1

Ongoing

C-Race Season 1
IPSL Winter 2025-26
KCM Race Survival 2025 Season 4
SOOP Univ League 2025
YSL S2
BSL Season 21
BLAST Rivals Fall 2025
IEM Chengdu 2025
PGL Masters Bucharest 2025
Thunderpick World Champ.
CS Asia Championships 2025
ESL Pro League S22
StarSeries Fall 2025
FISSURE Playground #2
BLAST Open Fall 2025
BLAST Open Fall Qual

Upcoming

SLON Tour Season 2
BSL 21 Non-Korean Championship
Acropolis #4
IPSL Spring 2026
HSC XXVIII
RSL Offline Finals
WardiTV 2025
RSL Revival: Season 3
META Madness #9
BLAST Bounty Winter 2026
BLAST Bounty Winter 2026: Closed Qualifier
eXTREMESLAND 2025
ESL Impact League Season 8
SL Budapest Major 2025
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 © 2025 TLnet. All Rights Reserved.