Skip to main content

Posts

Showing posts with the label Python

Typescript is Hard

So, for a work-project, the language choice handed down by the Overlords-Of-Jobbing has been TypeScript. You see - where I work, we build websites, and we build the infrastructure to support those websites. We also build platforms to support the website-supporting-infrastructure . . . so we like to iterate quickly and be as agile as possible in our workflow. For the current clientele we're servicing it has been decided that TypeScript on the Babel toolchain would be the most productivity-boosting language we could use, and as a result I've had to learn this new-fangled language with all its idiosyncrasies. Now, TypeScript is awesome, it supports both static and dynamic typing, lambdas, the entirety of JavaScript and all the associated libraries and frameworks which come with JS. TypeScript is awesome. TypeScript: - will mend fences - paint your garage - spay your cat - neuter your dog - rent Clerks II on DVD - run you a nice hot bath after a long day But, the m...

So, after writing my several thousand lines of Python....

After I have written and DEMO'd the code... I finally finished writing the several thousand lines of Python code, interspersed with HTML and CSS .. and provided my bosses with a very nice DEMO of what the app does... needless to say, the app was running on our intranet - off my machine, which was partially converted into a Server Node on out intranet... The bosses loved the app, they loved it so much, in fact, that they wanted it "out there" for the world to use! Writing a web app in PHP is hard... So, after writing all that awesome code in Python, it was time to start hunting for a new web provider which allowed Python 3 code ... none were forthcoming, and my bosses didn't like the idea of moving our website to a different provider ... so it was back to the drawing board ... to rewrite the entire thing in PHP ... Well, PHP is not that hard ... when you know it... In the defense of PHP, it's not really a hard language to master ... sure, there are a l...

So, python web apps are not that hard after all

So, I was saying earlier that writing web apps with Python is hard ... I was sorely mistaken... Obviously, I am not using any frameworks to facilitate my project - which is a huge mistake, but a learning exercise for me (I'm  fairly new to python). When not using a framework, you are exposed to the internals of how CGI and Python all meld together, as well as how to use the FieldStorage object to respond to Ajax requests. It's only hard if you do it the "wrong" way Writing a web app with Python 3 is only hard if you do it the wrong way. I come from a background of coding C++ code using the most bleeding edge coding techniques - OOP, TDD, Templates, Multiple inheritance, Polymorphism, insert bleeding edge coding technique here, etc. Now, this is all good and well when using a language like C++ where you only face the OS endpoints (Windows API, stdlib etc) at certain points in your code. But these techniques do not work too well when using a high level sc...

Writing a home-monitoring system using python + internet...

Hmmm, what's that, you say? A Python home monitoring system? Why would anyone want to subject themselves to that kind of abuse? Well, I , for one, amd lazy ... it shows in my work, it shows in my lifestyle, it shows in my weight .. and it shows in the way I write code. I'm the guy that will spend 2 days writing an app (which is available for purchase on the Google App Store) because I'm too lazy to get up and get myself a credit card ... because I'm too lazy to get up and scratch in the drawer for my old credit card so I can purchase stuff from Google Play ... Before you go ranting that I expend time and effort to write an app which costs $3 ... you must remember that I am a programmer .. code it like water to me - extremely bitter, and mostly salty water, but water nonetheless ... I eat code, I think code, I dream code and I can churn out code if I want to because it has become second nature to me. So it's simpler for me to just write it myself than it is to ...

On working with Python and Javascript .. and HTML and Ajax and SQLite

I have recently been creating a production management system. The system is not that complex, but it is taking an inordinate of time to write ... even though I am using rapid-prototyping languages - Python, SQLite3, HTML4/5, Javascript coupled with liberal Ajax sprinkles ... I simply don't understand - but I will try to get to the root cause. So far, I have constructed the tables and written a database backend wrapper - for the SQLITE3 DB which I manipulate on the server side using python cgi. I have created the concept of "sessions", but not in the MOD_PYTHON way, no, in the more traditional - hacky, store-it-in-the-window_name way ... By allowing the user to send an Ajaxlogin request, which generates a session token on the server side, which is then "kept" or "remembered" on the client side by storing the token in the window name browser object variable... It's probably the most rubbish way I can do it, but it works - survives page reloads ...

Building web apps with Python

Well, as much as coding sucks, I love it -so much in fact, that I spend an inordinate amount of time doing crazy things using the incorrect tools for the job at hand - just for the kick of getting it to work! Well, recently, I have been prone to the urge to use different languages to augment my website - for those of you who don't know, I am a software developer, who does web development in his spare time... Actually, my new job involves copious amounts of web development - but that is another story. Well, my current occupation allows me to do web development, and throw in "hardcore" programming languages into the mix - just for fun. So, one day I decided that our company intranet needed a way of sharing files - not a Samba share (Shared folder on Windows), not an FTP server - because FTP causes too much back and forth network traffic.... and certainly not using anything "standard" like PHP or JavaScript! No, I opted to use Python... So, I set up Apache,...

Coding Sucks ... I Love It!

Well, I have been coding since 2002 ... not too long, yes, but in that time empires have risen and fallen, billions of lines of code have been written, and I have learned one thing: Coding Sucks ... I Love It! Seriously, I can't get enough of it... I have written projects in Java, Python, C, C++, PASCAL, assembly (win32) ... most recently JavaScript ... each language (or scripting language) has it's dizzying highs and abysmal lows, but one thing is consistent: They all suck Yes, that is a cruel statement, but let's face it - all languages suck in one way or the other, templates in C++, no-classes in C, the ease with which Python allows you to destroy your project ... the inane simplicity of PASCAL (and lack of true graphics support + hardware accel.) ... There are pitfalls to any language - and yet I have coded in many of them, for one simple reason.... The feeling of triumph when I accomplish a milestone... Or better yet - that feeling of relief when I complete...