|
Took a Fortran class in high school, joined the Air Force where they taught me COBOL and let me get a Computer and Information Science degree, and the rest is history.
|
|
|
|
|
|
|
Nah...it's just you live in the past!
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
I find myself doing things I would never do in C# code. The two most common things are:
1) copy and paste code from one HTML page to another
Why? Because making something reusable requires:
a. create a separate js file
b. put the functions in there
c. add a <script> line to suck it in
d. remember that I have these common functions in this other file when writing other pages
OK, I suppose that's sort of the same steps in a real programming language, it just seems harder when working on a website.
2) everything tends to be inline code.
I like to practice writing human readable and short methods when I code in C#. Conversely, when I code in Javascript, I'll do something like this (a somewhat trivial example, granted, but it makes the point):
$('#spinny').jqxLoader('open');
This is completely non-reusable and un-maintainable. Imagine hundreds of pages that all have spinny's for when the page does some sort of AJAX callback, and maybe you want to change something about the spinny behavior.
So this:
function showSpinny() {
$('#spinny').jqxLoader('open');
}
while seemingly stupid, becomes a re-usable and maintainable piece of code.
I wonder what it is about Javascript that promotes these (I only cite two examples) practices? Is it just me? I don't think so, I see other developers writing the same cruft. Albeit, they're also Python developers, and I see the same cruft in their Python code.
Marc
|
|
|
|
|
Finally, something, interesting, and... True. Third problem is, that everything in JavaScript has to take the character "j" as an emblem in it, like C is being used, C, C++, C#, C#++ perhaps now.
The major problem is it being used by kids for mobile development. I don't hate JavaScript. I just take, "right tool for right job" a bit seriously. However, on the bright-side, you don't have to use the Convert.ToType(param) everytime in JavaScript, you'd leave that to the engine itself.
I take JavaScript as a playground language, where you usually test a bit of stuff around; browser stuff. Using JavaScript for any of my production application, library, package or tool, is something that I will try my level best to not come in my mind.
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
Afzaal Ahmad Zeeshan wrote: Using JavaScript for any of my production application
So what do you use for client-side web development?
I still have to get into typescript, but it just seems like another layer of what can go wrong, and I like to recognize the code as mine when I'm debugging.
Marc
|
|
|
|
|
Quote: So what do you use for client-side web development? I don't do web anymore. However, I do have a home server built up for family purposes and entertainment; where I keep the few of the services that my family needs, such as image sharing, music streaming etc — I will not trust Facebook, Twitter and even Google+ with images of my family and what we are cooking for dinner. The web application has its 85%+ part built up as a Web API instead of plain HTML web app. And the clients are Android devices, a Windows Phone, a bunch of Desktop applications. They save me from having to use JavaScript.
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
var spinny = new function(){
var self=this;
this.ID = "spinny";
this.show = function(){
$("#"+ self.ID).jqxLoader('open');
}
}
spinny.show();
spinny.ID="otherspinny";
spinny.show();
Is that better?
modified 20-Oct-19 21:02pm.
|
|
|
|
|
#SupportHeForShe
Government can give you nothing but what it takes from somebody else. A government big enough to give you everything you want is big enough to take everything you've got, including your freedom.-Ezra Taft Benson
You must accept 1 of 2 basic premises: Either we are alone in the universe or we are not alone. Either way, the implications are staggering!-Wernher von Braun
|
|
|
|
|
1) Decouple vanilla JavaScript from DOM JavaScript
2) Write unit tests
3) Repeat
|
|
|
|
|
Camilo Reyes wrote: Decouple vanilla JavaScript from DOM JavaScript
I can't even think of how to do that without classes, events, data binding, etc. anymore. I guess that's why there's all those frameworks like Backbone, none of which I've ever experienced a "wow, this is a great solution." Seems like they're all band-aids sitting on top of a bad language.
Marc
|
|
|
|
|
Of course! The mindset of the frameworks is: "JavaScript sucks! So MOAR JavaScript." Is this not ironic? Vanilla JS is a complete paradigm shift. When you write C#, would you write it like you write Python? A good craftsman never blames the tool.
|
|
|
|
|
Because it's JavaScript, where this is never that, your string is actually a boolean, and array plus object is certainly not a number
|
|
|
|
|
JavaScript, like any other language, is what you make of it. There's nothing saying you can't do what you just did in your own programs to abstract logic. It's perfectly valid. Cheer up bro, you're not shaking hands with the devil until you start using Ruby.
Anyway, where I see that JavaScript has failed miserably is allowing for things like modular development, but it was a language for the web and thus never to be compiled into a single executable. And web requests are expensive, so having 1000 modules to load an app / webpage was never feasible since it would be asking a web server for 1001 requests per page.
But times have changed, especially with Node. There's nothing saying you can't write a well-written app in it, with all your bells and whistsles. The only difference being, you have to get things running manually, there is no JS bells and whistles preprocessor / add-on out of the box type thing. Maybe TypeScript in VS, but most things you have to just know about it to implement it.
Jeremy Falcon
|
|
|
|
|
For me, it's a "fit for purpose" thing.
I see js as being for "disposable" pages (which is what a fair proportion of the Interwebs comprise), and it's absolutely perfect for that, because all you need is either a quick "copy & paste and get the page up" solution, or a page template that already contains the required routines, so you don't even have to copy & paste anything.
If you then want to set up a page that governs those pages, it's simple, quick, and up on the web before your second coffee. No coding standards, no databases, and no time at all "wasted" in getting the product (the content of the pages) to the customer (the web-surfer).
A professional site for a business, however, needs content management, document management, library-based code injection, and at least one database -- it's no longer "pages"; it's now a program/application, which most certainly does need more than js can offer.
However, even professional sites contain a lot of "pages", which don't need all the froufrou, so why waste twelve hours of a developer's time on what can be called "infrastructure work", when all he really needs to do is C & P & tweak a bit of js to get the content up on the site, where the customer can access it?
Not everything needs to be wrapped in swaddling, carefully bandaged, then clad in perfectly-welded iron. Some things just need to be available to the customer.
I wanna be a eunuchs developer! Pass me a bread knife!
|
|
|
|
|
Mark_Wallace wrote: it's no longer "pages"; it's now a program/application, which most certainly does need more than js can offer.
Yup.
Mark_Wallace wrote: However, even professional sites contain a lot of "pages", which don't need all the froufrou,
Quite true. Unfortunately, the web apps I've been developing are anything but froufrou, I can't think of a single page (except the About page) that doesn't have AJAX calls, event triggers, and data binding of some sort.
Marc
|
|
|
|
|
Then js shouldn't be used at all, because it's not fit-for-purpose for such things.
Try to get this idea through to the people who make decisions about what to use.
Put it in a way that makes it understandable -- e.g. tell them that they don't want their trousers made out of the same material as their shirts, even though they wear both.
I wanna be a eunuchs developer! Pass me a bread knife!
|
|
|
|
|
Mark_Wallace wrote: Put it in a way that makes it understandable -- e.g. tell them that they don't want their trousers made out of the same material as their shirts, even though they wear both.
I'm not sure what you're getting on about; but I find cotton athletic shorts made from the same sort of fabric as the t-shirts I wear in my free time much more comfortable than the dressier pants I need to wear to work.
Did you ever see history portrayed as an old man with a wise brow and pulseless heart, waging all things in the balance of reason?
Is not rather the genius of history like an eternal, imploring maiden, full of fire, with a burning heart and flaming soul, humanly warm and humanly beautiful?
--Zachris Topelius
Training a telescope on one’s own belly button will only reveal lint. You like that? You go right on staring at it. I prefer looking at galaxies.
-- Sarah Hoyt
|
|
|
|
|
Pic or...
... On second thought, kindly disregard this posting.
I wanna be a eunuchs developer! Pass me a bread knife!
|
|
|
|
|
Shadows . . . they paint the sunshine.
Why Not Enjoy The Weekend !
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "As far as we know, our computer has never had an undetected error." - Weisert | "If you are searching for perfection in others, then you seek disappointment. If you are seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
And you learnt your physics where exactly?
I am not a number. I am a ... no, wait!
|
|
|
|
|
Software Zen: delete this;
|
|
|
|
|
W∴ Balboos wrote: Shadows . . . they paint the sunshine.
Yes, they do. Enjoy your weekend, as well.
|
|
|
|
|
Quote: Shadows With Cliff Richard on vocals?
- I would love to change the world, but they won’t give me the source code.
|
|
|
|
|