• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 08:59
CEST 14:59
KST 21:59
  • 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
[ASL22] Ro16 Preview: Rough Waters9[ASL22] Ro24 Preview: Siren's Call8[ASL22] Ro24 Preview: Summer's End9Serral wins HomeStory Cup 2915Serral wins Maestros of the Game 244
Community News
Weekly Cups (Aug 30-Sep 7): herO thrives amid growing schism5Official StarCraft website teases new content ahead of BlizzCon?118Stellar Fest TWO the Moon (Dec 16-20)9Weekly Cups (August 24-30): Patches' balance mod takes over3New 3v3 BGH Ladder (and more) on ShieldBattery!46
StarCraft 2
General
Weekly Cups (Aug 30-Sep 7): herO thrives amid growing schism Nexon wins bid to develop StarCraft IP content, distribute Overwatch mobile game Balance hotfix patch 5.0.16b (July 16) SC4ALL: II Winner Will Earn a Spot at HSC 30! Weekly Cups (August 24-30): Patches' balance mod takes over
Tourneys
Sea Duckling Open (Global, Bronze-Diamond) 2026 GSTL Announcement Sparkling Tuna Cup - Weekly Open Tournament Stellar Fest TWO the Moon (Dec 16-20) IntoTheTV X SOOP SC2 League : Weekly & Monthly
Strategy
[G] Having the right mentality to improve
Custom Maps
Nexus Wars 2021 GUIDE [M] (2) Industrial Park
External Content
Mutation # 542 The Ascended Mutation # 541 Binary Choice The PondCast: SC2 News & Results Mutation # 540 Dodge This
Brood War
General
Official StarCraft website teases new content ahead of BlizzCon? [ASL22] Ro16 Preview: Rough Waters ASL22 General Discussion Pros React To: Calm's Big Brain Play Vs Mini New 3v3 BGH Ladder (and more) on ShieldBattery!
Tourneys
[ASL22] Ro16 Group B [Megathread] Daily Proleagues 2v2v2v2 Tournament [ASL22] Ro16 Group A
Strategy
Replay Review Process - What do you do? Simple Questions, Simple Answers Odyssey Mineral Stack Saturation Game Theory for Starcraft
Other Games
General Games
Nintendo Switch Thread EVE Corporation Diablo IV [Maplestory Hardcore] Let's Play~!! General RTS Discussion Thread
Dota 2
Official 'what is Dota anymore' discussion
League of Legends
[TL LoL EUW IHs] Teemo shall perish TSM pausing esports and CLG Dead
Heroes of the Storm
Heroes of the Storm 2.0
Hearthstone
Deck construction bug
TL Mafia
TL Mafia Power Rank TL Mafia Community Thread NeO.D_StephenKing vs This Guy From 1 Million Dance
Community
General
US Politics Mega-thread Russo-Ukrainian War Thread European Politico-economics QA Mega-thread Trading/Investing Thread Things Aren’t Peaceful in Palestine
Fan Clubs
MarineLorD Fan Club The Creator Fan Club The ShoWTimE Fan Club
Media & Entertainment
Movie Discussion! Anime Discussion Thread
Sports
Football (Soccer) Thread TeamLiquid Health and Fitness Initiative For 2023 MLB/Baseball 2023
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread
TL Community
The Automated Ban List Northern Ireland Global Starcraft
Blogs
F* the Children and Get Off …
TrAiDoS
Dreaming of BW patches (mod…
c3rberUs
Regacy Esports: The Bh…
regacyesports
LOCKPICKING NOOB
LUCKY_NOOB
Customize Sidebar...

Website Feedback

Closed Threads



Active: 6136 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
Spain18433 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
Poland17842 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
Poland17842 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
Poland17842 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
Kung Fu Cup
11:00
2026 Week 22
IntoTheiNu 1496
WardiTV596
RotterdaM439
IndyStarCraft 179
TKL 179
Rex132
SteadfastSC109
LiquipediaDiscussion
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
RotterdaM 432
TKL 185
IndyStarCraft 179
ProTech135
Rex 125
SteadfastSC 98
StarCraft: Brood War
Bisu 6082
Jaedong 3528
Soulkey 2814
Horang2 1038
Mini 859
Hyuk 552
Light 463
Snow 377
BeSt 360
EffOrt 228
[ Show more ]
Stork 183
firebathero 181
Barracks 177
Last 152
Pusan 83
hero 52
soO 51
JYJ 47
Sharp 41
PianO 41
Hm[arnc] 40
Mind 40
sSak 34
ToSsGirL 32
Terrorterran 22
910 22
Bale 22
Sacsri 14
SilentControl 13
scan(afreeca) 9
ajuk12(nOOB) 9
Icarus 9
Dota 2
Dendi1816
qojqva1363
syndereN540
LuMiX0
Counter-Strike
olofmeister1497
Super Smash Bros
hungrybox680
Other Games
singsing2110
B2W.Neo422
Lowko391
crisheroes316
DeMusliM270
XaKoH 184
Sick129
ArmadaUGS53
QueenE20
[ Show 12 non-featured ]
StarCraft 2
• StrangeGG 63
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• Migwel
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Dota 2
• WagamamaTV700
League of Legends
• Jankos2605
• TFBlade516
Upcoming Events
Replay Cast
11h 1m
The PondCast
21h 1m
KCM Race Survival
21h 1m
OSC
1d 9h
Escore
1d 21h
IntoTheTV X SOOP
1d 22h
CranKy Ducklings
2 days
Sparkling Tuna Cup
3 days
Shopify Rebellion Sundays
4 days
Spirit vs Mixu
Clem vs TBD
RSL Revival
4 days
Serral vs Rogue
[ Show More ]
BlizzCon
4 days
Replay Cast
4 days
Afreeca Starleague
4 days
WardiTV Weekly
4 days
Afreeca Starleague
5 days
GSL
5 days
PiGosaur Cup
6 days
The PondCast
6 days
Kung Fu Cup
6 days
Liquipedia Results

Completed

Proleague 2026-09-08
PiG Sty Festival 8.0
Big Dog Cup 2026 Div 1

Ongoing

KCM Race Survival 2026 Season 3
K-JUNGMAN
ASL Season 22
Super Anchor Qualifying S3
CSL 2026 AUTUMN (S22)
Acropolis #5
Acropolis #5 - TRS
RSL Revival: Season 6
Calamity Invitational
FISSURE Playground #3
BLAST Open Fall 2026
Esports World Cup 2026
BLAST Bounty Summer 2026
BLAST Bounty Summer Qual
Stake Ranked Episode 3
XSE Pro League 2026

Upcoming

Escore Tournament S3: King of Kings
Acropolis #5 - GSA
Blizzard Classic Cup 2026
Acropolis #5 - GSB
Acropolis #5 - GSC
SC4ALL II: Brood War
HSC XXX
Stellar Fest 2: Lunar Cup
SC4ALL II: StarCraft II
Kung Fu Cup 2026 Grand Finals
RSL Offline Finals
Blizzard Classic Cup 2026
Stake Ranked Episode 6
BLAST Rivals Fall 2026
IEM Beijing 2026
Stake Ranked Episode 5
PGL Masters Bucharest 2026
1win Private Club #2
Thunderpick World Champ. '26
ESL Pro League Season 24
Stake Ranked Episode 4
1win Private Club #1
Logitech G Play Connect 2026
SL StarSeries Fall 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.