Sponsored Content
The Lounge What is on Your Mind? I'll probably never be the best in the field... Post 303032099 by bakunin on Monday 11th of March 2019 10:09:22 AM
Old 03-11-2019
Quote:
Originally Posted by wisecracker
I am an amateur coder

Much has already been said - mostly by Neo in his passionate post - so i will concentrate on some minor points:

Moderator's Comments:
Mod Comment Neo: Edited by Admin


Quote:
Originally Posted by wisecracker
You do not need a maths and/or computer science doctorate, just an accepting mind and the ability to logically create code, BUT, most of all, patience and LOTS of practice.
You are right - but a working understanding of math principles certainly will help. In fact i got the most education about programming from Don Knuths famous "TAOCP", The Art of Computer Programming. It is a heavily mathematical book and may be "love at third sight", but i guarantee you that it will change your life as a programmer forever.

Also notice that Knuth says it is an "art" - not a science, not a trade. In fact - like any art - it is a trade at the base like masonry is at the base of sculpting. But this trade is, as the apprentice ascends to journeyman and finally to master - transcended into the realm of the artistic. The words "technics", "technical", etc. come from the greek word τέχνη ("techne"), which means "art". We should do accordingly.

Art seems like breaking every rule and in some respect it certainly is. But at the basis art is something completely different. The apprentice learns rules like iron laws - obey them or else! Once the apprentice has learned all the rules he becomes a journeyman. The journeyman knows all the rules and can skillfully apply them. He knows and understands that sometimes the rules seemingly contradict each other and can weigh their relevance against each other. With increasing understanding a "feeling" for what is "right" (or "correct" or "good", ...) develops and the journeyman ascends to the level of master. The master still follows the rules - not their extrinsic expression any more but their innate meaning. He might find ways to obey a certain rule in a deeper sense by contradicting it on a perfunctory level. Knowing how to do that - and do it for the desired effect - first needs the perfect understanding of the rules he is ignoring at some particular point. You "throw away the ladder" - but only after you used it to climb over and above it.

"CODE, CODE, CODE", as Neo suggested is very sound advice. Not because the world needs more code but because the world needs more good coders - especially to replace all the bad code that is already in place. The more you learn and exercise the application of the rules the faster your eye will develop that hard to describe "understanding of good versus bad" code.

There was an experiment about learning: they showed professional airplane pilots a picture of a cockpit in mid-flight for a very short time (2s) and asked them to tell if the plane was in trouble or not. Guess what, it is impossible to really read all the hundreds of displays in that time but still the pilots did it with a stunning rate of precision. They were not trained for that but they developed - simply by practice - the ability to discern what "looked good" from what "looked bad". This is called "pattern learning". An experienced programmer can tell you similarly at one glance if the program is written poorly or written well. He might not know if it contains some syntax error, but he will be able to judge the "overall structure" and with astonishing precision.

Sometimes you will come across old and wise UNIX guys (unlike me, i am only old) who will tell you this or this is "not UNIX-like" or "doesn't seem quite right" or something such. Listen to them. It is hard to explain these feelings like the pilots would have a hard time explaining why they thought something is wrong with the plane.

Finally, a last advice: learning from the masters only means copying them at first. Learning from the masters means using what they can teach you (so, yes, start by copying them) to form your own finally. Mozart didn't become Mozart by composing the same way Haydn or Bach did. In fact he did compose quite similar to these two in the beginning but then used what he learned to form his own genuine and singular style.

I hope this helps.

bakunin

Last edited by bakunin; 03-11-2019 at 11:15 AM..
These 2 Users Gave Thanks to bakunin For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Sort alpha on 1st field, numerical on 2nd field (sci notation)

I want to sort alphabetically on the first field and sort in descending numerical order on the 2nd field. With a normal "sort -r -n" it does this: abc ||| 5e-05 ||| bla abc ||| 3 ||| ble def ||| 1 ||| abc def ||| 0.2 ||| def As you can see it ignores the fact that 5e-05 is actually 0.00005... (1 Reply)
Discussion started by: FrancoisCN
1 Replies

2. Shell Programming and Scripting

awk, comma as field separator and text inside double quotes as a field.

Hi, all I need to get fields in a line that are separated by commas, some of the fields are enclosed with double quotes, and they are supposed to be treated as a single field even if there are commas inside the quotes. sample input: for this line, 5 fields are supposed to be extracted, they... (8 Replies)
Discussion started by: kevintse
8 Replies

3. Shell Programming and Scripting

AWK: Pattern match between 2 files, then compare a field in file1 as > or < field in file2

First, thanks for the help in previous posts... couldn't have gotten where I am now without it! So here is what I have, I use AWK to match $1 and $2 as 1 string in file1 to $1 and $2 as 1 string in file2. Now I'm wondering if I can extend this AWK command to incorporate the following: If $1... (4 Replies)
Discussion started by: right_coaster
4 Replies

4. Shell Programming and Scripting

Plz Help. Compare 2 files field by field and get the output in another file.

Hi Freinds, I have 2 files . one is source.txt and second one is target.txt. I want to keep source.txt as baseline and compare target.txt. please find the data in 2 files and Expected output. Source.txt 1|HYD|NAG|TRA|34.5|1234 2|CHE|ESW|DES|36.5|134 3|BAN|MEH|TRA|33.5|234... (5 Replies)
Discussion started by: i150371485
5 Replies

5. Linux

How do I format a Date field of a .CSV file with multiple commas in a string field?

I have a .CSV file (file.csv) whose data are all enclosed in double quotes. Sample format of the file is as below: column1,column2,column3,column4,column5,column6, column7, Column8, Column9, Column10 "12","B000QRIGJ4","4432","string with quotes, and with a comma, and colon: in... (3 Replies)
Discussion started by: dhruuv369
3 Replies

6. Shell Programming and Scripting

Command/script to match a field and print the next field of each line in a file.

Hello, I have a text file in the below format: Source Destination State Lag Status CQA02W2K12pl:D:\CAQA ... (10 Replies)
Discussion started by: pocodot
10 Replies

7. Shell Programming and Scripting

Display combination of 4 field uniqe record and along with concatenate 5th and 6th field.

Table ACN|NAME|CITY|CTY|NO1|NO2 115|AKKK|ASH|IND|10|15 115|AKKK|ASH|IND|20|20 115|AKKK|ASH|IND|30|35 115|AKKK|ASH|IND|30|35 112|ABC|FL|USA|15|15 112|ABC|FL|USA|25|20 112|ABC|FL|USA|25|45 i have written shell script using cut command and awk programming getting error correct it and add... (5 Replies)
Discussion started by: udhal
5 Replies

8. Shell Programming and Scripting

awk to adjust coordinates in field based on sequential numbers in another field

I am trying to output a tab-delimited result that uses the data from a tab-delimited file to combine and subtract specific lines. If $4 matches in each line then the first matching sequential $6 value is added to $2, unless the value is 1, then the original $2 is used (like in the case of line... (3 Replies)
Discussion started by: cmccabe
3 Replies

9. Shell Programming and Scripting

awk to update field using matching value in file1 and substring in field in file2

In the awk below I am trying to set/update the value of $14 in file2 in bold, using the matching NM_ in $12 or $9 in file2 with the NM_ in $2 of file1. The lengths of $9 and $12 can be variable but what is consistent is the start pattern will always be NM_ and the end pattern is always ;... (2 Replies)
Discussion started by: cmccabe
2 Replies

10. UNIX for Beginners Questions & Answers

Problem with getting awk to multiply a field by a value set based on condition of another field

Hi, So awk is driving me crazy on this one. I have searched everywhere and read man, docs and every related post Google can find and still no luck. The actual files I need to run this on are sensitive in nature, but it is the same thing as if I needed to calculate weighted grades for multiple... (15 Replies)
Discussion started by: cotilloe
15 Replies
All times are GMT -4. The time now is 03:27 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy