Click here to Skip to main content
15,895,794 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: What I want..... Pin
Slacker00727-Mar-19 9:35
professionalSlacker00727-Mar-19 9:35 
GeneralRe: What I want..... Pin
MarkTJohnson27-Mar-19 9:47
professionalMarkTJohnson27-Mar-19 9:47 
GeneralRe: What I want..... Pin
Dean Roddey27-Mar-19 14:40
Dean Roddey27-Mar-19 14:40 
GeneralRe: What I want..... Pin
Marc Clifton27-Mar-19 14:44
mvaMarc Clifton27-Mar-19 14:44 
GeneralRe: What I want..... Pin
englebart28-Mar-19 1:55
professionalenglebart28-Mar-19 1:55 
GeneralRe: What I want..... Pin
Member 916705728-Mar-19 2:05
Member 916705728-Mar-19 2:05 
GeneralRe: What I want..... Pin
rjmoses28-Mar-19 2:53
professionalrjmoses28-Mar-19 2:53 
GeneralRe: What I want..... Pin
Member 916705728-Mar-19 3:05
Member 916705728-Mar-19 3:05 
But we already have that! Let's forget the 3-byte-integer for a moment, that's rather specific to that protocol and usually not needed. When I work with a int32_t (a rather common type), I don't have to care which endianness the underlying system uses. The compiler takes care of everything! Same goes for, let's say, uintptr_t. I don't have to care about endianness, bitness, none of that. The compiler does it for me. Well, I of course have to work with the compiler, but your world, the one where the programmer doesn't have to care, is already there.

The other topic here is that people will always find a way to circumvent the compiler and shoot themselves in the foot.

There's languages that make that easier or harder, C is the worst offender I've ever met (save for assembly, but that's in a league of it's own). C doesn't even have a byte type! A char is a byte in C, you can't blame the programmer (except for possibly poor choice of C as a tool). Switch the language. C# or Delphi on the other hand, those compilers yell at you when you're doing questionable things. And if that thing in question may work just fine while still remaining questinable, you'll at least get a warning.

Feel free to yell BULL, by the way. I've never done such a thing because the question is not whether it'll blow up in my face but a mere when. It will blow up sooner or later.

Fun fact: I've now spent about two weeks fixing a binary communication layer. Some predecessor of mine thought that using strings, data structures designed for text, where binary information is processed, would be a splendid idea. And then came Unicode. Trying to convert 99h to a Unicode string member yields 3Fh and some other byte I've forgotten. I bet it was a C programmer who grew up in the 60s riding the "Learned it once, never relearn"-mentality. Converted all of this nonsense to TArray<Byte> (Delphi nomenclature) and stuff works now.

I still wonder whether your topic is about programming in general C in particular as you seem insistent on issues that are long solved by several programming languages (granted, both Delphi and C# still allow you to shoot yourself in the foot, but you gotta fight hard against the compiler to do that).
GeneralRe: What I want..... Pin
Slow Eddie28-Mar-19 3:07
professionalSlow Eddie28-Mar-19 3:07 
GeneralRe: What I want..... Pin
Steve Naidamast28-Mar-19 5:10
professionalSteve Naidamast28-Mar-19 5:10 
GeneralRe: What I want..... Pin
rjmoses28-Mar-19 23:05
professionalrjmoses28-Mar-19 23:05 
GeneralRe: What I want..... Pin
Kirk 1038982128-Mar-19 8:29
Kirk 1038982128-Mar-19 8:29 
GeneralRe: What I want..... Pin
rjmoses29-Mar-19 4:35
professionalrjmoses29-Mar-19 4:35 
GeneralRe: What I want..... Pin
Kirk 1038982129-Mar-19 6:44
Kirk 1038982129-Mar-19 6:44 
QuestionYou've got to get out more... Pin
  Forogar  27-Mar-19 3:02
professional  Forogar  27-Mar-19 3:02 
AnswerRe: You've got to get out more... Pin
F-ES Sitecore27-Mar-19 3:10
professionalF-ES Sitecore27-Mar-19 3:10 
GeneralRe: You've got to get out more... Pin
dan!sh 27-Mar-19 3:34
professional dan!sh 27-Mar-19 3:34 
AnswerRe: You've got to get out more... Pin
dan!sh 27-Mar-19 3:34
professional dan!sh 27-Mar-19 3:34 
AnswerRe: You've got to get out more... Pin
User 483504727-Mar-19 3:40
User 483504727-Mar-19 3:40 
AnswerRe: You've got to get out more... Pin
Sander Rossel27-Mar-19 3:41
professionalSander Rossel27-Mar-19 3:41 
GeneralRe: You've got to get out more... Pin
  Forogar  27-Mar-19 4:06
professional  Forogar  27-Mar-19 4:06 
AnswerRe: You've got to get out more... Pin
Ron Anders27-Mar-19 3:49
Ron Anders27-Mar-19 3:49 
AnswerRe: You've got to get out more... Pin
Kornfeld Eliyahu Peter27-Mar-19 4:55
professionalKornfeld Eliyahu Peter27-Mar-19 4:55 
PraiseRe: You've got to get out more... Pin
RickZeeland27-Mar-19 10:19
mveRickZeeland27-Mar-19 10:19 
AnswerRe: You've got to get out more... Pin
Simon_Whale27-Mar-19 4:57
Simon_Whale27-Mar-19 4:57 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.