Open Side Menu Go to the Top
Register
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

04-03-2018 , 12:19 PM
Quote:
Originally Posted by Barrin6
Lol I wonder if this is the same class and professor I took. 6 unit course?


Yea i know you know who
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-03-2018 , 12:39 PM
Quote:
Originally Posted by suzzer99
Smaller functions is a great goal to shoot for, and that's how you accomplish it. But absolutes suck. And 5 lines seems way too short.

I picture some poor programmer spending half a day trying to figure out how to break up a function that he could write with 10 lines of code in a minute.
should just shoot for single responsibility principle
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-03-2018 , 12:51 PM
Lol i think this is a freshman year programming class

Kind of amazing i have to take this
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-03-2018 , 01:04 PM
That's pretty ridiculous and so over the top I wonder if he is just being hamfisted in trying to teach a lesson?

It shouldn't affect readability that much though should it?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-03-2018 , 01:16 PM
Devil's Advocate:

I bet there are a lot of cases where people think short methods aren't possible and it turns out there are actually really good and more-readable alternatives with short methods. Writing short methods is sort of a "skill" one gains mostly through practice and experience. This is an academic course so it can make sense to do not-practical things in pursuit of learning new skills.

My actual opinion:

I don't even write really short methods that often in my own code. I should probably do it more often, but, ... meh.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-03-2018 , 01:29 PM
In a more authoritarian, pre-internet age, this kind of thing may have made sense to force students to do things in a certain way to develop certain skills and discipline but nowadays people can just look to see if this is how it works in the real world (and it most certainly is not), which will just demotivate them and cause them to lose respect for the instructor. Also the ability to follow coding standards is a relatively trivial skill easily mastered later, not something that professors should worry about at this stage, given how much there is to learn.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-03-2018 , 02:09 PM
I hate the tiny short function pattern. Much rather have some not perfectly dry code then have jump around between different lines and files and try to remember what arguments are and what return values are doing what.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-03-2018 , 02:27 PM
From what I remember the professor is somewhat lenient on the rule. Just done write 30 liner functions.

I took that class when I first transferred and it was one of my most memorable classes. I learned a ton and a lot of stuff I did in that class is what made me a better programmer. It’s a tough class but it’s very rewarding if you finish all the assignments.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-03-2018 , 02:39 PM
A quick perusal of some recent work suggests my average function length is like 10-12 lines (javascript) given my rough reading of the rules. Some shorter, some a bit longer, but nothing way longer.

Seems short enough to me :P
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-03-2018 , 03:06 PM
Also, in an object-oriented design, larger classes and a large number of public methods (and/or fields/properties) are bigger issues than large method bodies.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-03-2018 , 03:11 PM
Quote:
Originally Posted by Barrin6
From what I remember the professor is somewhat lenient on the rule. Just done write 30 liner functions.

I took that class when I first transferred and it was one of my most memorable classes. I learned a ton and a lot of stuff I did in that class is what made me a better programmer. It’s a tough class but it’s very rewarding if you finish all the assignments.


As a last quarter senior it seems like a really stupid class to have to take, but i am rusty with programming

It’s so weird hoW I’ll be able to go multiple quarters without touching any code and then this quarter has like 70 programming assignments or something.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-03-2018 , 04:33 PM
I think a 15 or 20 line rule might be appropriate, with some exceptions. 5 is completely ridiculous. And all the rules for how many lines something is comprised of are baloney. The best way to enforce specs is to describe them in a way that editors understand so they can highlight them and complain (and/or a program you run your code through that shows you what's wrong)
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-03-2018 , 08:26 PM
I don't see any rules in there about ternaries. You should troll him by having 5 line functions, but with lines that consist of 17 nested ternaries.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-03-2018 , 08:52 PM
I've had to work on JSPs with nested ternaries that went like 400 characters long. Fun stuff.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-03-2018 , 09:14 PM
pretty sure this is in reference to ternaries etc

Quote:
DO NOT use the conditional expression instead of if statement to try to reduce number of lines. Only use conditional expression when returning the value or asigning the value to a variable to be used later.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-03-2018 , 09:32 PM
Quote:
Originally Posted by suzzer99
I've had to work on JSPs with nested ternaries that went like 400 characters long. Fun stuff.
Hah, yeah. I also wrote a bunch of stuff in a language where there was no case statement or "else if" logic. You had to string ternary operators together to handle multiple branches.... it was especially painful in the cases where we'd have to break things up by hour of the day.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-03-2018 , 09:53 PM
Quote:
Originally Posted by Victor
pretty sure this is in reference to ternaries etc
Yeah OK, I just did a Ctrl-F for the word "ternary".

Never heard the terminology "conditional expression" used for them before. Looks like a C++ term.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-04-2018 , 01:06 AM
I assumed conditional expressions were ones like
a = b or c

which means
Code:
if b:
  a = b
else:
  a = c
a = b if b evaluates to true, otherwise a = c
This only works in languages which have the notion of boolean-ness for most objects and also where "or" doesn't try to do a bitwise or and doesn't necessarily return a boolean.

ETA: I guess this is pretty much what the ternary operator does, too, except more limited.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-04-2018 , 07:41 AM
yea you can't use that or you better believe I'd abuse the hell out of it.

I'm actually kind of liking this course. connecting to my school's cluster via VPN and messing around with bash and VIM is something I've always been terrified of but this isn't that bad.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-04-2018 , 12:01 PM
I wonder if in some ways people my age have an advantage with linux. When I started using computers, the command line is basically all their was. So it never seemed weird to me to try a new OS like OS/2 or unix/linux or VMS or something, and be faced with a command line. A lot of the principles from DOS were similar enough to be recognizable, too.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-04-2018 , 03:23 PM
I’m urgently looking for someone that knows Delphi(pascal) language . Please PM me or email me gaysaak@gmail.com TY
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-04-2018 , 05:28 PM
Quote:
Originally Posted by RustyBrooks
I wonder if in some ways people my age have an advantage with linux. When I started using computers, the command line is basically all their was. So it never seemed weird to me to try a new OS like OS/2 or unix/linux or VMS or something, and be faced with a command line. A lot of the principles from DOS were similar enough to be recognizable, too.
I pretty much feel this too. There was MS Windows (3.0) when I first used a PC (though there had been many systems before that), but it wasn't the operating system, just another program / a layer on top - a sometimes more convenient method of doing things.

Which basically still describes Linux/X, but Windows tries very hard to give the opposite impression.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-04-2018 , 06:12 PM
Mobile OSes are going to be a bigger hurdle for Linux in the future. No real concept of a file system, no real control over the OS per se, there are going to be kids growing up on those metaphors that won't be saying "Oh, Unix, I know this" when dropped to a command prompt...
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-04-2018 , 07:30 PM
Things I’m really liking about VIM: never having to take my hands off the keyboard

Things i’m hating about vim/linux: copy pasting large chunks of code, especially from windows over to the terminal I’m using is a humongous pain in the ass
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-04-2018 , 07:46 PM
Quote:
Originally Posted by jmakin
Things I’m really liking about VIM: never having to take my hands off the keyboard

Things i’m hating about vim/linux: copy pasting large chunks of code, especially from windows over to the terminal I’m using is a humongous pain in the ass
Vim has become my life, I'm obsessed and hate coding without it. I honestly don't find copy/pasting (whether totally inside vim or not) bad at all, maybe it's just experience. You know about "+ right?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote

      
m