DEV Community

Ben Halpern
Ben Halpern Subscriber

Posted on

Which programming language/environment is more “powerful” than people realize?

What software tool can do more than people realize or give it credit for?

Oldest comments (83)

Collapse
 
restoreddev profile image
Andrew Davis

Might be too mainstream of an answer, but I still get surprised sometimes about what CSS offers without needing JavaScript. Animations/transitions can all be written without the need for JS. New features like variables, flexbox and CSS grid are making CSS even easier to use.

The combo of HTML/CSS is what has made the web so enduring and durable. It is why so many technologies are now "Make desktop apps with HTML/CSS" (Electron) and "Make mobile apps with HTML/CSS" (React Native, Ionic). HTML/CSS is just one of the best ways to make a solid UI.

Collapse
 
jrioscloud profile image
Jaime Rios

I feel this many times when I see animations that CSS can handle made with JavaScript.

Collapse
 
tmcsquared profile image
TMcSquared

CSS Grid is awesome!

Collapse
 
belinde profile image
Franco Traversaro

Any language. People usually critics a language without really knowing it, and any language has some features really outstanding compared to competitors.

Collapse
 
oathkeeper profile image
Divyesh Parmar

Do you know Reddit is built on Python I mean its backend is completely in Django and pure Python.

Collapse
 
iandavid profile image
David Okpare

I believe JavaScript is very powerful. It's not limited to just the front end, but also the back end. And the multiple frameworks it's possesses makes it way more advantageous compared to some other programming language. Although many feel like Python is the Thanos of programming, but forget that the trendy stuffs are also on JS i.e Tensorflow and Machine Learning

Collapse
 
jj profile image
Juan Julián Merelo Guervós

You probably expected this, but I'm gonna say Perl 6. Released two years ago, it's an incredibly expressive and powerful language, which includes all major paradigms: object-oriented, functional, concurrent. It's got peerless Unicode support, and a small, but welcoming and helpful community. You should definitely give it a try, whether you want to learn a new language, or want to look at a full-featured 21st century language.

Collapse
 
rrampage profile image
Raunak Ramakrishnan • Edited

Not a software tool, but a notebook. Writing what you are going to code/design has saved me countless times. Some "easy" problems turned out to have a lot of edge cases, some hard problems became much easier to approach when I wrote down what made them hard.

Diagrams are far easier to draw on paper. Drawing data structures and flows makes it easier to debug edge cases. Drawing system diagrams helps to identify possible bottlenecks while scaling or possible points of failure.

Also, the notebook doubles down as a To-do list. It is a lot more satisfying to cross-out a task physically than in any app. And it always stays on my desk so there is no question of closing the tab / forgetting to update it.

Most importantly, you can flip through it and have a look at why you made some decision while coding or designing. Also, you can draw doodles when bored :)

Collapse
 
codemouse92 profile image
Jason C. McDonald

Yes! Paper forever!

Collapse
 
cathodion profile image
Dustin King • Edited

I came here to say this. Paper is the best. It helps you see the forest for the trees, and get unstuck.

And it never crashes unless you get it too hot.

Bullet journalling is also a great way to get your thoughts out.

Collapse
 
tmcsquared profile image
TMcSquared

It tends to char a little when you get it too hot though. ;)

Collapse
 
cjbrooks12 profile image
Casey Brooks

Even better, IMHO, is a whiteboard. It's so easy to throw ideas on a whiteboard, and then erase/rewrite over several iterations. When you're done, just snap a pic to archive it.

Collapse
 
valentinpearce profile image
Valentin Pearce • Edited

I like paper beacause I can carry it arround and keep working on it but when I can I use a whiteboard. What I like about the whiteboard is that you can literally step back and have an overview which can help when you're stuck.

Thread Thread
 
juz501 profile image
Julian Chan

I use both paper and whiteboards, for those separate purposes as well.

Collapse
 
sudiukil profile image
Quentin Sonrel • Edited

I kinda agree with this, but I think paper is good mostly for drafts because it can quickly become a huge mess when you have a lot of changes to make, especially on diagrams. Plus it's hard to backup and share paper.

And that's not environment friendly ;)

Collapse
 
jsn1nj4 profile image
Elliot Derhay

And about To-dos, at least where I work, it was possible to repeat a to-do multiple times in the same notebook and lose others if tasks got interrupted by other tasks (which used to happen much more frequently than it does currently).

 
oathkeeper profile image
Divyesh Parmar

Yeah they get so much edgy & harsh, they really need strict moderation sometimes. And the thing they do is they always harmful to others

Collapse
 
djviolin profile image
István Lantos • Edited

AWK

It can do anything with delimited data tables with millions of rows in a few lines of code, as fast as a Go, C counterpart program.

In Python you need to write lots of lines, use third-party libraries to normalize columns with regex, dropping rows, etc. In AWK, it's just a one liner, or you can write it in an *.awk file as well.

AWK is a secret gem for dealing with big data.

Update:

I share my AWK script where I normalize a millions of lines long delimited CSV table only with AWK, as fast as a Go counterpart program:

#!/usr/bin/awk -f

# This block only runs once at the start, before the first line
# Use this to print CSV header on the top
BEGIN {
    FS="|"; # input field separator
    OFS="|"; # output field separator
}

# This block runs at every line
{
    # We will order a new named variable to every column
    line = $0; # variable `$0` stores the entire line
    url = $1;
    title = $2;
    body = $3
    tags = $4;

    if (line ~ /^$/) next; # if line is blank, then skip it
    if (NF != 4) next; # if column count is not equal to 4, then skip the line

    # Skip any line where tags column contains the word "cars"
    if (index(tags, "cars") != 0) { next; }

    # Normalize the url column with regex by only keeping the article id
    # Example input: <a href="https://example.com/article/foo123456">Hello</a>
    gsub(/.*example\.com\/article\/|[\042].*/, "", url); # outputs: foo123456

    # Skip lines that has non-alphanumeric characters in url column (like <>#&@)
    # Skip lines that has empty url column (after gsub normalization)
    # Skip lines where url starts with foo or bar
    if (url !~ /[[:alnum:]]/ ||
        length(url) == 0 ||
        url ~ /^foo|^bar/) {
        next;
    }

    # Replace multiple ; with one (needed for errorless CSV import in Postgres)
    gsub(/[\073]+/, ";", tags);

    # Print the line with OFS, aka: profit! :)
    print url, title, body, tags;
}

Collapse
 
dmerand profile image
Donald Merand

100% agree, I love awk and use it all the time! Also: combining AWK with the other UNIX utilities such as cat, sort, uniq etc.

Have you ever read Ryan Tomayko's AWK-ward Ruby? I didn't realize that Ruby had inherited so much from AWK, but it makes me happy as a Ruby user.

Collapse
 
joshcheek profile image
Josh Cheek

I'm going to put Ruby under this one, as well. Ruby inherited a ton of Perlisms that make it competitive with Perl, awk, and sed for these types of use cases. But they're really underused Eg the following flags are all relevant here: n, p, e, i, l, a, s, 0, c, F, and the 2-letter globals ruby -e 'puts global_variables.grep /\$.$/' and BEGIN { ... } and END { ... } and ARGF and flip flops (which most people don't even know exist), and regex literals in conditionals, and the private methods that are added to main when -n and -p flags are set. IDK, probably other stuff, too, that's all off the top of my head.

Collapse
 
ben profile image
Ben Halpern

This comment really sums up Reddit on many levels. Python is one of the most important languages of all time and is remarkably powerful.

Collapse
 
ben profile image
Ben Halpern

Can you give me a quick overview of Prolog and some example use cases?

Collapse
 
elmuerte profile image
Michiel Hendriks • Edited

In Prolog you define facts. Like

is_dev('Ben').
fullname('Ben', 'Halpern').
fullname('Michiel', 'Hendriks').

Which you can then query:

?- is_dev(N), fullname(N, 'Halpern')

Which can be "unified" (i.e. a solution) exists. The first answer to the solution is N='Ben'

The facts you define can also be queries.

dev_fullname(FirstName, LastName) :-
    is_dev(FirstName), fullname(FirstName, LastName).

Which allows me to query on either first name or last name like:

?- dev_fullname('Ben', LastName).
LastName = 'Halpern'

?- dev_fullname(FirstName, 'Halpern').
FirstName = 'Ben'

But dev_fullname('Michiel', _) produces no result, because I didn't state the fact I was a dev. (Note, _ is an anonymous variable, which will simply be discarded.

One of the other big features of Prolog is how it handles list.
Below is the typical check if an element is a member of a list:

member(X,[X|_]).
member(X,[_|T]) :- member(X,T).

The first fact says that the result is true if X is the head of the list (second argument).
If the first fact is not true, it will try the second fact. There is queries member again. But drops the head of the list.

Now a fun thing. If you want to iterate over all members of a list. You can use the same fact.

?- member(N,[1,2,3,4,5])

This produces 5 results for N. And if you just want want the numbers higher than 3

?- member(N,[1,2,3,4,5]), N>3

which produces 2 results, N=4 and N=5.

Collapse
 
dmerand profile image
Donald Merand

It's not quick, but I just ran into the Power of Prolog which does a good job of making the case :)

Some comments may only be visible to logged-in visitors. Sign in to view all comments.