Does anyone have any suggestions for books, websit...
# suitescript
s
Does anyone have any suggestions for books, websites, or online courses for a long-time NS Admin and IT professional to begin to learn JavaScript (and ultimately SuiteScript) at a beginner/entry-level? I am going to be mentoring and overseeing their development as an entry-level developer, and want them to have a broader understanding of programming and software development, not just specific to SuiteScript. IT’s been a long time since I was there, and my first books were learning Basic, Pascal, and C in the 90's, so I imagine there are much newer and better resources now 🙂
slack bookmark 1
s
I'd recommend you teach them NFT, because it leverages idiomatic TypeScript/Javascript techniques (simply objects and properties) so any JavaScript 101 they learn can be applied directly. We've found it to be a big help for new-hires with limited experience but some exposure to really any C-like language.
s
they have no experience to any languages (OO or otherwise), but not a bad idea. Our company does prefer TypeScript now over pure JS, so that is a given
s
Also, introducing new people today I recommend TypeScript rather than JS first - because the TS compiler really helps as a teaching tool.
heh, looks like we were typing the same there 🙂
s
One issue is that we have ~300 existing script, maybe half SS 2.x, and the other half SS 1.0, so they will need to learn how to read and edit pure JS5, as well as modern ES
not sure if it’s better to learn the more advanced modern language features first (TS and modern ES), then introduce the older JS5 stuff / way of doing things?
c
@Shawn Talbert do not agree.
s
Based on my experience, people that learned SS1.0 or even 2.0 deeply are loathe to learn anything else new. For that reason we try to teach folks the latest, and have them pick up the rest over time.
c
I suspect SS3 will be typescript. Give it 10 years 😂
s
Your use case may vary, but we spend more time creating new code than we spend changing old, so focusing on best practices up front totally pays off.
s
yeah, new development is going to be the majority of work
maybe some SS1 to SS2.x rewrites
s
Indeed, any time I touch a SS1.0 script, I consider carefully whether it would actually be faster to convert it to our latest standards, reducing tech debt in the process and often gaining perf improvements.
s
without question. We often feel it’s worth it to rewrite any old script that requires being touched. We do have some GL plug-ins, though, and those can’t be updated yet.
s
@CD maybe there's a misunderstanding - I can say with confidence that the JS emitted by TS is better (defined by standards compliance) than what you are writing by hand today. Concern about TS being 'compatible' with NetSuite is an illusion that JS purists here like to tell themselves (while they delight over the number of API signatures and field names they've memorized in absence of a type system to help them out 🙂 )
There are a lot of modern TS courses online - the learning style of your student would play a big role in which medium would be easiest for them
I'd argue that if this person is wearing multiple hats (not 100% suitescript developer) then the more idiomatic the code and strong typed, the better - since it would require less remembering the NS quirks/syntax
c
@Shawn Talbert i think teaching NFT to a newbie & showing them transpiled output would be too confusing, given they have no programming experience. Sorry, I should have explained
s
they are transitioning to full-time developer, though it will take some time of course
s
As it turns out, since SS2.1 supports most of the modern JS stuff, the transpiled output looks almost identical to the TS source, sans types.
s
I don’t want to overwhelm them with complexity at first, so my initial thought was doing basic programming classes in TS or JS. We can dig into the NS-specifics later.
💯 1
s
then again, after using TS for NetSuite scripts for over a decade now, we rarely need to look at the transpiled code, to be honest.
s
in other words, focus on the programming and language aspects first, not the system
s
Yes, agree 100%
especially since NS is NOT a idiomatic API design for JS
the entire API feels like a thin layer around old-school Java, especially the obtuse `getValue()`/`setValue()` sort of syntax
s
sadly, we don’t/won’t have TS source for any of the existing 300+ scripts, and a large number of them will need some tweaking soon. We absorbed a large company, and their sole NS developer left for a different role, and we are now integrating their NS account into ours.
s
fun times!
300 scripts is extreme
hopefully a good time to clean house and consolidate some of that
I'd wager a significant portion of those are no longer necessary - clients with hundreds of home-grown scripts usually just have added over time with little effort spent on cleanup along the way
s
yeah, but time constraints mean the first pass will be updating just the bare-minimum to get them working, if we pause to fix all issues, we’ll be doing this into next year.
s
well, congrats anyway on expanding your dev team
s
Trying to look on the bright side of this, and all those scripts are future opportunities to do some shared learning/teaching.
s
as an side note, since we've had NFT since SS1.0 days, and the general data model in NFT is the same in SS2.1, converting scripts from SS1 to SS2 has been a breeze - NFT-specific code requires almost no changes.
that was an unintended side effect - wish we could say we knew in advance that SS2.x would be coming and this approach would help. We didn't have a crystal ball but happy it turned out this way.
s
one thing I’ve noticed, there are ~100 SS 1.0 scripts, and almost all of them share a single, massive library file with tons of helper functions/code, etc.
s
eek
s
not sure if that’s good or bad yet. At least they didn’t repeat code in multiple scripts?
s
maybe an approach will be to split up that kitchen-sink library into functional chunks
well, on the flip side, if they HAD repeated the code in the scripts then you could individually convert them to your latest standards
with what you describe, sounds like you have a giant dependency and you may struggle to upgrade ANY of those scripts because of it.
if you split the kitchen-sink library into functional parts, you may be able to do more incremental conversion - i.e. you find that only 4 scripts use a related set of functions in the super-lib, and hence you can refactor those 4 and the split-out portion of the lib.
c
230 scripts here. 4 figures users. >$1b company, many different market segments. Much potential to reduce
🎉 1
Lots of that is SS1, written before I started. I refused to write new SS1. 🤣 So they transitioned
s
We avoid kitchen-sink libs to avoid this scenario - even NFT counts as a heavily shared lib, which is why it's specifically designed to support multiple versions (i.e. one script can use NFT 2, another script can use NFT 3 without conflict or cross dependencies)
NS themselves have deprecated 1.0, so it's folly for any company to be writing SS1.0 IMHO
Glad you stood your ground @CD
b
my first javascript book was JavaScript: The Good Parts: The Good Parts, which is sorta oid now, but still respected
later on i appreciated Eloquent JavaScript and You dont know js
my general recommendations todays are things like https://javascript.info/ that actually allow you to run and change the code
✔️ 1
s
TypeScript Recommended Reading • Get started with the official TypeScript Handbook from the creators of the language. • Tackling TypesScript ebook - HTML version is free • TypeScript Playground - great tool for seeing the differences between JS and TS Online Classes • TypeScript Essential Training Duration 4 hours, 19 minutes • Learning TypeScript Duration 1 hour, 8 minutes
those are from our internal wiki, so the links may not work but the titles should be good for a internet search
e
@scottvonduhn I would recommend these courses for JavaScript and Web Development, take a look at the content: •

Ten Days of JavaScript

Front-end Masters BootcampSome Front-end Master Free Courses
s
thank everyone for the suggestions. One concern I had is that most JS resources are geared toward front-end development, while SuiteScript (in our uses cases) is mostly server-side scripting, with a little client-side.
I’ll start looking through various options and see what looks like the most appropriate
s
agreed - focusing on training that is more pure language is more appropriate for SuiteScripters imho. I kinda miss the days of great books though. Some of my first ones (pre-college) were on things like Z80 assembly language 🙂
s
I remember my CS 350 professor telling us why he didn’t have any books or printed texts assigned for his course, saying “By the time it’s in print, it’s already out of date”.
💯 2
c
Folly to be writing SS1 @Shawn Talbert? You sound lucky enough to not have to create CustomGL plugins. SS1 is very much alive in that space (SS2 not supported).
To answer the OP though, I would teach SuiteScript 2 the supported/official NetSuite way (SS2.1/JavaScript) then introduce TS and NFT if your organisation is happy for you to use those.
I strongly prefer TS but there are wider considerations than technical pure-ism. If you tried to hire a SuiteScript TS dev today, will you be able to find one on the market? If Oracle (or a partner) currently support or look at any of your scripts, will their SLAs cover TS? At two clients I've had the enterprise architect team ban "non-standard" SuiteScript code (anything that isn't covered in the Oracle docs). I've also had in-house devs refuse to lean TS and therefore have it banned.
s
Sounds like those clients were paying for 'warm bodies' rather than consultants.
c
The word consultant is overused.
s
aye
s
Somewhat related to NFT, but also modern TS/ES development in general: do most people like/prefer to use classes in ES? I personally do not, and have so far avoided them, unless someone else’s code or library containing them was forced upon me. My opinion is that, unlike many of the other features of modern ECMAScript, I haven’t seen any case yet where classes solve a problem for me in a better or cleaner way than without them. But, I don’t want to impose my bias on others, especially not if I am teaching them. Who really loves ES classes, and why, other than just making the code feel comfortable for people with an OOP background?
c
The old OOP vs Procedural debate...
With SuiteScript development, I'd rarely take an OOP approach, the scripts are often simple and not deserving of things like SOLID and design patterns. For general TS (larger and more complex systems), I will mostly go down the OOP path.
There is very little software engineering ability in most SuiteScript devs I have met. People from a JS/ES background are also less likely to have worked on large and well-engineered codebases like someone from a C++ or Java background. The whole idea of TS was to give JS/ES better types and allow for more complex systems to be reasoned about with objects and all the industry design patterns that come with it.
true news 1
If you look at any large business application/software system, there's a strong chance it is OOP. NetSuite itself is Object Orientated. Obviously, plenty of exceptions apply depending on the domain etc.
true news 1
I would have thought most SuiteScripts are procedural in nature, with a smattering of objects, and that's ok.
s
Well, I spent 12+ years doing development in Java, C#, and C++, and yet I don’t find myself wanting to bring that experience into JavaScript, ever
👍 1
I’ll clarify that I do organize my code into closures or separate libraries, which make sense and provides a level of organization that is necessary for anything large. I just don’t use classes
s
We mostly only use classes for the active-record data access layer (via NFT) and also usually create a class for accessing third party APIs (encapsulating state like credentials access, 'debug' or other diagnostics flags, etc). Other than that, it's functions and lodash and friends.
s
I’ll make sure the training at least covers the concept and use of classes, and will let the new dev decide if they want to use them or not
s
I can say I don't like code I've seen where folks create a bunch of classes with no benefit - e.g. a POJO would do
Classes have turned out to be especially useful for NFT's DAL - the base classes include most of the documented fields pre-defined, you then derive from those to add custom fields. Very handy and keeps the inheritance depth very shallow (1 level)