<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Yjakse on Medium]]></title>
        <description><![CDATA[Stories by Yjakse on Medium]]></description>
        <link>https://medium.com/@yjakse789?source=rss-58ae641ef14f------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*QBGDYk9_7aZfaA6B</url>
            <title>Stories by Yjakse on Medium</title>
            <link>https://medium.com/@yjakse789?source=rss-58ae641ef14f------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 07:19:26 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@yjakse789/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Flask, SQLAlchemy, RESTful, and why you shouldn’t learn all of them at once.]]></title>
            <link>https://medium.com/@yjakse789/flask-sqlalchemy-restful-and-why-you-shouldnt-learn-all-of-them-at-once-07f14d27e9cd?source=rss-58ae641ef14f------2</link>
            <guid isPermaLink="false">https://medium.com/p/07f14d27e9cd</guid>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Yjakse]]></dc:creator>
            <pubDate>Mon, 16 Oct 2023 23:05:56 GMT</pubDate>
            <atom:updated>2023-10-16T23:05:56.756Z</atom:updated>
            <content:encoded><![CDATA[<p>Hi, its me, that person that complained about React and tried dissecting Python. If you don’t know who I am, don’t worry, it doesn’t matter here, because this blog is mostly going to be a definition of these three items above all, as dissecting one requires dissecting all three, and I’m not up for that again.</p><p>We shall start from the top, with Flask, the core of this whole system. Flask is the framework used for web development in Python, basically its the thing that makes it so you don’t have to worry as a programmer about many small, low-level items to get your code to work, Flask will handle it. An Example of these low-level items is something like thread management, a very critical process to get processing done, but not something you want to worry about every time you design a new web page.</p><p>As part of actual programmatic usage, you will likely see imports from Flask like make_response, request, and Flask itself. If you notice, that&#39;s the framework, input data, and output data for webpages, things that if you don’t have your webpage is at best uninteractive, and at worse, completely dysfunctional.</p><p>Moving on from Flask, we have SQLAlchemy, its defined as the Python SQL toolkit, and it has a lot of cool things, like ORM as an example, and when used in conjunction with Flask and its extension Flask-SQLAlchemy it can be used as the database for it, with surprisingly few lines, you can have a complicated multi table relationship all being displayed in a web page. SQLAlchemy like most forms of SQL is a back-end database, it holds whatever data you need it to in a table like format, only issue is ensuring you used the right syntax to designated types of data, and other things about the table, but once that&#39;s all down, it makes life rather easy, you don’t even have to bother converting data you bring down from the table.</p><p>Moving from the database to what is done with that data, we have Flask-RESTful, the best joke I can come up with is how much it lets you just rest, because loads of the unneeded typing is done away with another import and proper application. Without RESTful you have to mess around with app.route(), and define a function within it to all you need done, but with RESTful all you need is an api.add_resource() function call and boom, now you can make standard C.R.U.D. requests to that url.</p><p>Alright, so I have gone through all three of the subjects of this blog, so why do I think you shouldn’t learn them together? Simple, have you ever tried to read someone elses code? This may just be me, but when looking at these extensions that people have made, and with just how many are needed to make everything work seamlessly, they move beyond just being extensions, the entire time I was learning all three it felt like I was learning a new language with this veneer of Python, instead of treating them the way they are, a bunch of extensions. If you are still rather fresh to coding, then having all of these things dropped on you, it can be painfully overwhelming, and it really took me some time to pick through all three and put together just what each extension was actually doing. And in truth, thats what helps me, and likely most people code best, actually understanding what they are doing instead of just copy pasting stuff they knew work before.</p><p>As an example I can still recall certain languages and the way to go about writing in them, but for this trio of extensions, and honestly for most extensions it feels like I have to keep double checking the documentation. Speaking of documentation, because I associated them as all the same thing, I kept googling for Flask when running into SQLAlchemy errors, and it made me feel rather incapable, when in reality I was just searching for the wrong thing.</p><p>If it turns out you don’t have a choice in the matter, and you have to learn all three at once, I hope this blog has helped somewhat, and if you run into errors, make sure to check where you are importing the thing you are having an issue with from, it will tell you which extension’s documentation you should actually check to fix the error. If you don’t have to learn all three at once, then before learning each one, make sure you have a firm grasp of what it specifically is meant to do before moving to the next extension.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=07f14d27e9cd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mild digging into Python Properties]]></title>
            <link>https://medium.com/@yjakse789/mild-digging-into-python-properties-cad4949c3118?source=rss-58ae641ef14f------2</link>
            <guid isPermaLink="false">https://medium.com/p/cad4949c3118</guid>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Yjakse]]></dc:creator>
            <pubDate>Tue, 26 Sep 2023 12:55:19 GMT</pubDate>
            <atom:updated>2023-09-26T12:55:19.807Z</atom:updated>
            <content:encoded><![CDATA[<p>If your learning Python and have had to work with objects, then odds are you have had to use the decorator @property, but don’t fully understand everything behind how it works. If that&#39;s the case then you are in the same boat as me, I mean, how does it even work? It can seem to be undefined but still reference other decorators that are defined, like @x.setter for example.</p><p>To start, lets talk about the decorator itself, @property, you have likely heard decorators described as “syntactic sugar” but it doesn’t really touch on what its doing. Every decorator merely acts as a wrapper for the function below it, surrounding it with some specific actions to be ran before and/or after the function, at the end of the day all decorators stripped to the base looks like this:</p><pre>@exampledec<br>def examplefunc():<br>  pass<br><br>#same as:<br><br>def examplefunc():<br>  pass<br>examplefunc = exampledesc(examplefunc)</pre><p>This is where things get interesting, for most decorators they are simply functions that take in a function, but for @property, its a bit different because their is no function property, instead property is a class. What this means is that instead of passing a function to another function, we are passing a function to a class to form a new object. Even more interesting is how this object is absurdly dynamic, after being formed once that single object will be used for all attributes across that entire class. Part of the way it can do this is because the object itself doesn’t handle data, all it handles is methods.</p><p>Here is an example:</p><pre>@property<br>def name(self):<br>  return self._name<br><br>@name.setter<br>def name(self,name):<br>  if not hasattr(self,&quot;name&quot;):<br>    self._name = name</pre><p>This simple example makes sure that the name value isn’t changed after being set.</p><p>The property object modifies the normal object methods of __get__, __set__, and __delete__, it will then run them as though they are unchanged until the return, where instead of returning the value directly, it will put it through the checks of our .getter, .setter, or .deleter, and if there are no checks that we have implemented, then it continues as normal.</p><p>The far more interesting part to me is how it seems to be constantly changing the checks, as mentioned above, our object is only made once, and handles methods not data, how could it possibly know when and for what its suppose to change the checks for? This is where we leave the less concrete and enter the more speculative, I didn’t program Python, so I can’t say for certain, but from what I can tell the property object has several values that are set to None on its start up, and there seems to be placeholders for functions, but as part of all three main methods, they make a new object of the property class, where one of these placeholders instead become the passed in function for that method.</p><p>By this point, I can’t dig much further, I am to far of a novice at Python to fully grasp what&#39;s happening, but in the end it has taught me quite a lot of interesting things, and if nothing else understanding the system I’m working with just that bit more helps a great deal in my use of that system, and I hope it has helped you too.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cad4949c3118" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Pessimistic Introduction to React]]></title>
            <link>https://medium.com/@yjakse789/a-pessimistic-introduction-to-react-4380cdb09334?source=rss-58ae641ef14f------2</link>
            <guid isPermaLink="false">https://medium.com/p/4380cdb09334</guid>
            <category><![CDATA[technology]]></category>
            <dc:creator><![CDATA[Yjakse]]></dc:creator>
            <pubDate>Wed, 06 Sep 2023 14:31:11 GMT</pubDate>
            <atom:updated>2023-09-06T14:31:11.263Z</atom:updated>
            <content:encoded><![CDATA[<p>Do you like JavaScript? Do you think that its syntax is simple, understandable, and very logical, but just wish it was a little less repetitive? Well it sounds like you are looking for React, a program designed to streamline the process of web development, and is considered to be very fast due to the way it renders content.</p><p>As some basics, let me explain an important part of React, Components and Props. Components are functions that return JSX, or for our purposes consider it HTML with extra functionality. Props are like HTML Attributes that the Component can read, and they can be exactly like HTML Attributes, or they can pass some data, or function that will be used by the Component for some normal JS scripting.</p><p>Now the main issue with jumping straight into React after JavaScript is its syntax. React is this bizarre hybrid of JS and HTML, with out rewriting the entirety of either. This means that most syntax of JS and HTML works in React, with the exception of anything react brings to the table. My favorite example of this is useState()</p><pre>const [state,setState] = useState(&quot;Initial Value&quot;)</pre><p>If you have never touched React, and this is the first thing you are seeing from React, you are probably scratching your head, as in, “Hold on, what is even happening? The name of a constant is an array?”</p><p>I will be honest with you, it doesn’t make much sense, and unfortunately, much like a lot of things with React, you will have to accept that it makes no sense and deal with it. With that being said, useState() is very useful, it works sort of like a variable, storing data and more importantly, whenever that data is changed then it updates whatever Components use it.</p><p>The way you use it is simple-ish, the first value of the array is the actual data, the second value is actually a function that changes the data, even in spite of the fact that it starts as a Constant. The final value, the useState() is just the starting value, more times then not it will likely be empty, so it can be populated later.</p><p>Now if you recall, we can pass data and functions as Props, this expands the use of useState() being both the variable changed and the variable that re-renders the page, and best of all, unlike other data passed down, it can be changed by the child by passing its function that sets the data down, something that can’t be done easily any other way. With that being said, you shouldn’t do that.</p><p>Why you ask? That’s simple, then the Component wouldn’t be something called controlled form. What’s controlled form? An arbitrary set of rules that we came up with and consider “best practice” because we forgot the original goal of cutting down on repetitiveness. Instead of bothering with this powerful option, instead create a function inside the parent that sets the data passed into it as the new useState() data, and pass that function down instead.</p><p>What does this do? Well now our code is three lines longer with a function that does practically nothing, and we are now in controlled form, following those arbitrary rules. If you are going to then ask why those are the rules, I can’t help you, other then to point to what I said prior of “you will have to accept that it makes no sense and deal with it.”</p><p>I think I should finally drop the façade, if it isn’t clear, I’m not the fondest of React, I think its at best only somewhat logical, and more importantly the theory that has developed around it is restricting in a way that causes repetition in my eyes. With that being said if you want to go into the wider web development industry, it is important to pick, and if you are picking it up for that reason, then its best to learn best practice, as much as I railed against it.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4380cdb09334" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Fetching a Then]]></title>
            <link>https://medium.com/@yjakse789/fetching-a-then-cf935cc5849a?source=rss-58ae641ef14f------2</link>
            <guid isPermaLink="false">https://medium.com/p/cf935cc5849a</guid>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Yjakse]]></dc:creator>
            <pubDate>Mon, 14 Aug 2023 21:20:16 GMT</pubDate>
            <atom:updated>2023-08-14T21:20:16.388Z</atom:updated>
            <content:encoded><![CDATA[<p>If you’re anything like me, then you have been somewhat confused by the syntax of fetch() requests. To be clear, for me it’s not so much syntax of the request itself that’s the problem (although it still isn’t the easiest) it is instead, how do the following .then’s know what they are pulling from for data?</p><p>For those of you who have no clue what I’m on about, let me explain fetch() requests real quick. A fetch() request is something you put into your code when you want to retrieve or modify data on an external server, usually in the form of a .json file or external API. Simply put the URL into it, and if you want to modify that data you have to put in an extra argument for what you want done.</p><p>For our purposes let’s assume we just want to get data, all we need is the URL, the issue is nothing is done with the data just yet, and the data it does return isn’t in a format we can use, so the way we solve this is with .then.</p><p>Just so you have an understanding of my first encounter with .then, it looked something like this:</p><pre>fetch(URL)<br>  .then(response=&gt;response.JSON())<br>  .then(data=&gt;{<br>    //Function stuffs<br>})</pre><p>At the time I was still warming up to coding, and this absolutely confused me, like I stated prior, what are the .then’s pulling from?</p><p>It would take me a while, but I think I finally figured it out, the reason why it doesn’t look right, is because that&#39;s not what program sees, it instead sees:</p><pre>fetch(URL).then(response=&gt;response.JSON()).then(data=&gt;{/*Function stuffs*/})</pre><p>You see, whenever a period follows a parentheses its considered a part of the same function, we simply indent and put things on other lines in order to make it look nicer.</p><p>In case you are still confused on how the .then’s get the data, its through arrow functions, basically response as the input isn’t actually a variable called response, instead its the return of the fetch(). Throwing .JSON() at the end of response is what makes it readable, because more times then not the format of the fetch return isn’t what it needs to be for us to use it in our code. After conversion it returns the response value after being reformatted, which is then fed into the next .then, calling the response “data” and using that data for actual code.</p><p>All of this said and done, I hope you walk away from this blog post knowing at least a little bit more, whether it was the main question of “how do they know what to do, I haven’t given any data,” or simply a little more on how fetch() requests work in general.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cf935cc5849a" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>