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 (16)

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
 
incrementis profile image
Akin C.

Hello anes,

thank you for your article.
I enjoyed reading it with controversial emotions and thoughts.
Kudos for that, as this might be a good way to start discussions.

I would say not everything needs math in programming and it's fine if someone wants to specialize in less math oriented programming.

I agree with you that understanding a framework in detail can help tremendously, but to be realistic we can't learn everything about some frameworks and hence the time we want and have to spend should be well thought out.

Collapse
 
aneshodza profile image
anes

Obviously you can be a good programmer, even without understanding what's happening under the hood. The issue with that is, that you are building a house on top of a shaky foundation. As soon as you try to venture into more complex topics (blockchain, AI, security etc.) you lack necessary knowledge to learn those topics.
And yes, I also agree with your point on "we can't learn everything about some frameworks". I also use next and solid start without understanding a lot of the "magic". But then, when I need more complex stuff, I can always return to rails, where I understand a lot more of what is done how. I feel like that makes you more able to fix bugs.

Collapse
 
theaccordance profile image
Joe Mainwaring • Edited

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