Click here to Skip to main content
15,904,653 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: Why I'm Against Higher Resolution TV Pin
dandy7219-Feb-20 6:09
dandy7219-Feb-20 6:09 
General2 Dim arrays in Java Pin
Nand3218-Feb-20 3:41
Nand3218-Feb-20 3:41 
GeneralRe: 2 Dim arrays in Java Pin
User 1106097918-Feb-20 3:58
User 1106097918-Feb-20 3:58 
GeneralRe: 2 Dim arrays in Java Pin
OriginalGriff18-Feb-20 4:12
mveOriginalGriff18-Feb-20 4:12 
GeneralRe: 2 Dim arrays in Java Pin
User 1106097918-Feb-20 8:16
User 1106097918-Feb-20 8:16 
GeneralRe: 2 Dim arrays in Java Pin
kalberts18-Feb-20 10:50
kalberts18-Feb-20 10:50 
GeneralRe: 2 Dim arrays in Java Pin
OriginalGriff18-Feb-20 11:34
mveOriginalGriff18-Feb-20 11:34 
GeneralRe: 2 Dim arrays in Java Pin
kalberts18-Feb-20 22:55
kalberts18-Feb-20 22:55 
In C/C++, you cannnot do much decent programming if you are not aware of the array name as a pointer.

E.g. in Pascal, if you declare an array summerMonths: array[may..agust] of travelPlans; then you wouldn't care if 'summerMonths' is the address of element 'may' and actual indexes reduced by four before multiplied by the element size to get the element offset, or 'summerMonths' is the element of the (non-existing) 'january' element so that actual indexes may be directly multiplied by the element size to get the element offset. I believe that the Pascal standard says nothing about the implementation, and the compiler could do it either way. At least in the "original" Pascal that wasn't made for linking with modules in other languages. Maybe some external interface specification defines which address (of a non-existing elment 0 or of the first existing element) is transferred, to make the C programmers comfortable Smile | :)

None of that affects the Pascal code, though. You address summerMonth[july] as one of four travelPlans objects, without knowing what its address is and how it was calculated. Why would you care? In C/C++ you more or less have to care.

When using C for writing machine code, e.g bottom layer drivers, where the task by definition relates to physical addresses, controlling the exact binary code emitted by the compiler, you of course have to know. Pascal wasn't meant for those kind of tasks. My guess is that well above 99% of all C/C++ code written is not at that low level either, and actual physical addresses are not relevant. Yet, because of that fraction of a percent, all C/C++ programmers must be aware of the array as a pointer, indexing as a kind of pointer arithmetic etc.

If I work at that bottom level, interfacing directly to harware, I appreciate C. For higher levels, user applications in particular, I prefer languages that does not give me the freedom of C, and that relieves me from knowing which addresses are generated by the compiler.
GeneralRe: 2 Dim arrays in Java Pin
dandy7218-Feb-20 5:50
dandy7218-Feb-20 5:50 
GeneralRe: 2 Dim arrays in Java Pin
harold aptroot18-Feb-20 4:03
harold aptroot18-Feb-20 4:03 
GeneralRe: 2 Dim arrays in Java Pin
PIEBALDconsult18-Feb-20 8:37
mvePIEBALDconsult18-Feb-20 8:37 
GeneralRe: 2 Dim arrays in Java Pin
Mark_Wallace18-Feb-20 9:26
Mark_Wallace18-Feb-20 9:26 
GeneralRe: 2 Dim arrays in Java Pin
Nand3218-Feb-20 18:27
Nand3218-Feb-20 18:27 
GeneralRe: 2 Dim arrays in Java Pin
kalberts19-Feb-20 0:58
kalberts19-Feb-20 0:58 
GeneralRe: 2 Dim arrays in Java Pin
Nand3219-Feb-20 3:45
Nand3219-Feb-20 3:45 
GeneralRe: 2 Dim arrays in Java Pin
kalberts19-Feb-20 4:43
kalberts19-Feb-20 4:43 
GeneralRe: 2 Dim arrays in Java Pin
PIEBALDconsult20-Feb-20 8:47
mvePIEBALDconsult20-Feb-20 8:47 
GeneralRe: 2 Dim arrays in Java Pin
Nand3221-Feb-20 19:07
Nand3221-Feb-20 19:07 
QuestionLeaving work at the doorstep... Pin
Marc Clifton18-Feb-20 3:08
mvaMarc Clifton18-Feb-20 3:08 
AnswerRe: Leaving work at the doorstep... Pin
Dan Neely18-Feb-20 3:14
Dan Neely18-Feb-20 3:14 
AnswerRe: Leaving work at the doorstep... Pin
MarkTJohnson18-Feb-20 3:24
professionalMarkTJohnson18-Feb-20 3:24 
AnswerRe: Leaving work at the doorstep... Pin
Kornfeld Eliyahu Peter18-Feb-20 3:54
professionalKornfeld Eliyahu Peter18-Feb-20 3:54 
AnswerRe: Leaving work at the doorstep... Pin
Mike Hankey18-Feb-20 4:06
mveMike Hankey18-Feb-20 4:06 
GeneralRe: Leaving work at the doorstep... Pin
Nelek18-Feb-20 4:09
protectorNelek18-Feb-20 4:09 
GeneralRe: Leaving work at the doorstep... Pin
Marc Clifton18-Feb-20 4:21
mvaMarc Clifton18-Feb-20 4:21 

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.