LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 02-11-2022, 12:00 PM   #31
leclerc78
Member
 
Registered: Dec 2020
Posts: 169

Rep: Reputation: Disabled

When I 'recycled' myself into IT in 1978, people said that COBOL would be dead soon. Now I am a decade old retiree, it still lives.
The advantage of COBOL is it's can be decompiled (to get the source code), so hackers cannot insert malicious codes into a program easily.
 
Old 02-11-2022, 01:48 PM   #32
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,162

Rep: Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268
Quote:
Originally Posted by sundialsvcs View Post
Actually, EdGr, "this is emphatically not(!) the case!" Not when you are talking about "dollars and cents!"

If your task is to "add up an endless column of figures," and you do this using floating-point, then the errors can quickly grow to be very large ... because you are translating each input into a floating-point "equivalent," then translating the final sum back out.

Although most programming languages – including Perl – provide "decimal arithmetic" using some external package or packages, none other than COBOL (to my knowledge ...) built it right into the language itself ... and optimized the hell out of it.

Every microprocessor that I am aware of ... even the M6502 ... implemented a "decimal mode" as well as "binary." So, the hardware support has always existed, and I doubt that "speed" was ever a consideration between the two.

Yes: "BCD = Binary-Coded Decimal" has always been important, where each four-bit group represents either a decimal digit or a sign indicator, and arithmetic is performed using decimal rules. CPU hardware has supported both.

I did some stuff in PL/1 back in the day. It also had decimal mode built in. PL/1 also allowed you to start arrays at either 0 or 1 (or anywhere else, for that matter). It tried to be everything to everyone, I think.
 
Old 02-12-2022, 01:01 AM   #33
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 22,101

Rep: Reputation: 7365Reputation: 7365Reputation: 7365Reputation: 7365Reputation: 7365Reputation: 7365Reputation: 7365Reputation: 7365Reputation: 7365Reputation: 7365Reputation: 7365
https://software.intel.com/en-us/dow...3b-3c-3d-and-4
Quote:
When operating on BCD integers in x87 FPU data registers, BCD values are packed in an 80-bit format and referred
to as decimal integers. In this format, the first 9 bytes hold 18 BCD digits, 2 digits per byte. The least-significant
digit is contained in the lower half-byte of byte 0 and the most-significant digit is contained in the upper half-byte
of byte 9. The most significant bit of byte 10 contains the sign bit (0 = positive and 1 = negative; bits 0 through 6
of byte 10 are don’t care bits). Negative decimal integers are not stored in two's complement form; they are distin-
guished from positive decimal integers only by the sign bit. The range of decimal integers that can be encoded in
this format is – 10^18 + 1 to 10^18 – 1.
The decimal integer format exists in memory only. When a decimal integer is loaded in an x87 FPU data register, it
is automatically converted to the double-extended-precision floating-point format. All decimal integers are exactly
representable in double extended-precision format.
 
Old 02-12-2022, 10:24 AM   #34
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS, Manjaro
Posts: 5,781

Rep: Reputation: 2772Reputation: 2772Reputation: 2772Reputation: 2772Reputation: 2772Reputation: 2772Reputation: 2772Reputation: 2772Reputation: 2772Reputation: 2772Reputation: 2772
Quote:
Originally Posted by pan64 View Post
Note: if you are on hardware that does not have x87 FPU registers, or purposefully does not make use of them, then BCD format is preserved. For some kinds of processing this is critical.
 
Old 02-12-2022, 12:48 PM   #35
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,484

Rep: Reputation: 2361Reputation: 2361Reputation: 2361Reputation: 2361Reputation: 2361Reputation: 2361Reputation: 2361Reputation: 2361Reputation: 2361Reputation: 2361Reputation: 2361
This thread amuses me.

About 2000, I designed & built battery powered hardware for a prototype 7 segment paper display. I just had a PIC Microcontroller, which is a pretty stupid cpu - more a bank of adressable switches for it's legs. I ran it @32.768khz, because there was little room or need for a clock chip. I did all of this stuff in Assembler. There probably was a binary --> bcd instruction, but I don't know if I used it, because IIRC, I kept each digit in a separate register for convenience.

On topic: If you as a programmer are looking backwards, sure, learn Perl. If you're looking forward, do Python. I don't consider myself a programmer at all, but the one programmer I know well has at least 12 languages under his belt, although he's only automatic in about half of them.
 
Old 02-14-2022, 10:10 AM   #36
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,706
Blog Entries: 4

Rep: Reputation: 3949Reputation: 3949Reputation: 3949Reputation: 3949Reputation: 3949Reputation: 3949Reputation: 3949Reputation: 3949Reputation: 3949Reputation: 3949Reputation: 3949
PL/1 was taught in our University although the language never went very far. Like Ada after it, I don't think that it was used by much of anyone outside of government contractors.

The COBOL designers later started introducing "object oriented" features into their language, although I don't know how widely they were ever adopted.

Hmmm... ADD 1 TO COBOL GIVING COBOL.
 
Old 02-14-2022, 08:45 PM   #37
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS, Manjaro
Posts: 5,781

Rep: Reputation: 2772Reputation: 2772Reputation: 2772Reputation: 2772Reputation: 2772Reputation: 2772Reputation: 2772Reputation: 2772Reputation: 2772Reputation: 2772Reputation: 2772
Quote:
Originally Posted by sundialsvcs View Post
PL/1 was taught in our University although the language never went very far. Like Ada after it, I don't think that it was used by much of anyone outside of government contractors.

The COBOL designers later started introducing "object oriented" features into their language, although I don't know how widely they were ever adopted.

Hmmm... ADD 1 TO COBOL GIVING COBOL.
I worked for several years at a steel company. They ran Object Oriented Microfocus COBOL to code their interface between Oracle databases on IBM AIX and Windows machines and the remote mainframe DB2 database servers. At one point the manager and I had to pull them apart and make changes, because we were the only ones left that could GROK COBOL!

It was "interesting", but we got it to work.

I really WISH we could have used PERL!! It would have taken half the time and 20% of the code!

Last edited by wpeckham; 02-14-2022 at 08:47 PM.
 
Old 02-15-2022, 10:28 AM   #38
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,706
Blog Entries: 4

Rep: Reputation: 3949Reputation: 3949Reputation: 3949Reputation: 3949Reputation: 3949Reputation: 3949Reputation: 3949Reputation: 3949Reputation: 3949Reputation: 3949Reputation: 3949
But at the time that the company started that initiative, their technical options might have been much more constrained. Today, we live with "an embarrassment of riches." But that certainly was not always the case – as all of us well remember. (And in the case of Perl, but likewise many other tools, the real "leaps and bounds advances" have occurred within CPAN – and the binary libraries that many CPAN packages actually use to do the work.) At the time, and really as now, "we do what we need to do with whatever we have to do with it, and hope to retire before we get caught."
 
Old 02-15-2022, 10:39 AM   #39
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,484

Rep: Reputation: 2361Reputation: 2361Reputation: 2361Reputation: 2361Reputation: 2361Reputation: 2361Reputation: 2361Reputation: 2361Reputation: 2361Reputation: 2361Reputation: 2361
I learned a bit of COBOL back in the day, and it was basically English. English is a terrible programming language.
 
Old 02-17-2022, 09:24 AM   #40
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,706
Blog Entries: 4

Rep: Reputation: 3949Reputation: 3949Reputation: 3949Reputation: 3949Reputation: 3949Reputation: 3949Reputation: 3949Reputation: 3949Reputation: 3949Reputation: 3949Reputation: 3949
Now, looping back to the original question of "is it still worth learning Perl," I myself have always been very interested in programming languages and even invented one. You never know which tools you are going to find being used in any "shop." I have found it to be to my advantage to become cursorily familiar with languages as they come along, particularly the concepts and metaphors that each one "champions."

The "rust" programming language, for example, is all about safe concurrency. Google's "Dart/Flutter" system for cross-platform mobile development implements many of the same ideas. All of these systems have excellent web sites with extensive conceptual material as well as traditional syntax documentation. It's well worth your time to make yourself aware of everything that's going on in your industry ... both new and "old."
 
Old 02-18-2022, 05:18 PM   #41
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,885
Blog Entries: 13

Rep: Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931
I only set out to learn a language if I have to use it. I've added a few over the years due to work assignments.

I can learn them readily enough. So not setting out specifically to learn one for kicks.

I know you've discussed whether it's better versus other script languages. Can't say, but bash, and Python seem to be the most typical ones I see being used for scripts.
 
Old 02-18-2022, 09:40 PM   #42
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,706
Blog Entries: 4

Rep: Reputation: 3949Reputation: 3949Reputation: 3949Reputation: 3949Reputation: 3949Reputation: 3949Reputation: 3949Reputation: 3949Reputation: 3949Reputation: 3949Reputation: 3949
Python is an excellent interpreter and I generally use it more often these days than Perl ... but you just never know what you'll find out there at your next job or assignment. You're almost never writing new software. You're almost always maintaining a mission-critical existing system, and those systems don't move from the original language they were written in. Perl still moves a lot of freight.
 
  


Reply

Tags
perl



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
I am learning perl. where can I find free web hosting that supports perl. Virtual Circuit Linux - Server 1 11-29-2013 03:53 AM
is perl worth learning? smeezekitty Programming 60 12-26-2009 07:09 PM
perl(Cwd) perl(File::Basename) perl(File::Copy) perl(strict)....What are those? Baldorg Linux - Software 1 11-09-2003 08:09 PM
Finding Module Dependencies...(Still loading...still loading..still loading..HANG!!!) Aeudian Linux - General 3 08-11-2003 03:31 PM
Finding Module Dependencies.....(still loading....Still loading....still loading) Aeudian Linux - Newbie 1 07-28-2003 02:27 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:15 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration