Skip to content

Latest commit

 

History

History
562 lines (380 loc) · 22.2 KB

File metadata and controls

562 lines (380 loc) · 22.2 KB

Programming

Languages

  1. Bash - the gold standard for shell scripting
  2. Python - general purpose object oriented language, easy to write, widely used but hard to maintain due to environment differences, language and library changes over time
  3. Golang - imperative compiled self-contained binaries, simple toolchain, smashes Python in portability, maintainability, build time etc.
  4. Perl - fast to write imperative code, stable, the gold standard for regex string processing, works everywhere and doesn't break every few years like Python
  5. Groovy - a better version of Java, with interactive REPL and some language construct conveniences. Hard to want to write in Java again after getting spoilt by Groovy
  6. Java - battle tested, but slower to develop in than the above languages
  7. Scala - was supposed to be the next Java but wasn't
  8. Kotlin - another next Java, we'll see
  9. Clojure - another JVM language
  10. R - old data analytics languages, matrices, awkward, but widely used and lots of libraries
  11. Expect - an extension of the Tcl language specialized in interactive text interface automation and keystroke control
  12. HTMX - :octocat: bigskysoftware/htmx - power tools for HTML

Beware the "Hello World"... see this meme further down.

Expect

Excellent TCL language framework for automating systems which have no alternative but interactive timed text inputs.

Autoexpect - generates an expect script from an interactive session, tune from there

Expect has libraries in most languages.

For example, used Perl's Net::SSH::Expect library to test iDRAC and iLO controllers in check_ssh_login.pl

Add this to the top of an expect script to debug output:

exp_internal 1

Free Programming Courses

You are limited only by time and effort.

https://www.digitalocean.com/community/tutorials/gangs-of-four-gof-design-patterns

Testing

See Testing

Code Pastebin Sites

If you need to share code privately or publicly to ask for help, you'll need a Pastebin site, se the File Upload & Code Pastbin Sites doc.

Big O Notation

Big O Notation

Count Lines of Code

cloc

:octocat: AlDanial/cloc

Counts lines of code vs comments vs blanks.

Install on Mac:

brew install cloc

Install on Debian / Ubuntu:

sudo apt install cloc

Run it against a directory of code to count the lines of code:

cloc /path/to/git/checkout
cloc ~/github/bash-tools
github.com/AlDanial/cloc v 2.02  T=3.16 s (1084.1 files/s, 260706.2 lines/s)
---------------------------------------------------------------------------------
Language                       files          blank        comment           code
---------------------------------------------------------------------------------
JSON                              33              5              0         528324
Bourne Shell                    1594          26338          38702          70205
YAML                             885           6568          29712          41929
HCL                              192           3965           4595          16567
Markdown                          70           3964            321          13016
Text                              56            323              0           5004
SQL                              233            862           5533           4182
Groovy                           140            924           4122           3933
Bourne Again Shell                97           1219           3904           2337
XML                               24              9              9           1490
make                              21            352            373           1320
INI                               12            148              0            804
Maven                              1             62             68            342
Python                             7            108            401            235
Perl                               5             67             74            230
m4                                 5             55              3            216
Go                                 1             12             20             97
Ruby                              13             16            247             81
Dockerfile                         1             66            181             78
Properties                         8             54            133             77
Java                               4             31             54             63
Scala                              4             27             69             42
Gradle                             2             13             60             39
Jinja Template                     1              2              0             33
JavaScript                         3             31            152             30
Expect                             2              5             15             22
Puppet                             3              7             61             20
ASP                                1              4              1             11
SVG                                6              0              0              6
C                                  1              3              6              3
zsh                                1              1             13              3
PHP                                1              3              6              2
DOS Batch                          1              2              5              1
Visual Basic Script                1              3              5              1
Pig Latin                          1              2             14              0
---------------------------------------------------------------------------------
SUM:                            3430          45251          88859         690743
---------------------------------------------------------------------------------

Script in DevOps-Bash-tools to count lines across all public original GitHub repos:

github_public_lines_of_code.sh

scc

:octocat: boyter/scc

Counts lines of code and cocomo man effort estimate.

Install on Mac:

brew install scc

Linux - not in Apt yet, so you'd need to install it the Golang way:

go install github.com/boyter/scc/v3@latest

Run it against a directory of code to count the lines of code:

scc /path/to/git/checkout
scc ~/github/bash-tools
───────────────────────────────────────────────────────────────────────────────
Language                 Files     Lines   Blanks  Comments     Code Complexity
───────────────────────────────────────────────────────────────────────────────
Shell                     1391    113237    19013     32719    61505       9083
YAML                       122      7543      464      1858     5221          0
Plain Text                  43      4291      257         0     4034          0
BASH                        16      1299      218       625      456         98
JSON                        12      7572        5         0     7567          0
Markdown                    12      3725      650         0     3075          0
Groovy                       7       198       22       156       20          0
XML                          6       358        0         0      358          0
Zsh                          5       294       58       200       36          4
Properties File              3        45        9        21       15          0
License                      2       287       45         0      242          0
Makefile                     2       466       92        51      323         22
Autoconf                     1       865      143        95      627         78
Bitbucket Pipeline           1        38        5        24        9          0
Docker ignore                1      4007     1022      1528     1457          0
Gemfile                      1        33        6        23        4          0
Python                       1        43        1        20       22          0
Ruby                         1        31        1        24        6          0
SQL                          1        21        2        15        4          0
Vim Script                   1       796       98       251      447         28
───────────────────────────────────────────────────────────────────────────────
Total                     1629    145149    22111     37610    85428       9313
───────────────────────────────────────────────────────────────────────────────
Estimated Cost to Develop (organic) $2,882,541
Estimated Schedule Effort (organic) 20.57 months
Estimated People Required (organic) 12.45
───────────────────────────────────────────────────────────────────────────────
Processed 4611424 bytes, 4.611 megabytes (SI)
───────────────────────────────────────────────────────────────────────────────

There are also badges which you can see applied on my GitHub profile.

Tokei

:octocat: XAMPPRocky/tokei

brew install tokei
tokei .

Memes

Hello World

Printing Hello World

Program in Tutorial vs Made Following Tutorial

Program in Tutorial vs Made Following Tutorial

Resolving Broken Dependencies

Resolving Broken Dependencies

Practice

Practice

Butting Head Against A Programming Problem

Butting Head Against A Programming Problem

Documentation

The importance of documentation:

There's No Documentation - The Code is the Documentation

Poking the Hornets Nest

Poking the Hornets Nest

Run It Again

Every one of you engineers has done this…

Don’t pretend you haven’t !!

Run It Again

Like Coding, Good at Math

Not any more 😭

Like Coding, Good at Math

Software Development Process

How many times have you tech bros questioned your life choices?

Be honest now…

Software Development Process

Coding in Depth

Coding in Depth

Pretending You Know Every Programming Language

Pretending You Know Every Programming Language

Are You Really Sure You Want to be a Software Developer??

People Who Sell vs Build Software

Coding with GPT

Watch out for that quality and not knowing WTF you're doing!

Coding with GPT

Senior Devs Fixing Bugs in Production

Senior Devs Fixing Bugs in Production

Theory vs Practice

I suspect this is only when recruiters try programming... 😉

When Recruiters Try Programming

Concurrent Programming

Concurrent Programming Sleep Statements

Meme Driven Development

Meme Driven Development

OverEngineering Simple Solutions

OverEngineering Simple Solutions

Hating on Languages You Don't Use

Hating on Languages You Don't Use

H8 PHP Range Rover

Hate PHP... but PHP paid for the Range Rover...

H8 PHP Range Rover

C++ for Python Developers

C++ for Python Developers

Hell is Debugging Other People's Code

Or even your own code from a while ago if you haven't written it carefully and commented any fancy tricks (avoid using fancy tricks).

This is at best janitorial work.

Hell is Debugging Other People's Code

Programmer Sleep Coding

The number of weekend mornings I’ve woken up and jumped straight on the computer for my girlfriend to ask what I’m doing, and then I have to explain I’ve been stuck in a coding loop half the night and need to write this sh*t down to get rid of it...

Programmer Sleep Coding

Developers at Beginning vs End of of Project

Developers at Beginning vs End of Project

When You Decide to Share Your Pain With Users

Password Typed Too Quickly

The DevOps Guide to Dealing with Management

DevOps Guide to Dealing with Management

The Hungry Developer

Hungry Developer

The Mobile Developer

The loyalty of a cat watching you get axed murdered...

Given the average tenure in Tech is ~18 months... you think you have time to train guys up?

This is why companies hunt for seniors instead of saving money on juniors at the expense of 2-3 years of training them up to proficient level only for them to leave for another company to reap the benefits...

Mobile Developer

The Desert Developer

Desert Developer

The Lead Developer

Lead Developer

The Lone Wolf Developer

Aren't you lucky this isn't me...

Lone Wolf Developer

Bash Scripting: Essential DevOps

Bash Scripting: Essential DevOps

Writing Code That Nobody Else Can Read

Pull Request reviews are here to preven this...

Writing Code That Nobody Else Can Read

Removing Code & Hoping Nothing Breaks

Removing Code & Hoping Nothing Breakts

Hype Driven Development

Hype Driven Development

Whitespace Wars

Whitespace Wars

Heroes & Villains of Software Development

Heroes & Villains of Software Development

Will Not Fix Your Computer

Many of you will want to send this to your relatives:

Not Fix Your Computer

Programmer Interview - Can You Work Under Pressure

Programmer Interview - Can You Work Under Pressure

How It Feels Being A Programmer After 30

How It Feels Being A Programmer After 30

When You Copy Parts of Your Code from Stack Overflow

When You Copy Parts of Your Code from Stack Over

Me When Code Works as Intended

Me When Code Works as Intended

When You're Thinking About That Code You Wrote Last Night

When you’re thinking about how to improve that code you wrote last night… 😂

When You're Thinking About That Code You Wrote Last Night

Vibe Coding, Vibe Debugging

Vibe Coding, Vibe Debugging

Assembly

Assembly

C for the Brave and Foolish

C for the Brave and Foolish

Built Same Project in Multiple Languages

Built Same Project in Multiple Languages

Pretend to be a Good Programmer

Pretend to be a Good Programmer

Programmers Then vs Now

Programmers Then vs Now

O'Reilly - Vibe Coding

O'ReillyVibe Coding

Rock Star Developer

Rock Star Developer

Ported from various private Knowledge Base pages 2008+