DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’»

Cover image for Frameworks hurt junior devs (and why math is important)
anes
anes

Posted on • Updated on

Frameworks hurt junior devs (and why math is important)

Introduction

A debate as old as coding itself:

"Math is rudimentary for coding!"
"No, it's not, you just enjoy it and try to force it on us!"

While yes, I do enjoy math, I also recognised its importance in coding, or rather its importance in understanding coding. A pattern you may have recognised when reading through my articles is, that they are all about writing code which you would normally not even think about, but rather just use a framework or library for.
Exactly that shift from coding to using frameworks that do most work for you, is something we are experiencing in the world of software development and it's hurting junior devs. While yes, production code should be written in frameworks and libraries to improve its sustainability and often also its security, a lot of new developers have never learned what exactly is being done behind all that "framework magic" as I like to call it.

Examples

I can't just throw this out there without situations and anecdotes to back it up too, so that's what this part is about.

Drawing a line from A to B

The first time I recognised this problem is when I had to draw a line between two points that could be placed completely randomly. The project (you can look at here, instructions and location are in the readme) was for a course mixing math and IT. My teacher gave me the task to "write a program that makes it able for me to draw dots, connect them with lines of a weight I choose and then the code searches for the minimal spanning tree. If I click the lines I should be able to change their weight".
Now what is step one, when implementing that? Making it able for the user to draw dots and connect the lines. And how do you calculate the line between those two dots? Give it a thought before you read the next part.
Trigonometry and Pythagorean's Theorem could be a very useful tool. If you had that thought, it was (obviously) because you know the math to approach problems like these exists. If the problem was a different one maybe you don't know the math and because it is such a specific task you also won't find any good sources to it.
How did I solve that problem? Every time a user creates a line between two dots, my code plots a triangle, where the created line is the hypothenuse and draws it. Here is the code, if you are interested.

Making AI with TensorFlow

The example above perfectly demonstrated how a lacking understanding of math can be harmful, but what's the case with frameworks? They have a similar issue. When I started doing coding and research on it outside of school, one of my first goals became to write some code that included the use of AI, so I went to learn AI. I started off with a freeCodeCamp seven hours course, hoping I could make AI when I'm done following that tutorial. I was completely wrong. I just followed the steps, did whatever they did and made some very simple AI. When I then tried using that knowledge on my own case, I quickly realised that I have no idea how to do that. And not to mention, every time I had a problem the guy from the tutorial didn't have I would search for hours to solve it. Simply put: I wrote words, neither understanding the sentences they made nor the letters that were used.
The truth was: I was lacking an understanding of the math behind Artificial Intelligence and wanted to directly start coding.
To fix this I started off watching tutorials on the math, learned basic calculus and wrote a copy of the Perceptron in JavaScript. The first article I wrote was about that.

How (not) to store passwords

My last and probably biggest example of this is my own article: How (not) to store passwords. The article talks about storing passwords the wrong and right way. While I have never used that knowledge in the real world, that knowledge gives me the power to wield tools like BCrypt and Devise to do those tasks. And then when I do need something more than what a framework has to offer, I could even fork it and write the function I want myself, because I know how to do it on this level.

Knowing when to stop

I know, I was so persuasive with my last chapter, that you already got together raw ores to build your own PC, but that's not what this is about. While I think it is important to take a step back and also understand what is happening in the background it's even more important to know when that step back was big enough, and when to even take back a step. It is a great way to learn coding and build an understanding for it, but it trades off production speed. Writing a neural network where you create all neurons, their weights and all the needed functions will cost you a lot of time and probably also code efficiency, so you should probably let frameworks do it for you when the project is of commercial and not educational nature. And even if it is educational, the step back should be educative and not just a waste of time. Obviously you could write an API-backend in frameworkless C, but the focus lays on Artificial Intelligence and the API is just a way for you to communicate with the code you wrote.

And what do you want me to do?

Instead of just jumping right into "Creating a chatroom with ReactJS and Firebase", why don't you try creating your own backend with a language where you have to write a lot by yourself, like SpringBoot and do the user auth without a library, or maybe even go without an ORM and write the SQL yourself. Yes, it will be slower and yes the security will be pretty bad, but when you write the next application that is based on libraries, you will have an easier time debugging and adding features on top of your framework.

Conclusion

I believe we should stop just frantically using a framework and a library everywhere we can, but maybe just try to do something ourselves and earn knowledge which we will use our entire life in the process. If you are interested in the magic behind frameworks you should definitely read through my other articles.
Thanks for reading and happy hacking!

Top comments (14)

Collapse
 
wadecodez profile image
Wade Zimmerman

You can get pretty far in code without needing to understand the underlying principals of mathematics. My weakness has always been calculus but I've been exposed to enough math that I can glance at a expression and know Greek letters like Sigma and Pi are the equivalent of for loops.

For all the other hieroglyphic symbols I just use Google to lookup references like the one on Wikipedia to translate math into code. Kinda of like a modern day Rosetta stone.


IMO writing a lot of math is code smell and probably an indicator that you're overthinking/over-engineering. Odds are, there is already a library that does the exact same thing but better.

Collapse
 
aneshodza profile image
anes

I have to agree on that, writing math is often unnecessary and libraries solve that often times. My point is that having an understanding of how the libraries work make you a more well rounded software developer, which knows how to build on top of libraries and also fix errors that came up while building on top.
For the "just look it up part" it's not always possible to do so. Sometimes you just face a problem or something you need to implement, where no one has given you a mathematical expression and those are the cases I'm referring to. Having a good intuition for math and problems gives you the ability to come up with a solution (or formula), which you can then look up and convert into code.

Collapse
 
theaccordance profile image
Joe Mainwaring • Edited on

This is the second post I’ve read in the last week downplaying frameworks.

I do have to respectfully disagree with the premise. I agree that there is value in junior devs learning and building at a lower level, but many frameworks are a lot like Icebergs
Image description

Our criticism tends to focus on what’s most apparent as we use these tools, but it often overlooks a great deal of minor things that can suck up enormous amounts of time for your junior devs if they have to implement those pieces themselves.

Perhaps you want your devs to know that stuff, but me? I want my devs accelerating the growth of my business, and that means shipping in a timely manner. Ultimately, that’s what frameworks provide: accelerated development.

Collapse
 
aneshodza profile image
anes

Thanks for the comment! As I mentioned above, not using a framework "will cost you a lot of time and probably also code efficiency, so you should probably let frameworks do it for you when the project is of commercial and not educational nature". I agree with you when you say that in a commercial environment frameworks have to be used, but what I am trying to tell with my quote and this post in general is, that all of those little project that many junior devs build to get a good feeling for coding should focus on the educational part and not to get stuff done quick.

Collapse
 
theaccordance profile image
Joe Mainwaring

That’s a fair point, although my own learning track for beginners is different.

I do a lesson on bare bones but don’t get overly detailed with it, and then shift to a RTFM mentality with frameworks. But I will concede I have a clear difference in goal than you: I’m trying to get people placed in jobs quickly.

Thread Thread
 
aneshodza profile image
anes

I think your goal of getting a job as quick as possible is also necessary for many people. I come to the IT from a different background: With 15 I started a four years long education as a software developer. I have a lot of time that I can spend on learning instead of earning money. If someone comes from working another profession and needs to feed himself or his family I think the quick approach is the correct one.

Thread Thread
 
theaccordance profile image
Joe Mainwaring

Very true! When your academic path is longer, you can afford certain liberties!

There’s certainly no one right answer here given development is such a broad category of professionals, and then of course there’s also the hobbyist audience.

Thread Thread
 
aneshodza profile image
anes

Agreed

Collapse
 
mellen profile image
Matt Ellen

I'm all for learning about what frameworks are actually doing, so I'm fully in agreement with your approach.

I'm not sure I understand your first example. Why do you need to know the length of the line to draw the line? Did you need to plot the individual pixels?

Collapse
 
aneshodza profile image
anes

No, I just needed to draw the line. But to do that I needed the angle with which I had to draw, and the length of the line which had to be drawn.

Collapse
 
mellen profile image
Matt Ellen

I see. I've not encountered a drawing system that doesn't take the two coΓΆrdinates and draw a line. What were you using to draw the line?

sorry, I'm just very curious

Thread Thread
 
aneshodza profile image
anes

I had to create a new html element in the DOM, because of what my teacher said it would have to be able to do in the near future. Dw abt it, I'm happy to clarify!

Collapse
 
uzair004 profile image
Muhammad Uzair

Not learning math is biggest hole in my heart as programmer, even though I am doing good as programmer from a year.
But understanding math give you so much power, like I cannot choose any of future tech (AI, ML, Data Science, Blockchain) because of math dilemma.

Planning to start again from school level, but that will take me a lot. Plus these days you have to choose between being introvert and hard working programmer or market yourself with not much.

Collapse
 
aneshodza profile image
anes

I think you would benefit by educating youself on some basic math topics. When you try to step up to the complicated stuff (like AI and blockchain as you mentioned) it gets more and more complicated. With a missing foundation in math it will be hard to move onto subjects like those

Tired of sifting through your feed?

Find the content you want to see.

Change your feed algorithm by adjusting your experience level and give weights to the tags you follow.