Click here to Skip to main content
15,892,797 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: Someone help me choose which to learn first, can't and lost Pin
KBZX50009-Jul-18 0:03
KBZX50009-Jul-18 0:03 
GeneralRe: Someone help me choose which to learn first, can't and lost Pin
Joe Woodbury9-Jul-18 6:06
professionalJoe Woodbury9-Jul-18 6:06 
GeneralRe: Someone help me choose which to learn first, can't and lost Pin
KBZX50009-Jul-18 23:43
KBZX50009-Jul-18 23:43 
GeneralRe: Someone help me choose which to learn first, can't and lost Pin
kordaff9-Jul-18 7:45
professionalkordaff9-Jul-18 7:45 
GeneralRe: Someone help me choose which to learn first, can't and lost Pin
KBZX500010-Jul-18 0:02
KBZX500010-Jul-18 0:02 
GeneralRe: Someone help me choose which to learn first, can't and lost Pin
kalberts9-Jul-18 0:30
kalberts9-Jul-18 0:30 
GeneralRe: Someone help me choose which to learn first, can't and lost Pin
Joe Woodbury9-Jul-18 6:00
professionalJoe Woodbury9-Jul-18 6:00 
GeneralRe: Someone help me choose which to learn first, can't and lost Pin
kalberts9-Jul-18 12:26
kalberts9-Jul-18 12:26 
I meet a lot of newly educated C++ "experts" in my work. Most of them know very little about "HOW the code does what it does". They have no idea how a compiler operates, how optimization is done, how a stack is managed. They know about high level language constructs, not of the generated code. Unrolling the stack on an exception? No clue! Interrupt handler operation? No clue. OS service activation methods, with the necessary raising of privilege level etc? No clue. How OO is implemented - the class object, multiple inheritance, virtual methods, ...? No clue. They (think that they) know how it works at the object level, not at the code level. How is memory allocated for a dozen of threads in the same address space? How does the system clean up allocated resources when a thread, or a process terminates? (You do not free() the thread stack, or file control blocks, or I/O buffers!)

I learned OO concepts by studying how the C++ compiler produced K&R C source code that could be compiled on any machine. Noone does that today. C and C++ programmers alike: Tthe know more of how the job market works than how a computer works at the instruction set / register / interrupt / MMS level. Or at the system level. I commented to one of the youngsters that the elevator in our office building doesn't run a propoer elevator algorithm; it may turn even if there are other users at higher/lower levels. Elevator algorithm - huh? Once I referred to excption propagation through the dynamic or static link - they had never heard about 'static link'- this was in a discussion of abandoned languages that do have a static link; that was completely new to them. And so on. Beliving that youngsters know memory management because you stress to them what comes up (of malloc) must come down (to free) doesn't teach them how memory is managed.

They know of constructors and destructors, but not of the code behind those. And seriously: Programmers haven't had to understand compiler code generation and hardware addressing modes for a generation. Why should the average student have to know about buddy allocation an firstfit/bestfit and memory compaction, more than of different instruction set addressing methods?

Students are relieved of understanding jump instructions by high level 'for' and 'while' loops and switch statements. There is no real reason why they should spend much more attention to memory management (until they become far more advanced). The only 'excuse' is that when programming in C++, you certainly should know it! In languages with automatic memory management, it isn't an issue at all, at least not until you become quite advanced. For a beginner, it is inessential.

Fifteen years ago I gave up my confidence in assembler code for fine tuning, as I gradually accepted that all modern compilers know far more smart tricks than I do. Five years ago, I spent some time in learning how dotNet memory management works, and again and again I said to myself: Gee, I'd never have thought of that. And dotNet manages it at a binary byte level - if I were to do it 'by hand', I'd have to use a load of explicit type casts, not generating much machine code (casting doesn't) but certainly a lot of source code. And the best I could do was to detect if a program made a memory allocation mistake, and report it - I couldn't handle it.

So I realized: Just like machine code addressing modes is the responsibility of the compiler, memory management is the responsibility of the runtime system. It can handle it far better than I can, and I am a seasoned programmer.
GeneralRe: Someone help me choose which to learn first, can't and lost Pin
Joe Woodbury9-Jul-18 13:12
professionalJoe Woodbury9-Jul-18 13:12 
AnswerRe: Someone help me choose which to learn first, can't and lost Pin
David Crow8-Jul-18 16:08
David Crow8-Jul-18 16:08 
AnswerRe: Someone help me choose which to learn first, can't and lost Pin
jsc428-Jul-18 21:39
professionaljsc428-Jul-18 21:39 
AnswerRe: Someone help me choose which to learn first, can't and lost Pin
Kirill Illenseer8-Jul-18 22:56
Kirill Illenseer8-Jul-18 22:56 
GeneralRe: Someone help me choose which to learn first, can't and lost Pin
kalberts9-Jul-18 1:27
kalberts9-Jul-18 1:27 
AnswerRe: Someone help me choose which to learn first, can't and lost Pin
KBZX50008-Jul-18 23:51
KBZX50008-Jul-18 23:51 
GeneralRe: Someone help me choose which to learn first, can't and lost Pin
Joe Woodbury9-Jul-18 6:13
professionalJoe Woodbury9-Jul-18 6:13 
GeneralRe: Someone help me choose which to learn first, can't and lost Pin
KBZX500010-Jul-18 0:04
KBZX500010-Jul-18 0:04 
AnswerRe: Someone help me choose which to learn first, can't and lost Pin
maze38-Jul-18 23:49
professionalmaze38-Jul-18 23:49 
AnswerRe: Someone help me choose which to learn first, can't and lost Pin
James Curran9-Jul-18 1:37
James Curran9-Jul-18 1:37 
AnswerRe: Someone help me choose which to learn first, can't and lost Pin
David Carta9-Jul-18 3:45
professionalDavid Carta9-Jul-18 3:45 
GeneralRe: Someone help me choose which to learn first, can't and lost Pin
kmoorevs9-Jul-18 6:44
kmoorevs9-Jul-18 6:44 
AnswerRe: Someone help me choose which to learn first, can't and lost Pin
Joe Woodbury9-Jul-18 6:17
professionalJoe Woodbury9-Jul-18 6:17 
AnswerRe: Someone help me choose which to learn first, can't and lost Pin
jamesvtoomey9-Jul-18 7:32
jamesvtoomey9-Jul-18 7:32 
AnswerRe: Someone help me choose which to learn first, can't and lost Pin
patbob9-Jul-18 6:41
patbob9-Jul-18 6:41 
AnswerRe: Someone help me choose which to learn first, can't and lost Pin
Gerry Schmitz9-Jul-18 7:15
mveGerry Schmitz9-Jul-18 7:15 
AnswerRe: Someone help me choose which to learn first, can't and lost Pin
Joe Woodbury9-Jul-18 13:42
professionalJoe Woodbury9-Jul-18 13:42 

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.