Date: 19/05/2013 18:38:04
From: Skunkworks
ID: 313493
Subject: Lines of Code

What does that mean? I have read that modern luxury cars now have half a million lines of code. I have read code here that seemingly goes on forever.

Is half a million lines of code a telephone book of info?

Seems a lot but I guess they are not employing folk to waste time it must all have a reason. I guess it is all to do with talking between the various systems?

Reply Quote

Date: 19/05/2013 18:45:09
From: Skunkworks
ID: 313496
Subject: re: Lines of Code

Skunkworks said:

Is half a million lines of code a telephone book of info?

Badly worded, if half a million lines was converted to the big city yellow telephone books how many would it fill?

Reply Quote

Date: 19/05/2013 18:53:27
From: Geoff D
ID: 313503
Subject: re: Lines of Code

Think we might need to wait until Droopybear drops by for an answer to this one.

Reply Quote

Date: 19/05/2013 18:58:05
From: KJW
ID: 313509
Subject: re: Lines of Code

Skunkworks said:


Skunkworks said:
Is half a million lines of code a telephone book of info?

Badly worded, if half a million lines was converted to the big city yellow telephone books how many would it fill?

Probably best to consider the White Pages. But why don’t you count the number of entries on a single page. However, I think a line of code would typically be longer than an entry in the phone book (or at least that’s the way it seems with VBA code that I write). On the other hand, if the code is Assembly Language (not unreasonable for a dedicated-purpose computer), then each line would be shorter than an entry in the phone book.

Reply Quote

Date: 19/05/2013 18:59:59
From: Boris
ID: 313511
Subject: re: Lines of Code

http://en.wikipedia.org/wiki/Source_lines_of_code

you may need someone to translate this page.

Reply Quote

Date: 19/05/2013 19:00:25
From: sibeen
ID: 313512
Subject: re: Lines of Code

I doubt even the world’s most extreme masochist would use Assembly Language to write half a million lines of code.

Reply Quote

Date: 19/05/2013 19:02:14
From: Peak Warming Man
ID: 313515
Subject: re: Lines of Code

The number of lines of code is dependant on how it is formatted and how it is formatted depends on how readable you want it to be.

Reply Quote

Date: 19/05/2013 19:02:22
From: KJW
ID: 313516
Subject: re: Lines of Code

sibeen said:


I doubt even the world’s most extreme masochist would use Assembly Language to write half a million lines of code.

Half a million lines of code is half a million lines of code regardless of the language.

Reply Quote

Date: 19/05/2013 19:05:51
From: Carmen_Sandiego
ID: 313519
Subject: re: Lines of Code

KJW said:


sibeen said:

I doubt even the world’s most extreme masochist would use Assembly Language to write half a million lines of code.

Half a million lines of code is half a million lines of code regardless of the language.

But still, a line of assembly code is a half dozen characters. C or scripting languages can be dozens. And they don’t say if it is the source, or the compiled code.

Reply Quote

Date: 19/05/2013 19:07:58
From: Skunkworks
ID: 313521
Subject: re: Lines of Code

KJW said:


sibeen said:

I doubt even the world’s most extreme masochist would use Assembly Language to write half a million lines of code.

Half a million lines of code is half a million lines of code regardless of the language.

I just wouldn’t mind getting a handle on it cos it is used more and more in news these days and it means nothing to me as a measure.

F-35 problems in brazzilion lines of code, Myki, despite shedloads of code, still problems.

But now I know (perhaps) a car can half a million lines, so I am trying to put that into perspective.

Reply Quote

Date: 19/05/2013 19:14:23
From: Skunkworks
ID: 313525
Subject: re: Lines of Code

Would it be fair to say that with programmers from all over the world working on the same code, copying and pasting from the day before, (simplicity, I am talking more about internal version control) when they find errors in their bit they make fixes which might affect other parts which is why these roll out problems?

Reply Quote

Date: 19/05/2013 19:18:00
From: Peak Warming Man
ID: 313527
Subject: re: Lines of Code

Skunkworks said:


Would it be fair to say that with programmers from all over the world working on the same code, copying and pasting from the day before, (simplicity, I am talking more about internal version control) when they find errors in their bit they make fixes which might affect other parts which is why these roll out problems?

Errors will more likely by philosophical rather than in the code, the code is debugged before being compiled.

Reply Quote

Date: 19/05/2013 19:19:55
From: KJW
ID: 313528
Subject: re: Lines of Code

Skunkworks said:


Would it be fair to say that with programmers from all over the world working on the same code, copying and pasting from the day before, (simplicity, I am talking more about internal version control) when they find errors in their bit they make fixes which might affect other parts which is why these roll out problems?

It is fair to assume (I don’t actually know) that the coding would be in the form of objects (classes) which are highly modular and therefore largely self-contained. Thus, each object (class) can be written and debugged independently of each other.

Reply Quote

Date: 19/05/2013 19:24:57
From: Skunkworks
ID: 313529
Subject: re: Lines of Code

KJW said:

It is fair to assume (I don’t actually know) that the coding would be in the form of objects (classes) which are highly modular and therefore largely self-contained. Thus, each object (class) can be written and debugged independently of each other.

Yep, makes sense. But them being self contained is not proof for integration, it just means you can go back to basics quickly.

Reply Quote

Date: 19/05/2013 19:25:25
From: Carmen_Sandiego
ID: 313530
Subject: re: Lines of Code

Skunkworks said:


Would it be fair to say that with programmers from all over the world working on the same code, copying and pasting from the day before, (simplicity, I am talking more about internal version control) when they find errors in their bit they make fixes which might affect other parts which is why these roll out problems?

Yes, very fair.

Reply Quote

Date: 19/05/2013 19:29:09
From: KJW
ID: 313531
Subject: re: Lines of Code

Skunkworks said:


KJW said:

It is fair to assume (I don’t actually know) that the coding would be in the form of objects (classes) which are highly modular and therefore largely self-contained. Thus, each object (class) can be written and debugged independently of each other.

Yep, makes sense. But them being self contained is not proof for integration, it just means you can go back to basics quickly.

With objects (classes), the programmer’s interface would also be standardised so that even the code that interacts with the (other) objects can be written and debugged without having the actual objects (classes) in place (by using dummy code).

Reply Quote

Date: 19/05/2013 19:30:46
From: Skunkworks
ID: 313532
Subject: re: Lines of Code

KJW said:

With objects (classes), the programmer’s interface would also be standardised so that even the code that interacts with the (other) objects can be written and debugged without having the actual objects (classes) in place (by using dummy code).

Ahhh, that explains more.

Reply Quote

Date: 19/05/2013 19:42:38
From: captain_spalding
ID: 313539
Subject: re: Lines of Code

sibeen said:


I doubt even the world’s most extreme masochist would use Assembly Language to write half a million lines of code.

Real programmers write in binary.

Reply Quote

Date: 19/05/2013 19:46:19
From: KJW
ID: 313541
Subject: re: Lines of Code

captain_spalding said:


Real programmers write in binary.

And what was working with ENIAC like? :-P

Reply Quote

Date: 19/05/2013 19:48:18
From: Boris
ID: 313543
Subject: re: Lines of Code

And what was working with ENIAC like?

it was da bombe.

ok so that was a different computer…

;-)

Reply Quote

Date: 19/05/2013 19:54:31
From: wookiemeister
ID: 313546
Subject: re: Lines of Code

my only experience with code is through the arduino microcontroller that uses a c type language

each line that you write is essentially using a language that we understand – it uses English and an esoteric understanding of what a word or letter might mean

void setup()

means define the stuff you’ll be using

such as variables
eg a=0; // this is ignored by the compiller the the forward slashes are for when you make comments

the semicolon tells the compiler that its the end of the statement

void loop()
means run the programme

what you tend to do when you are using C in this way is to write down on paper what you are trying to do

write up what kind of variables you might need to declare before running the programme for real

before you can send the programme to the arduino through the USB you need to “compile” it. what this do is turn it into machine code I think understood by the microcontroller. the compiler also looks for error and gives you a clue as to where you might have gone wrong by high lighting the offending line of code. you then go back and see what the conflict is, you might have left out a ; or not declared a variable

maybe as you’ve suggested the compiling turns the C language lines of code into more lines of code (?????)

normally what you might have is a computer calculating from data coming in from microcontrollers dedicated to run sensors, processing the data and then spitting out a result back to the microcontroller.

normally you don’t have the brain connected directly to actuators – you’ll have a separate brain and muscle box to take that data you’ve sent to it and do something with it.

I’ve only started looking at this compTIA course recently to try and learn more about computers and get some bit of paper to say I do

another thing you might have a look at is the raspberry pi minicomputer, I’ve ordered a book on it

what I’ve seen that looks cool is making a raspberry pi supercomputer

Reply Quote

Date: 19/05/2013 19:56:14
From: wookiemeister
ID: 313547
Subject: re: Lines of Code

Peak Warming Man said:


Skunkworks said:

Would it be fair to say that with programmers from all over the world working on the same code, copying and pasting from the day before, (simplicity, I am talking more about internal version control) when they find errors in their bit they make fixes which might affect other parts which is why these roll out problems?

Errors will more likely by philosophical rather than in the code, the code is debugged before being compiled.


the only stuff I’ve used relies on you debugging it to see why it doesn’t work, though to be fair it does give you a small clue as to why its not working. the compiling process is part of the debugging

Reply Quote

Date: 19/05/2013 20:00:06
From: wookiemeister
ID: 313550
Subject: re: Lines of Code

what I’ve done in the past is to copy and paste programmes I’ve written before that I know work and paste them into a new programme, this saves time and effort

the only proviso is that you have to understand how it will fit in

you can’t use the same variable in the rest of the programme

you’ve got something called global variables and local variables

if you set “a” as a global variable you put it in the code before the programme runs before void loop()

a local value might be a variable declared inside another bit of code within the running programme – after void loop

Reply Quote

Date: 19/05/2013 20:02:29
From: wookiemeister
ID: 313552
Subject: re: Lines of Code

captain_spalding said:


sibeen said:

I doubt even the world’s most extreme masochist would use Assembly Language to write half a million lines of code.

Real programmers write in binary.


there was a kid at my school who would write in binary on an “acorn” / BBC computer

Reply Quote

Date: 19/05/2013 20:02:31
From: wookiemeister
ID: 313553
Subject: re: Lines of Code

captain_spalding said:


sibeen said:

I doubt even the world’s most extreme masochist would use Assembly Language to write half a million lines of code.

Real programmers write in binary.


there was a kid at my school who would write in binary on an “acorn” / BBC computer

Reply Quote

Date: 19/05/2013 20:07:22
From: Carmen_Sandiego
ID: 313555
Subject: re: Lines of Code

The first PLC I installed was programmed in binary by toggle switches on the front of the unit.

I much prefer the modern units.

Reply Quote

Date: 19/05/2013 20:07:25
From: Peak Warming Man
ID: 313556
Subject: re: Lines of Code

>>there was a kid at my school who would write in binary on an “acorn” / BBC computer

Well Wookie you’ve taught me something tonight, I’d never heard of Acorn Computers so I looked it up.

Acorn Computers Ltd. was a British computer company established in Cambridge, England, in 1978. The company produced a number of computers which were especially popular in the UK. These included the Acorn Electron, the BBC Micro, and the Acorn Archimedes. Acorn’s BBC Micro computer dominated the UK educational computer market during the 1980s and early 1990s. It is more known for its BBC Micro model B computer than for its other products.

Though the company was broken up into several independent operations in 1998, its legacy includes the development of RISC personal computers. One of its operating systems, RISC OS, continues to be developed (as two forks) by RISCOS Ltd and RISC OS Open. Some of Acorn’s former subsidiaries live on today—notably ARM Holdings, which is globally dominant in the mobile phone and PDA microprocessor market.

Acorn is sometimes referred to as the “British Apple” and has been compared to Fairchild Semiconductor for being a catalyst for start-ups. In 2010 the company was listed by David Meyer in ZDNet as number nine in a feature of top ten fallen “Dead IT giants”. Many of Britain’s IT professionals, including Quentin Pain, gained their early experiences on Acorns, which were often more technically advanced than commercially successful US hardware.

Reply Quote

Date: 19/05/2013 20:14:30
From: wookiemeister
ID: 313557
Subject: re: Lines of Code

Peak Warming Man said:


>>there was a kid at my school who would write in binary on an “acorn” / BBC computer

Well Wookie you’ve taught me something tonight, I’d never heard of Acorn Computers so I looked it up.

Acorn Computers Ltd. was a British computer company established in Cambridge, England, in 1978. The company produced a number of computers which were especially popular in the UK. These included the Acorn Electron, the BBC Micro, and the Acorn Archimedes. Acorn’s BBC Micro computer dominated the UK educational computer market during the 1980s and early 1990s. It is more known for its BBC Micro model B computer than for its other products.

Though the company was broken up into several independent operations in 1998, its legacy includes the development of RISC personal computers. One of its operating systems, RISC OS, continues to be developed (as two forks) by RISCOS Ltd and RISC OS Open. Some of Acorn’s former subsidiaries live on today—notably ARM Holdings, which is globally dominant in the mobile phone and PDA microprocessor market.

Acorn is sometimes referred to as the “British Apple” and has been compared to Fairchild Semiconductor for being a catalyst for start-ups. In 2010 the company was listed by David Meyer in ZDNet as number nine in a feature of top ten fallen “Dead IT giants”. Many of Britain’s IT professionals, including Quentin Pain, gained their early experiences on Acorns, which were often more technically advanced than commercially successful US hardware.


the raspberry pi is the latest thing to help people learn coding/ programming

its got a model A and B just like the BBC computer (as a nod to the BBc computer)

if you google ben heck bbc computer you’ll see make a mock up bbc using the raspberry pi

http://www.youtube.com/watch?v=DWI1CcJM0y8

element 14 is now the new name of “farnell”

Reply Quote

Date: 19/05/2013 20:16:34
From: Carmen_Sandiego
ID: 313559
Subject: re: Lines of Code

Read an interview with the creator of the rasberry pi and he claimed he was expecting a lifetime sales of 50,000 units. They apparently hit that mark an hour after they were made available.

Reply Quote

Date: 19/05/2013 20:20:57
From: sibeen
ID: 313562
Subject: re: Lines of Code

Boris said:


And what was working with ENIAC like?

it was da bombe.

ok so that was a different computer…

;-)

That was quite well done, Boris.

Reply Quote

Date: 19/05/2013 20:22:54
From: KJW
ID: 313563
Subject: re: Lines of Code

wookiemeister said:


there was a kid at my school who would write in binary on an “acorn” / BBC computer

I used to program a Commodore 64 using a small program that converted machine language mnemonics to machine code and visa versa. This would be about halfway between binary and assembly language in that while the program did the conversion from mnemonics to machine code, I had to supply all the memory addresses for branches, etc, without the use of labels. The resulting code was a nightmare to edit, and I was happy to move onto assembly language for my Commodore Amiga.

Reply Quote

Date: 19/05/2013 20:33:31
From: wookiemeister
ID: 313565
Subject: re: Lines of Code

Carmen_Sandiego said:

Read an interview with the creator of the rasberry pi and he claimed he was expecting a lifetime sales of 50,000 units. They apparently hit that mark an hour after they were made available.


yeah

they were making them in china originally now they are made in wales

if you going to buy one buy the welsh ones – they work without problems

element 14 says they only sell the welsh ones

i’d heard about it but forgot about for a while

the model B is probably the better model

though its more expensive

if you are making a super computer you might be better with the model A its cheaper and you could probably buy them for cheaper on ebay as people start dumping them

Reply Quote

Date: 19/05/2013 20:35:45
From: wookiemeister
ID: 313566
Subject: re: Lines of Code

KJW said:


wookiemeister said:

there was a kid at my school who would write in binary on an “acorn” / BBC computer

I used to program a Commodore 64 using a small program that converted machine language mnemonics to machine code and visa versa. This would be about halfway between binary and assembly language in that while the program did the conversion from mnemonics to machine code, I had to supply all the memory addresses for branches, etc, without the use of labels. The resulting code was a nightmare to edit, and I was happy to move onto assembly language for my Commodore Amiga.


the school had a computer lab but it was useless, the teacher was a caffeine addict

they never taught us coding to ant real extent

it died in the arse because the programme couldn’t be translated to real world output

Reply Quote

Date: 19/05/2013 22:11:10
From: wookiemeister
ID: 313576
Subject: re: Lines of Code

the raspberry pi has to be powered by a fairly good 5v source otherwise you get problems

on one site someone suggested something that could supply more than 1A

Reply Quote

Date: 19/05/2013 22:27:01
From: bourke
ID: 313580
Subject: re: Lines of Code

Skunkworks said:


KJW said:

sibeen said:

I doubt even the world’s most extreme masochist would use Assembly Language to write half a million lines of code.

Half a million lines of code is half a million lines of code regardless of the language.

I just wouldn’t mind getting a handle on it cos it is used more and more in news these days and it means nothing to me as a measure.

F-35 problems in brazzilion lines of code, Myki, despite shedloads of code, still problems.

But now I know (perhaps) a car can half a million lines, so I am trying to put that into perspective.

Generally the more lines of code, the more errors in the code (purely by statistical probability).

Hence why higher level (more succinct) languages (like Common Lisp, 1958) tend to have fewer defects than code written in less succinct languages like C, ceteris paribus (assuming similar competencies between programmers).

Reply Quote

Date: 19/05/2013 22:30:13
From: wookiemeister
ID: 313583
Subject: re: Lines of Code

bourke said:


Skunkworks said:

KJW said:

Half a million lines of code is half a million lines of code regardless of the language.

I just wouldn’t mind getting a handle on it cos it is used more and more in news these days and it means nothing to me as a measure.

F-35 problems in brazzilion lines of code, Myki, despite shedloads of code, still problems.

But now I know (perhaps) a car can half a million lines, so I am trying to put that into perspective.

Generally the more lines of code, the more errors in the code (purely by statistical probability).

Hence why higher level (more succinct) languages (like Common Lisp, 1958) tend to have fewer defects than code written in less succinct languages like C, ceteris paribus (assuming similar competencies between programmers).


you normally keep the code as short as possible so the programme works faster

when I was doing a plc course at tafe there was a glitch with the ladder logic of the allan Bradley – sometimes you had to put the next sequential logic connected to it – right away from it for the programme to work

Reply Quote

Date: 19/05/2013 22:35:24
From: bourke
ID: 313585
Subject: re: Lines of Code

wookiemeister said:


you normally keep the code as short as possible so the programme works faster

Yeah – but a program written in assembler will be orders of magnitude longer than any program written in Lisp/C/Java/C#/F#/Go – so you’ll always have fewer defects in the code the more succinct the language.

That’s why companies that use more advanced languages roll out code faster (e.g. Google use Python, Node.js & Go, Microsoft use F# & C# etc).

Reply Quote

Date: 19/05/2013 22:39:25
From: diddly-squat
ID: 313587
Subject: re: Lines of Code

wookiemeister said:

you normally keep the code as short as possible so the programme works faster

when I was doing a plc course at tafe there was a glitch with the ladder logic of the allan Bradley – sometimes you had to put the next sequential logic connected to it – right away from it for the programme to work

speeds isn’t so much affected by the length of the code base, it’s far more dependent on the efficiency of the calculation logic

Reply Quote

Date: 19/05/2013 22:46:16
From: bourke
ID: 313588
Subject: re: Lines of Code

diddly-squat said:

speeds isn’t so much affected by the length of the code base, it’s far more dependent on the efficiency of the calculation logic

And the hardware use to run it!

Reply Quote

Date: 19/05/2013 22:48:00
From: diddly-squat
ID: 313589
Subject: re: Lines of Code

bourke said:


diddly-squat said:

speeds isn’t so much affected by the length of the code base, it’s far more dependent on the efficiency of the calculation logic

And the hardware use to run it!

and the ability of the code to take advantage of the available hardware (multi-core support for instance)

Reply Quote

Date: 19/05/2013 22:48:38
From: bourke
ID: 313590
Subject: re: Lines of Code

bourke said:


diddly-squat said:

speeds isn’t so much affected by the length of the code base, it’s far more dependent on the efficiency of the calculation logic

And the hardware use to run it!

(and whether the code is optimized for that hardware – e.g. parallel processors / multiple cores / distributed systems / big data like MongoDB & Cassandra)

Reply Quote

Date: 19/05/2013 22:50:28
From: bourke
ID: 313591
Subject: re: Lines of Code

However maintainability is heavily dependant on readability and readability does correlate highly with succinctness of code.

Reply Quote

Date: 19/05/2013 22:52:24
From: bourke
ID: 313593
Subject: re: Lines of Code

As one famous author (of C) once wrote:

Every mediocre programmer creates two new jobs :)

So with Bangalore online I’m never going to run out of work!

Reply Quote

Date: 19/05/2013 23:47:33
From: Kingy
ID: 313604
Subject: re: Lines of Code

Reply Quote

Date: 20/05/2013 09:46:49
From: The Rev Dodgson
ID: 313672
Subject: re: Lines of Code

bourke said:

Generally the more lines of code, the more errors in the code (purely by statistical probability).

Hence why higher level (more succinct) languages (like Common Lisp, 1958) tend to have fewer defects than code written in less succinct languages like C, ceteris paribus (assuming similar competencies between programmers).

That would be true if everything else was equal, but obviously everything else isn’t equal.

Reply Quote

Date: 20/05/2013 09:50:54
From: bourke
ID: 313674
Subject: re: Lines of Code

The Rev Dodgson said:


bourke said:

Generally the more lines of code, the more errors in the code (purely by statistical probability).

Hence why higher level (more succinct) languages (like Common Lisp, 1958) tend to have fewer defects than code written in less succinct languages like C, ceteris paribus (assuming similar competencies between programmers).

That would be true if everything else was equal, but obviously everything else isn’t equal.

That’s what ‘ceteris paribus’ means ;-)

Reply Quote

Date: 20/05/2013 09:53:03
From: The Rev Dodgson
ID: 313675
Subject: re: Lines of Code

bourke said:


The Rev Dodgson said:

bourke said:

Generally the more lines of code, the more errors in the code (purely by statistical probability).

Hence why higher level (more succinct) languages (like Common Lisp, 1958) tend to have fewer defects than code written in less succinct languages like C, ceteris paribus (assuming similar competencies between programmers).

That would be true if everything else was equal, but obviously everything else isn’t equal.

That’s what ‘ceteris paribus’ means ;-)

oops.

I thought it was some weird new programming language :)

Reply Quote

Date: 20/05/2013 09:55:35
From: bourke
ID: 313676
Subject: re: Lines of Code

So, as a short response to your OP Skunkworks:

LOC (often measured as kLOC – thousand lines of code) is useful to compare how much ‘effort’ went into the writing of the code per se (e..g how much time has been spent on something),

However it is a useless measure of:

Cheers
Bourkie

Reply Quote

Date: 20/05/2013 09:56:29
From: bourke
ID: 313677
Subject: re: Lines of Code

The Rev Dodgson said:


bourke said:

The Rev Dodgson said:

That would be true if everything else was equal, but obviously everything else isn’t equal.

That’s what ‘ceteris paribus’ means ;-)

oops.

I thought it was some weird new programming language :)

Would be cool if we could code in Latin… uber cool ;-)

Reply Quote

Date: 20/05/2013 10:00:39
From: bourke
ID: 313678
Subject: re: Lines of Code

bourke said:


So, as a short response to your OP Skunkworks:

LOC (often measured as kLOC – thousand lines of code) is useful to compare how much ‘effort’ went into the writing of the code per se (e..g how much time has been spent on something),

However it is a useless measure of:

  • complexity of the software
  • reliability of the software
  • maintainability of the software
  • value of the software

Cheers
Bourkie

Oh and also it doesn’t take into account effort spent designing/architecting and testing the software – both extremely important ‘efforts’ required to produce quality software.

Reply Quote

Date: 20/05/2013 14:37:13
From: PM 2Ring
ID: 313730
Subject: re: Lines of Code

bourke said:

Would be cool if we could code in Latin… uber cool ;-)

You can, thanks to Damian Conway of Monash.

This paper describes a Perl module — Lingua::Romana::Perligata — that makes it possible to write Perl programs in Latin. A plausible rationale for wanting to do such a thing is provided, along with a comprehensive overview of the syntax and semantics of Latinized Perl. The paper also explains the special source filtering and parsing techniques required to efficiently interpret a programming language in which the syntax is (largely) non-positional.

Reply Quote

Date: 20/05/2013 14:43:17
From: wookiemeister
ID: 313731
Subject: re: Lines of Code

wow

the romans had computers?!

come on, I mean, what couldn’t they do?

Reply Quote

Date: 20/05/2013 14:44:46
From: Carmen_Sandiego
ID: 313732
Subject: re: Lines of Code

“A plausible rationale for wanting to do such a thing is provided”

What more rationale do you need than “It’s pretty cool”

Reply Quote

Date: 20/05/2013 14:46:34
From: Carmen_Sandiego
ID: 313733
Subject: re: Lines of Code

wookiemeister said:


wow

the romans had computers?!

come on, I mean, what couldn’t they do?

Work.

A numbering system that did not have a “Zero” was a major downfall in a binary computer.

Reply Quote

Date: 20/05/2013 14:48:40
From: wookiemeister
ID: 313734
Subject: re: Lines of Code

frigus

Reply Quote

Date: 20/05/2013 14:49:25
From: wookiemeister
ID: 313735
Subject: re: Lines of Code

Carmen_Sandiego said:


wookiemeister said:

wow

the romans had computers?!

come on, I mean, what couldn’t they do?

Work.

A numbering system that did not have a “Zero” was a major downfall in a binary computer.


just don’t use zero

Reply Quote

Date: 20/05/2013 14:50:00
From: wookiemeister
ID: 313737
Subject: re: Lines of Code

if there are any problems with zeroes you could kill a slave or something

that should make sure there are no problems

Reply Quote

Date: 20/05/2013 14:54:18
From: PM 2Ring
ID: 313738
Subject: re: Lines of Code

Carmen_Sandiego said:


“A plausible rationale for wanting to do such a thing is provided”

What more rationale do you need than “It’s pretty cool”

Good point. :)

His rationale is that word order in Latin is very flexible: in English, if you change the order of words in a sentence you generally change the meaning of the sentence, but in Latin the word order is a lot freer because it uses inflexion (word endings) to mark the function of the various words in a sentence.

Reply Quote

Date: 20/05/2013 15:02:45
From: sibeen
ID: 313743
Subject: re: Lines of Code

>His rationale is that word order in Latin is very flexible: in English, if you change the order of words in a sentence you generally change the meaning of the sentence, but in Latin the word order is a lot freer because it uses inflexion (word endings) to mark the function of the various words in a sentence.

Which always gave me the shits when I did the language.

Four years of it, and all I can remember now days is ‘uber puella’ – ‘where are the girls’.

Reply Quote

Date: 20/05/2013 15:20:52
From: Arts
ID: 313746
Subject: re: Lines of Code

sibeen said:


>His rationale is that word order in Latin is very flexible: in English, if you change the order of words in a sentence you generally change the meaning of the sentence, but in Latin the word order is a lot freer because it uses inflexion (word endings) to mark the function of the various words in a sentence.

Which always gave me the shits when I did the language.

Four years of it, and all I can remember now days is ‘uber puella’ – ‘where are the girls’.

did you ever get the answer?

Reply Quote

Date: 20/05/2013 15:37:08
From: Stealth
ID: 313765
Subject: re: Lines of Code

PM 2Ring said:


Carmen_Sandiego said:

“A plausible rationale for wanting to do such a thing is provided”

What more rationale do you need than “It’s pretty cool”

Good point. :)

His rationale is that word order in Latin is very flexible: in English, if you change the order of words in a sentence you generally change the meaning of the sentence, but in Latin the word order is a lot freer because it uses inflexion (word endings) to mark the function of the various words in a sentence.


dummies3 for2 hard6 is4 Latin1 read8 still5 to7

Reply Quote

Date: 20/05/2013 18:44:19
From: KJW
ID: 313871
Subject: re: Lines of Code

Carmen_Sandiego said:


wookiemeister said:

wow

the romans had computers?!

come on, I mean, what couldn’t they do?

Work.

A numbering system that did not have a “Zero” was a major downfall in a binary computer.

What did the Romans ever do for us? – Monty Python – Life of Brian

REG: They’ve bled us white, the bastards. They’ve taken everything we had, and not just from us, from our fathers, and from our fathers’ fathers.

LORETTA: And from our fathers’ fathers’ fathers.

REG: Yeah.

LORETTA: And from our fathers’ fathers’ fathers’ fathers.

REG: Yeah. All right, Stan. Don’t labour the point. And what have they ever given us in return?!

XERXES: The aqueduct?

REG: What?

XERXES: The aqueduct.

REG: Oh. Yeah, yeah. They did give us that. Uh, that’s true. Yeah.

COMMANDO #3: And the sanitation.

LORETTA: Oh, yeah, the sanitation, Reg. Remember what the city used to be like?

REG: Yeah. All right. I’ll grant you the aqueduct and the sanitation are two things that the Romans have done.

MATTHIAS: And the roads.

REG: Well, yeah. Obviously the roads. I mean, the roads go without saying, don’t they? But apart from the sanitation, the aqueduct, and the roads—

COMMANDO: Irrigation.

XERXES: Medicine.

COMMANDOS: Huh? Heh? Huh…

COMMANDO #2: Education.

COMMANDOS: Ohh…

REG: Yeah, yeah. All right. Fair enough.

COMMANDO #1: And the wine.

COMMANDOS: Oh, yes. Yeah…

FRANCIS: Yeah. Yeah, that’s something we’d really miss, Reg, if the Romans left. Huh.

COMMANDO: Public baths.

LORETTA: And it’s safe to walk in the streets at night now, Reg.

FRANCIS: Yeah, they certainly know how to keep order. Let’s face it. They’re the only ones who could in a place like this.

COMMANDOS: Hehh, heh. Heh heh heh heh heh heh heh.

REG: All right, but apart from the sanitation, the medicine, education, wine, public order, irrigation, roads, a fresh water system, and public health, what have the Romans ever done for us?

XERXES: Brought peace.

REG: Oh. Peace? Shut up!

Reply Quote

Date: 20/05/2013 18:55:40
From: Mr Ironic
ID: 313884
Subject: re: Lines of Code

As anyone whom has had dealings with upper managment will understand…

There is a distinct difference between having a unique idea and claming it was yours.

Reply Quote

Date: 20/05/2013 19:44:55
From: wookiemeister
ID: 313901
Subject: re: Lines of Code

if you tried to pre empt the cmos battery dying by replacing you actually drop power to the cmos and hence change bios setting

is there a way of changing the cmos battery without knocking out bios settings?

Reply Quote

Date: 20/05/2013 19:51:49
From: Riff-in-Thyme
ID: 313902
Subject: re: Lines of Code

wookiemeister said:


if you tried to pre empt the cmos battery dying by replacing you actually drop power to the cmos and hence change bios setting

is there a way of changing the cmos battery without knocking out bios settings?

why can’t you just reset the bios?

Reply Quote

Date: 20/05/2013 19:52:32
From: KJW
ID: 313903
Subject: re: Lines of Code

bourke said:


wookiemeister said:

you normally keep the code as short as possible so the programme works faster

Yeah – but a program written in assembler will be orders of magnitude longer than any program written in Lisp/C/Java/C#/F#/Go – so you’ll always have fewer defects in the code the more succinct the language.

That’s why companies that use more advanced languages roll out code faster (e.g. Google use Python, Node.js & Go, Microsoft use F# & C# etc).

I challenge the notion that higher level languages vastly reduce the overall difficulty of creating a program. This is because the intrinsic complexity of a program is fairly independent of the language used to encode it. See Kolmogorov complexity. Code size reduction comes from having pre-existing libraries of functions to access, but an experienced programmer will inevitably have built their own library of common functions. Admittedly, a higher level language makes it easier to implement such functions, but the side effect of having so many functions available is (in my experience) a constant referral to the “help” manuals to check the precise syntax and functionality. Interestingly, VBA provides assistance on the syntax of a function as you type. This suggests that the ease of creating code is actually in the capabilities of the program editor rather than in the language itself.

The real benefit of a higher-level language is portability to other hardware platforms. Platform-independence is especially important for webpages on the internet.

Reply Quote

Date: 20/05/2013 19:59:55
From: wookiemeister
ID: 313904
Subject: re: Lines of Code

wookiemeister said:


if you tried to pre empt the cmos battery dying by replacing you actually drop power to the cmos and hence change bios setting

is there a way of changing the cmos battery without knocking out bios settings?


I guess you just rest the bios settings to default to stop any complications

Reply Quote

Date: 20/05/2013 20:14:55
From: Skunkworks
ID: 313905
Subject: re: Lines of Code

bourke said:


So, as a short response to your OP Skunkworks:

LOC (often measured as kLOC – thousand lines of code) is useful to compare how much ‘effort’ went into the writing of the code per se (e..g how much time has been spent on something),

However it is a useless measure of:

  • complexity of the software
  • reliability of the software
  • maintainability of the software
  • value of the software

Cheers
Bourkie

Fair enough but cannot help thinking it must be comparable to something. And as an aside, you said value of software, what would be the most expensive? I was thinking F-22 gear for billions spent but might not be fair cos you cannot buy it. Or is it some software from left field that everyone uses and has to pay for?

Reply Quote

Date: 20/05/2013 20:16:04
From: Riff-in-Thyme
ID: 313906
Subject: re: Lines of Code

wookiemeister said:


wookiemeister said:

if you tried to pre empt the cmos battery dying by replacing you actually drop power to the cmos and hence change bios setting

is there a way of changing the cmos battery without knocking out bios settings?


I guess you just rest the bios settings to default to stop any complications

makes sense

Reply Quote

Date: 20/05/2013 20:23:03
From: wookiemeister
ID: 313907
Subject: re: Lines of Code

Skunkworks said:


bourke said:

So, as a short response to your OP Skunkworks:

LOC (often measured as kLOC – thousand lines of code) is useful to compare how much ‘effort’ went into the writing of the code per se (e..g how much time has been spent on something),

However it is a useless measure of:

  • complexity of the software
  • reliability of the software
  • maintainability of the software
  • value of the software

Cheers
Bourkie

Fair enough but cannot help thinking it must be comparable to something. And as an aside, you said value of software, what would be the most expensive? I was thinking F-22 gear for billions spent but might not be fair cos you cannot buy it. Or is it some software from left field that everyone uses and has to pay for?


its possible

military equipment might use different types of OS to stop hacking (or you’d think so)

the brains of aircraft such as fighters are shielded to stop nuclear blasts upsetting and burning out chips

you might use an existing software or you might have your own – the only disadvantage would be getting people to be able to use it – unless you could have something that translates it to another language??

my guesses would be that you’d use an existing software and hardware of other aircraft known to work and be reliable and tweak it with more powerful computers

the chinese and other countries routinely steal the secrets of military equipment of the west so any advantage you’d have by having the latest fighter is lost because the secrets are used for their aircraft or sold on to third parties

Reply Quote

Date: 20/05/2013 20:38:10
From: PM 2Ring
ID: 313912
Subject: re: Lines of Code

Skunkworks said:

Fair enough but cannot help thinking it must be comparable to something.

Lines of code is a very primitive measure, but I guess it’s better than nothing when you need to tell management how much work you’ve done. :) But comparing different programs by their line count doesn’t really tell you very much, even if they’re written in the same language; similarly, comparing novels by line count doesn’t tell you how good a novel is or how much work actually went into creating it.

Reply Quote

Date: 20/05/2013 20:39:54
From: wookiemeister
ID: 313915
Subject: re: Lines of Code

most of the code might have just been robbed from elsewhere

Reply Quote

Date: 20/05/2013 20:41:54
From: Skunkworks
ID: 313916
Subject: re: Lines of Code

PM 2Ring said:


Skunkworks said:
Fair enough but cannot help thinking it must be comparable to something.

Lines of code is a very primitive measure, but I guess it’s better than nothing when you need to tell management how much work you’ve done. :)

hehehe, if I was management, I would not set lines of code as a measure of effort, I prefer an agreed deliverable but I get your point.

Reply Quote

Date: 20/05/2013 20:59:38
From: wookiemeister
ID: 313939
Subject: re: Lines of Code

actually a funny story I heard recently

one of the apprentices was working on a CRT and had his hand at the back of the electronics and there was a crack on the transformer case allowing some leakage current. he was stuck being zapped until he managed to wrench his hand away before someone realised he was hooked up and could turn off the power

Reply Quote

Date: 20/05/2013 21:02:44
From: PM 2Ring
ID: 313941
Subject: re: Lines of Code

KJW said:

I challenge the notion that higher level languages vastly reduce the overall difficulty of creating a program. This is because the intrinsic complexity of a program is fairly independent of the language used to encode it. See Kolmogorov complexity.

The overall intrinsic complexity of a given program doesn’t change, but how the complexity is compartmentalised does change. So a higher level language provides fancy data structures and functions that can be used in many programs, so each new program doesn’t have to re-invent the wheel. This is of benefit both to the program’s author and to others reading the program source.

KJW said:

Code size reduction comes from having pre-existing libraries of functions to access, but an experienced programmer will inevitably have built their own library of common functions.

Not just functions, but high level data types. Eg in many modern languages you can easily create & manipulate sparse arrays that are indexed by strings. Sure, you can effectively implement such things by hand in C (for example), but the syntax won’t be as clean as it is in a language that provides sparse arrays as a built-in data type.

For small programs, it can be easier to use your own libraries, but for big projects pre-existing libraries are the way to go, especially if multiple people are working on the project.

Modern operating environments are vast & complex things, and libraries to manipulate them are also by necessity vast & complex. But you’d be crazy to try to implement your own GUI library (for example) for a modern OS that built everything from the ground up using basic graphic primitives, etc. And it’d take many coder-years.

KJW said:


Admittedly, a higher level language makes it easier to implement such functions, but the side effect of having so many functions available is (in my experience) a constant referral to the “help” manuals to check the precise syntax and functionality. Interestingly, VBA provides assistance on the syntax of a function as you type. This suggests that the ease of creating code is actually in the capabilities of the program editor rather than in the language itself.

Yeah, a good editor / IDE makes life a lot easier by hiding most of the underlying complexity encapsulated in the language & the libraries you’re using.

KJW said:


The real benefit of a higher-level language is portability to other hardware platforms. Platform-independence is especially important for webpages on the internet.

Not just portability to other hardware platforms. The ability to re-use code and to share it with others is also very important.

Reply Quote

Date: 20/05/2013 21:25:22
From: Spider Lily
ID: 313966
Subject: re: Lines of Code

Evening all

Potential new family member :)

Meeting tomorrow to check each other out :D

Reply Quote

Date: 20/05/2013 21:28:29
From: Spider Lily
ID: 313976
Subject: re: Lines of Code

Ooops did it again

sigh

Reply Quote

Date: 20/05/2013 21:40:06
From: KJW
ID: 313997
Subject: re: Lines of Code

PM 2Ring said:


The overall intrinsic complexity of a given program doesn’t change, but how the complexity is compartmentalised does change. So a higher level language provides fancy data structures and functions that can be used in many programs, so each new program doesn’t have to re-invent the wheel. This is of benefit both to the program’s author and to others reading the program source.

But that’s just enforcement of a structured programming style. If I want to implement class structures in a low-level language, there is nothing stopping me.

PM 2Ring said:


Modern operating environments are vast & complex things, and libraries to manipulate them are also by necessity vast & complex. But you’d be crazy to try to implement your own GUI library (for example) for a modern OS that built everything from the ground up using basic graphic primitives, etc. And it’d take many coder-years.

The operating system libraries are available to both high-level and low-level programming languages, so this doesn’t provide a greater advantage of one over the other.

PM 2Ring said:


Not just portability to other hardware platforms. The ability to re-use code and to share it with others is also very important.

In what way is a high-level language easier to reuse and share with others than a low-level language (other than platform-independence)? Any source code can be reused regardless of the language. And sharing code will always be constrained by the requirement that the language be available to all parties.

Reply Quote

Date: 20/05/2013 21:41:48
From: PM 2Ring
ID: 314000
Subject: re: Lines of Code

Skunkworks said:


PM 2Ring said:

Skunkworks said:
Fair enough but cannot help thinking it must be comparable to something.

Lines of code is a very primitive measure, but I guess it’s better than nothing when you need to tell management how much work you’ve done. :)

hehehe, if I was management, I would not set lines of code as a measure of effort, I prefer an agreed deliverable but I get your point.

Bean counter like tangible beans to count. :) And LOC gives them a way to compare apples and oranges, even when the comparison is virtually meaningless. Agreed deliverables is good in principle, but how is a client to know how much your code is really worth? LOC gives them a rough idea of how many person-hours it took to create the program, and that can help them to decide if the price you’re offering is fair.

With a large project, it’s nice to be able to give progress reports. Often, a big project can be broken down into a basic framework and a number of relatively independent modules that slot into the framework. A small software shop might work on each of these components separately and deliver each one as it’s completed. But a larger organization would be more likely to assign a team to each component and work on them all simultaneously. So they give estimates of the total LOC count for the whole project and each component up front, and regularly tell the client what the current LOC status is, and if necessary, revise the expected total LOC count.

Also, it can be very tricky to actually agree on an agreed deliverable. Clients have a nasty tendency to shift the goalposts, no matter how hard you try to pin them down to a particular specification before you start coding. Sometimes, the desired changes are easy to implement, but sometimes they can require major redesigning & re-writing.

One good technique to reduce this tendency is to collaborate with the client to produce the user manual for the software before one line of code is written. Only when everyone is happy with the user manual does program design & coding begin. This technique works fairly well for software that’s designed for human interaction, but I guess it may not be so applicable for software that controls a car or an aeroplane.

Reply Quote

Date: 20/05/2013 21:53:57
From: Skunkworks
ID: 314012
Subject: re: Lines of Code

PM 2Ring said:

Bean counter like tangible beans to count. :) And LOC gives them a way to compare apples and oranges, even when the comparison is virtually meaningless. Agreed deliverables is good in principle, but how is a client to know how much your code is really worth? LOC gives them a rough idea of how many person-hours it took to create the program, and that can help them to decide if the price you’re offering is fair.

Also, it can be very tricky to actually agree on an agreed deliverable. Clients have a nasty tendency to shift the goalposts, no matter how hard you try to pin them down to a particular specification before you start coding. Sometimes, the desired changes are easy to implement, but sometimes they can require major redesigning & re-writing.

One good technique to reduce this tendency is to collaborate with the client to produce the user manual for the software before one line of code is written. Only when everyone is happy with the user manual does program design & coding begin. This technique works fairly well for software that’s designed for human interaction, but I guess it may not be so applicable for software that controls a car or an aeroplane.

I agree. I have been a counterpoint before objecting to the software creep. But it is not always the clients fault. The vendor especially in early phases might say we can also do this for you, you think it sounds great and add it into the deliverables. Avoid. Do not do.

And I would hopefully know what the software is worth (to me) because I have costed what I want it to do beforehand. If I had a problem that I assessed at costing x and software costing x does it at y then good to go.

But I agree, software integration agreement between purchasers and vendors needs a lot more work, mostly despite the lunches and back slapping they both are viewing the problem from different ends.

Reply Quote

Date: 21/05/2013 15:20:02
From: bourke
ID: 314390
Subject: re: Lines of Code

KJW said:


bourke said:

A program written in assembler will be orders of magnitude longer than any program written in Lisp/C/Java/C#/F#/Go – so you’ll always have fewer defects in the code the more succinct the language.

That’s why companies that use more advanced languages roll out code faster (e.g. Google use Python, Node.js & Go, Microsoft use F# & C# etc).

I challenge the notion that higher level languages vastly reduce the overall difficulty of creating a program. This is because the intrinsic complexity of a program is fairly independent of the language used to encode it. See Kolmogorov complexity. Code size reduction comes from having pre-existing libraries of functions to access, but an experienced programmer will inevitably have built their own library of common functions. Admittedly, a higher level language makes it easier to implement such functions, but the side effect of having so many functions available is (in my experience) a constant referral to the “help” manuals to check the precise syntax and functionality. Interestingly, VBA provides assistance on the syntax of a function as you type. This suggests that the ease of creating code is actually in the capabilities of the program editor rather than in the language itself.

The real benefit of a higher-level language is portability to other hardware platforms. Platform-independence is especially important for webpages on the internet.

I dispute this claim – as people tend to ‘think’ in the language they write in (same goes for human languages). Being able to think more succinctly lets you put more of the solution/problem space into your head at any one time.

The same goes for reading someone else’s code (about 95% of working with software involves) – an obvious example are ‘loop’ constructs. Many older languages (like C, VB etc) use for loops to iterate over collections/arrays – however most modern languages use lambda expressions / closures (or better).

This is precisely the reason why higher level languages are used / were invented.

Reply Quote

Date: 21/05/2013 20:44:34
From: bourke
ID: 314680
Subject: re: Lines of Code

PM 2Ring said:


…a larger organization would be more likely to assign a team to each component and work on them all simultaneously. So they give estimates of the total LOC count for the whole project and each component up front, and regularly tell the client what the current LOC status is, and if necessary, revise the expected total LOC count.

No way! There is absolutely no way could anyone estimate the total LOC for an entire project! You’d be updating your estimate just as often as you updated the code thereby resulting in %complete moving forwards and backwards randomly and rendering your numbers utterly useless for tracking purposes (their only purpose).

PM 2Ring said:


Also, it can be very tricky to actually agree on an agreed deliverable. Clients have a nasty tendency to shift the goalposts, no matter how hard you try to pin them down to a particular specification before you start coding. Sometimes, the desired changes are easy to implement, but sometimes they can require major redesigning & re-writing.

Hence why Agile software development stops trying to push water uphill (the waterfall model) and instead treats the SDL the way it always works out in the end anyway: time an materials. Note that this does not preclude fixed-price projects – it just means that the stuff that gets built to the agreed timeframe, budget, and quality is what was actually needed (not wanted, but needed).

Traditionally you’d write out requirements first and then build everything. this is wrong as 100% of the time someone will think of something useful – something more important than at least 1% of the original requirements – before the end of the project. Normally waterfall dictates you’d wait until release 2 to implement such features – however this is wrong. No matter what point in a project you are – only the next most important feature should be built. Indeed you WANT everyone on the project to be thinking of new and better features – for the whole project. It is absolute incompetence to expect any person or team of people to only come up with requirements months/years before delivery – the whole environment changes during the course of a project; if you are not agile, then your agile competitors will eat your company for breakfast.

Bourkie
Singing off from Silicon Valley :)

Reply Quote

Date: 21/05/2013 20:56:27
From: bourke
ID: 314681
Subject: re: Lines of Code

Skunkworks said:


I agree. I have been a counterpoint before objecting to the software creep. But it is not always the clients fault. The vendor especially in early phases might say we can also do this for you, you think it sounds great and add it into the deliverables. Avoid. Do not do.

And I would hopefully know what the software is worth (to me) because I have costed what I want it to do beforehand. If I had a problem that I assessed at costing x and software costing x does it at y then good to go.

Not sure if ‘scope creep’ is the same thing as a vendor suggesting/offering good new features…

What if the new feature has more business ‘value’ than one of the original features (very likely).

Do deliver the best software you must always deliver the highest value features first – irrespective of when someone discovered a feature.

Indeed often some the best (highest value) features take some thinking to discover – and obviously this may happen half-way through implementation. This is why the 80s-style waterfall SDL model is fatally flawed – and why agile Silicon Valley start-ups have crushed so many old-school software houses. You WANT everyone on your project to be thinking of new features (and better features to replace existing features) – good coders don’t work 9-5 × 5; they work 24/7 – often a solution comes to me at 7am in the shower, or later at night at home. That is also why old-school clock-watching managers in IT need to be shot – you pay a coder for their brain’s use 24/7, and by enforcing industrial-age factory hours in the office your are actually telling them to cut down on their productivity!

Reply Quote

Date: 21/05/2013 22:05:37
From: sibeen
ID: 314718
Subject: re: Lines of Code

> That is also why old-school clock-watching managers in IT need to be shot – you pay a coder for their brain’s use 24/7, and by enforcing industrial-age factory hours in the office your are actually telling them to cut down on their productivity!

That’s the case in shedloads of fields, bourkie. Many is the time I’ve waken in the middle of the night and had an ‘aha moment’. They’re just harder to put down on the timesheet, or the invoice, whatever the case may be :)

Reply Quote

Date: 21/05/2013 22:57:10
From: bourke
ID: 314785
Subject: re: Lines of Code

sibeen said:


> That is also why old-school clock-watching managers in IT need to be shot – you pay a coder for their brain’s use 24/7, and by enforcing industrial-age factory hours in the office your are actually telling them to cut down on their productivity!

That’s the case in shedloads of fields, bourkie. Many is the time I’ve waken in the middle of the night and had an ‘aha moment’. They’re just harder to put down on the timesheet, or the invoice, whatever the case may be :)

You can invoice it within an 8-hour block – but those 8 hours could (will) be spread out over the 24.

Reply Quote

Date: 21/05/2013 23:03:55
From: bourke
ID: 314793
Subject: re: Lines of Code

bourke said:


sibeen said:

> That is also why old-school clock-watching managers in IT need to be shot – you pay a coder for their brain’s use 24/7, and by enforcing industrial-age factory hours in the office your are actually telling them to cut down on their productivity!

That’s the case in shedloads of fields, bourkie. Many is the time I’ve waken in the middle of the night and had an ‘aha moment’. They’re just harder to put down on the timesheet, or the invoice, whatever the case may be :)

You can invoice it within an 8-hour block – but those 8 hours could (will) be spread out over the 24.

This is precisely why many IT companies allow their hackers to work from home/remotely/anywhere they like – and why Google/Atlassian etc allow 20% free time whilst at work: because you WANT your staff not to segregate work from non-work – to let their brains be uninhibited from solving problems 24/7.

Reply Quote

Date: 22/05/2013 10:23:39
From: mollwollfumble
ID: 314931
Subject: re: Lines of Code

Skunkworks said:


Skunkworks said:
I have read that modern luxury cars now have half a million lines of code. Is half a million lines of code a telephone book of info?

Badly worded, if half a million lines was converted to the big city yellow telephone books how many would it fill?

OK, It’s written on a microprocessor, that suggests the C programming language. A typical line of C code is about 20 characters. A typical telephone book entry contains 30 characters. Yellow Pages has 5 columns per page and about 110 entries per column. The proportion of blank lines in C code and in Yellow Pages are similar.

500,000 * 20 = 10 million characters of computer code.
30 * 5 * 110 = 16,500 characters per page of yellow pages.

500,000 / 16,500 = 600 pages.
The A-K Melbourne 2004 has 1634 pages. So it would fill about 1/3 of a telephone book.

Reply Quote

Date: 22/05/2013 11:07:32
From: bourke
ID: 314939
Subject: re: Lines of Code

mollwollfumble said:


Skunkworks said:

Skunkworks said:
I have read that modern luxury cars now have half a million lines of code. Is half a million lines of code a telephone book of info?

Badly worded, if half a million lines was converted to the big city yellow telephone books how many would it fill?

OK, It’s written on a microprocessor, that suggests the C programming language.

Could be written for an ASIC firmware – in that case it’d be VHDL.

mollwollfumble said:


A typical line of C code is about 20 characters.

Depends whether you include blank lines or lines containing only parenthese or curly brackets!

Reply Quote

Date: 22/05/2013 13:29:04
From: mollwollfumble
ID: 314999
Subject: re: Lines of Code

bourke said:


mollwollfumble said:

Skunkworks said:

OK, It’s written on a microprocessor, that suggests the C programming language.

Could be written for an ASIC firmware – in that case it’d be VHDL.

mollwollfumble said:


A typical line of C code is about 20 characters.

Depends whether you include blank lines or lines containing only parenthese or curly brackets!

Yes. I’m counting lines containing only parentheses as blank lines of code. I’m counting borders of display ads and lines lost due to large text as blank lines for yellow pages.

Reply Quote

Date: 22/05/2013 20:06:12
From: KJW
ID: 315202
Subject: re: Lines of Code

bourke said:


I dispute this claim – as people tend to ‘think’ in the language they write in (same goes for human languages). Being able to think more succinctly lets you put more of the solution/problem space into your head at any one time.

Bonini’s Paradox

The reason I made my challenge is the observation that programs inevitably contain “small” operations. Intriguingly, in a recent VBA program I wrote, I had to swap the values of two variables. In MC68000 Assembly Language, this is a single instruction, but as far as I could see, it required three instructions in VBA.

One reason to use low-level languages is the ability to stay close to what the program is really doing. For example, I am very wary of floating-point numbers due to problems I had with them in the past. I still use them of course, but if one has some form of threshold to consider, they can be a problem, regardless of the precision.

Reply Quote

Date: 22/05/2013 20:47:59
From: bourke
ID: 315237
Subject: re: Lines of Code

KJW said:


bourke said:

I dispute this claim – as people tend to ‘think’ in the language they write in (same goes for human languages). Being able to think more succinctly lets you put more of the solution/problem space into your head at any one time.

Bonini’s Paradox

The reason I made my challenge is the observation that programs inevitably contain “small” operations. Intriguingly, in a recent VBA program I wrote, I had to swap the values of two variables. In MC68000 Assembly Language, this is a single instruction, but as far as I could see, it required three instructions in VBA.

Yes, but VBA is not exactly a succinct language ;-)

Generally you need to load the entire program’s architecture into your head in order to modify existing or add new behaviour – or at least you do in order to avoid causing new/future problems or breaking something already there (this last one can be mitigated with good automated tests, however you shouldn’t only rely on them).

The easiest way to load a full program into your head is to read it in a succinct language (as opposed to reading it as lines of assembler).

KJW said:


One reason to use low-level languages is the ability to stay close to what the program is really doing. For example, I am very wary of floating-point numbers due to problems I had with them in the past. I still use them of course, but if one has some form of threshold to consider, they can be a problem, regardless of the precision.

Yes, not many people use floats these days for precisely that reason – instead they use decimal or integer types (floats were only used in the past due to technical limitations – limitations less and less relevant with today’s – and future – hardware).

Reply Quote

Date: 22/05/2013 20:58:58
From: The Rev Dodgson
ID: 315242
Subject: re: Lines of Code

bourke said:


Yes, not many people use floats these days for precisely that reason – instead they use decimal or integer types (floats were only used in the past due to technical limitations – limitations less and less relevant with today’s – and future – hardware).

They don’t?

I must read a whole load of out of date stuff.

Reply Quote

Date: 22/05/2013 22:54:51
From: bourke
ID: 315309
Subject: re: Lines of Code

The Rev Dodgson said:


bourke said:

Yes, not many people use floats these days for precisely that reason – instead they use decimal or integer types (floats were only used in the past due to technical limitations – limitations less and less relevant with today’s – and future – hardware).

They don’t?

I must read a whole load of out of date stuff.

Perhaps for VBA they do!

Reply Quote

Date: 25/05/2013 16:34:53
From: wookiemeister
ID: 317134
Subject: re: Lines of Code

thought I was going mad

I discovered that writing to the sd card was a little harder than I thought – you need some proper writing software

still couldn’t get it to work , then figured that I hadn’t quite sat the sd card properly

then it worked

at least I’ve got the GUI open and working now

Reply Quote

Date: 25/05/2013 16:36:51
From: Michael V
ID: 317137
Subject: re: Lines of Code

What did the blackberry pie taste like?

Reply Quote

Date: 25/05/2013 16:45:37
From: wookiemeister
ID: 317142
Subject: re: Lines of Code

no idea I haven’t used it yet only got it working

the RPI uses Linux

I use WIN7

you don’t seem to be able to just download the OS to the sd in the usb card reader, you appear to need to format the sd card, then use win32disk imager dedicated to download the programme using win7 I think.

its only when that’s right and the sd is snug in the cradle that it works

now i’m looking at the desktop on the monitor

the next thing i’ll do is have a look around instructions and see if I can use the internet through the rpi

Reply Quote

Date: 25/05/2013 17:39:20
From: sibeen
ID: 317167
Subject: re: Lines of Code

Michael V said:


What did the blackberry pie taste like?

It is rather amazing. A fully fledged computer, and it costs less than a tin of tobacco.

Reply Quote

Date: 25/05/2013 18:13:36
From: Michael V
ID: 317191
Subject: re: Lines of Code

sibeen said:


Michael V said:

What did the blackberry pie taste like?

It is rather amazing. A fully fledged computer, and it costs less than a tin of tobacco.

.

Do you have one?

Reply Quote