• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EST 22:36
CET 04:36
KST 12:36
  • 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
Behind the Blue - Team Liquid History Book15Clem wins HomeStory Cup 289HomeStory Cup 28 - Info & Preview13Rongyi Cup S3 - Preview & Info8herO wins SC2 All-Star Invitational14
Community News
ACS replaced by "ASL Season Open" - Starts 21/0220LiuLi Cup: 2025 Grand Finals (Feb 10-16)26Weekly Cups (Feb 2-8): Classic, Solar, MaxPax win2Nexon's StarCraft game could be FPS, led by UMS maker10PIG STY FESTIVAL 7.0! (19 Feb - 1 Mar)14
StarCraft 2
General
How do you think the 5.0.15 balance patch (Oct 2025) for StarCraft II has affected the game? Nexon's StarCraft game could be FPS, led by UMS maker Terran Scanner Sweep Behind the Blue - Team Liquid History Book Weekly Cups (Jan 12-18): herO, MaxPax, Solar win
Tourneys
PIG STY FESTIVAL 7.0! (19 Feb - 1 Mar) LiuLi Cup: 2025 Grand Finals (Feb 10-16) RSL Season 4 announced for March-April RSL Revival: Season 4 Korea Qualifier (Feb 14) Sparkling Tuna Cup - Weekly Open Tournament
Strategy
Custom Maps
Map Editor closed ? [A] Starcraft Sound Mod
External Content
The PondCast: SC2 News & Results Mutation # 512 Overclocked Mutation # 511 Temple of Rebirth Mutation # 510 Safety Violation
Brood War
General
Which units you wish saw more use in the game? ACS replaced by "ASL Season Open" - Starts 21/02 StarCraft player reflex TE scores [ASL21] Potential Map Candidates Gypsy to Korea
Tourneys
[Megathread] Daily Proleagues Escore Tournament StarCraft Season 1 Small VOD Thread 2.0 KCM Race Survival 2026 Season 1
Strategy
Fighting Spirit mining rates Zealot bombing is no longer popular? Simple Questions, Simple Answers Current Meta
Other Games
General Games
Path of Exile Nintendo Switch Thread Diablo 2 thread Battle Aces/David Kim RTS Megathread ZeroSpace Megathread
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 Mafia Game Mode Feedback/Ideas Vanilla Mini Mafia
Community
General
US Politics Mega-thread Ask and answer stupid questions here! European Politico-economics QA Mega-thread The Games Industry And ATVI Russo-Ukrainian War Thread
Fan Clubs
The IdrA Fan Club The herO Fan Club!
Media & Entertainment
[Req][Books] Good Fantasy/SciFi books [Manga] One Piece Anime Discussion Thread
Sports
2024 - 2026 Football Thread
World Cup 2022
Tech Support
TL Community
The Automated Ban List
Blogs
ADHD And Gaming Addiction…
TrAiDoS
My 2025 Magic: The Gathering…
DARKING
Life Update and thoughts.
FuDDx
How do archons sleep?
8882
StarCraft improvement
iopq
Customize Sidebar...

Website Feedback

Closed Threads



Active: 2184 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
Spain18215 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
Poland17661 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
Poland17661 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
Poland17661 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
Replay Cast
00:00
HomeStory Cup 28 - Group C
LiquipediaDiscussion
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
RuFF_SC2 241
NeuroSwarm 202
StarCraft: Brood War
JulyZerg 45
910 37
Icarus 3
Dota 2
monkeys_forever589
LuMiX2
League of Legends
JimRising 800
Super Smash Bros
C9.Mang01263
Mew2King65
Other Games
summit1g15387
tarik_tv5678
ToD115
Moletrap11
Organizations
Other Games
gamesdonequick1227
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 12 non-featured ]
StarCraft 2
• davetesta55
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
League of Legends
• Stunt357
Upcoming Events
Sparkling Tuna Cup
6h 24m
LiuLi Cup
7h 24m
Maru vs Reynor
Serral vs Rogue
Ladder Legends
14h 24m
Replay Cast
20h 24m
Replay Cast
1d 5h
Wardi Open
1d 8h
Monday Night Weeklies
1d 13h
OSC
1d 20h
WardiTV Winter Champion…
2 days
Replay Cast
3 days
[ Show More ]
WardiTV Winter Champion…
3 days
Replay Cast
3 days
PiG Sty Festival
4 days
The PondCast
4 days
KCM Race Survival
4 days
WardiTV Winter Champion…
4 days
Replay Cast
4 days
PiG Sty Festival
5 days
Epic.LAN
5 days
Replay Cast
5 days
PiG Sty Festival
6 days
CranKy Ducklings
6 days
Epic.LAN
6 days
Replay Cast
6 days
Liquipedia Results

Completed

Proleague 2026-02-14
Rongyi Cup S3
Underdog Cup #3

Ongoing

KCM Race Survival 2026 Season 1
LiuLi Cup: 2025 Grand Finals
Nations Cup 2026
PGL Cluj-Napoca 2026
IEM Kraków 2026
BLAST Bounty Winter 2026
BLAST Bounty Winter Qual
eXTREMESLAND 2025
SL Budapest Major 2025

Upcoming

Escore Tournament S1: King of Kings
[S:21] ASL SEASON OPEN 1st Round
[S:21] ASL SEASON OPEN 1st Round Qualifier
[S:21] ASL SEASON OPEN 2nd Round
[S:21] ASL SEASON OPEN 2nd Round Qualifier
Acropolis #4
IPSL Spring 2026
HSC XXIX
uThermal 2v2 2026 Main Event
Bellum Gens Elite Stara Zagora 2026
RSL Revival: Season 4
WardiTV Winter 2026
BLAST Rivals Spring 2026
CCT Season 3 Global Finals
FISSURE Playground #3
IEM Rio 2026
PGL Bucharest 2026
Stake Ranked Episode 1
BLAST Open Spring 2026
ESL Pro League Season 23
ESL Pro League Season 23
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.